Solved

Flash CS4  Loader

Posted on 2009-04-07
1
1,054 Views
Last Modified: 2013-11-11
Someone have a simple example of the standard loaderbar with % loaded etc for Flash cs4?
0
Comment
Question by:lrbrister
1 Comment
 
LVL 5

Accepted Solution

by:
john_hollings earned 500 total points
ID: 24095870
The simplest way to load content in AS3 is to have an swf load in your main content swf.  In order to do this you need to ensure that the loader.swf stage is the same size as the main content.swf stage.

Create a new flash AS3 document and add a new layer.  Give the 2 layers the following names:
  text
  actions (lock this layer)

Within the text layer create a dynamic text field and give it an instance name of precent.
On the action layer copy the following code into the actions panel.  I can't take the credit for this code, its a tutorial Lee Brimelow provided on his gotoandlearn web site.

http://www.gotoandlearn.com/play?id=85

Hope this helps.
//Creates an instances of the loader class

var l:Loader = new Loader();

l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);

l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);

l.load(new URLRequest("content.swf"));
 

function loop(e:ProgressEvent):void

{

	var perc:Number = e.bytesLoaded / e.bytesTotal;

	percent.text = Math.ceil(perc*100).toString();

}
 

function done(e:Event):void

{

	removeChildAt(0);

	percent = null;

	addChild(l);

}

Open in new window

0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now