Ignite Salt Lake

Ignite Salt Lake

Looking for something to do in November? Well on Thursday November 13th you could be a part of the first ever Ignite Salt Lake event. What’s Ignite? Well you can visit http://ignite.oreilly.com to check it out but the basic idea is:

If you had five minutes on stage what would you say? What if you only got 20 slides and they rotated automatically after 15 seconds?

The event is free and will be held at the old downtown library (now The Leonardo Science Center).

For more info visit:
http://www.ignitesaltlake.com

Related Posts:

  • No Related Posts

Flash AS3 _global or root variables

Flash actionscript 2 was great for _global or root variables or values.  With actionscript 3 ‘_global’ and ‘root’ are not longer valid markup.  Since AS3 is object oriented scripting, those methods of assigning values are no longer valid.  So, the question is: how do I use global or root variables in Flash AS3 (actionscript 3). Here is a method that I use on projects where I need to have a work around and utilize a variable that will be called in multiple functions across the timeline.

First, I create an actionscript file (.as) with my variable names and their types declared within a class, in this case I called my class ‘MyGlobal’.

package {

public class MyGlobal {

public static var myTotal:int;
public static var myArray:Array = new Array();
public static var mySting:String = new String();
}

}

Save this file as ‘MyGlobal.as’.

Next, create a new Flash file (.fla) and save it in the same location as the MyGlobal.as file. When we create our swf file the .as file will be compiled.

In the .fla file we need to import our class that we have created.

import MyGlobal;

Now we can assign values to these variables within the .fla file and utilize them anywhere.  Just remember to use the class name MyGlobal in front of the variable name in the constructor.

MyGlobal.myTotal = 22;

MyGlobal.myArray.push(“value1″);
MyGlobal.myArray.push(“value2″);
MyGlobal.myArray.push(“value3″);

MyGlobal.myString = “this is a string”;

That’s it.  Global variables are alive and well in Flash AS.  Have fun!

Related Posts:

  • No Related Posts

Flash AS3 Set Depths – setChildIndex Bring to Front

Back in the day in Flash you could set the depths with swapDepths().  In AS3 you use setChildIndex to set the depths of your symbol.

//send to back

setChildIndex(myMC,0);

//bring to front

setChildIndex(myMC,numChildren – 1);

So if you have 3 clips (myMC1, myMC2, myMC3) and you want them to show up in that depth order, simple call them in that order.

setChildIndex(myMC1,numChildren – 1);
setChildIndex(myMC2,numChildren – 1);
setChildIndex(myMC3,numChildren – 1);

Have fun setting your depths using AS3 and setChildIndex!

[associated_posts]

Related Posts:

  • No Related Posts