Solved

Flash CS4  Loader

Posted on 2009-04-07
1
1,055 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Updating Flash Player with GPO 3 347
Adobe Flash Player - PPAPI plugin 6 528
YouTube video issue 28 110
2012 Domain With 350 Machines All Running Windows 7 7 124
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

912 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

22 Experts available now in Live!

Get 1:1 Help Now