blackthir13en Icon
ActionScript  

A tidbit of stuff I've been learning lately

greenthumb.pngWow the amount of potential opportunities, any more for someone in multimedia field amazes me.  At least compared to the last time I looked for a job.  In fact, I was so worried last time, that I wasn't going to get a job in this field that I took a job which required me to learn Perl in a week.  So I did it, and within a few weeks after going through QA I figured out how to create demo projects for high end clients.  I did a pretty good job I think, if I worked their over 3 years.Thank god I got to do other things, besides just perl.

But anyhow, ever since I started looking for a job I was trying to figure out what I wanted to do.  Flash, Video, SEO, PHP ect...I find it all so interesting.  And I will find an outlet for each of those.  Some may be in jobs, others in organizations, other charity work, ect.....

For now, I'm still working on completing a freelance project.  And it just so happens that it's a Flash project.  There was a snag in their implementation, and after trying to diagnose the situation.  I felt that rewriting the project in AS3 might speed up and/or help me guess how to debug the situation.  I'm at a disadvantage, because I wasn't allowed to see the behavior.  I'm doing a lot of guessing and am not familiar with how their servers and the rest of their software works.  I just now how to get JavaScript to get the inputs, and then send back some scores.  And load everything in dynamically.  Well I did anyways in AS2.  But I've been actively learning the object oriented style of utilizing classes and I am doing pretty good so far.  I've had a few snags like trying to figure out how to get SwfObject variables sent from javascript into a variable I could use in flash.

Luckily I eventually found:

var paramObj:Object = LoaderInfo(this.stage.loaderInfo).parameters;
var url:String = String(paramObj[keyStr]);

Then I had issues creating a variable for an object, that only created itself once and not for each duplicate.  So I used this code:

            if (doOnce) {
                GlobalVarContainer.vars.initArray=[0,1,2,3,4,5,6,7];
                var shuffledArray:Array;
                GlobalVarContainer.vars.shuffledArray= distinctShuffle(GlobalVarContainer.vars.initArray);
                doOnce=false;
                trace("mytest " + GlobalVarContainer.vars.shuffledArray);
            }

Oh yeah and do you see that GlobalVarContainer, that was another hurdle.  I wanted a few Global variables to play around with, so I came across this great class, from http://greenethumb.com/

package net.blackthir13en.utils{
    public class GlobalVarContainer {
        public static  var vars:Object = [];
    }
}
I'll go more into detail on each, but I was working a bit with sager through out the day thowing ideas back and forth.  And I think he eventually helped me using an object to collect the values from JavaScript.  I think I owe the syntax for that one to someone on the OWLTS team.  But the other middle variable example, though not pretty is all me. 

Well it's getting late, and I'm gotta be up early because I'm getting my info for a second interview for a place that I'm very interested in.


Tagged with: ActionScript, AS3, Global, JavaScript, Object, SunKIng

Leave a comment