20Jun

Image Gallery - Part I - The Scrolling Menu

1 comment so far

So for my image gallery project I wrote up some classes that will generate a scrolling menu and center the menu at the bottom of my page. I have made it so the menu will accept variable widths of images (I honestly haven’t tested this, but I am 98% confident it will work), but a [...]

12Jun

Time Machine Animation with Tweener

No comments

So I am trying to think of a way to create some type of “Time Machine” animation. Fortunately with the help of Tweener, this is what I came up with - Please note that this is a work in progress. You will need to click the movie first to activate the keyboard events.
So the number [...]

16May

Preloading Multiple Images with Actionscript

2 comments so far

One of my new projects involves a lot of imagery so I decided to write a class that I could send it an array of images and preload them with a loading bar. The code below doesn’t have a loading bar, but if you trace out the code you can see how you can integrate [...]

08Jan

[AS 3] UPDATE Preloader -> flash.display.Loader and flash.display.LoaderInfo

No comments

After a little tweaking, I got the preloader code to work, thanks for the comment in regards to my class naming convention!

package
{
import flash.display.Sprite;
import flash.display.Loader;
import flash.display.LoaderInfo;
import flash.net.URLRequest;
import flash.events.Event;
import flash.events.ProgressEvent;

public class Preloader extends Sprite {

private var ldr:Loader = new Loader();

public function Preloader()
{
ldr.load(new URLRequest(”/path/to/my/image.jpg”));

ldr.contentLoaderInfo.addEventListener(Event.OPEN,open);
ldr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,progress);
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,result);
}

function open(evt:Event):void
{
trace (”opening file”);
}

function progress(evt:ProgressEvent):void
{
trace (”loaded: ” + evt.bytesLoaded);
}

function result(evt:Event):void
{
trace (”fully loaded”);
addChild(ldr);
}
}
}

[...]

Categories: Actionscript 3, Preloading
07Jan

[AS 3] Preloader -> flash.display.Loader and flash.display.LoaderInfo

1 comment so far

Package is flash.display and the public class Loader
The Loader class is used to load SWF, JPG, PNG, or GIF files and uses the load method to initiate loading.
I have been searching around for some AS 3 preloader code and have come up with this.. but for some reason I just can’t get it to work.. [...]

Categories: Actionscript 3, Preloading