ActionScript
A tidbit of stuff I've been learning lately
by blackthir13en , on November 13, 2007 11:31 PM - Comments (0)
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{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.
public class GlobalVarContainer {
public static var vars:Object = [];
}
}
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