Mailing List
Home
Forum Home
Flash Pro
Subjects
Subject: RE: Firework Effect
Web Service Results
Flash Interface with 10mb xml file
AW: [Flashcoders] Switch/Case vs If/else
AW: [Flashcoders] Switch/Case vs If/else
Flash MX 2004 Sucks
Reading and displaying RSS feeds in Flash MX
Flash and QuickTime VR
Textfield prototype question
XML to Object help
Order of events per frame
MX2004 Dataset itemClassName
memory management removeMovieClip /
Event Dispatcher between classes
Help: MX 2004 How to script a print button to print the entire sli
ScrollPane component doesn 't auto update
setInterval bug identified and fixed
setInterval bug identified and fixed
Listener Object 's best practice
 
Subject: Newbie ....

Subject: Newbie ....

2004-03-13       - By Andreas Weber

 Back
Reply:     1     2     3     4     5     6     7     8  

If you are publishing for Flash Player 6 or higher it's preferable to use
the 'new' event handler model.

Let's say your script on(press){...} is attached to a button clip with the
instance name loadBtn_mc you can simply rewrite the handler like

  loadBtn_mc.onRelease = function(){
    loadMovie ("tshirt.swf",chargeur_clip);
  }

Put this code in the first frame of the timeline where the loadBtn_mc
appears/resides on.
You could also use a onPress event, but usually onRelease is prefered
because this gives the user the possiblility to still change his mind while
clicking: if the mouse is then draged away from the button and released
outside, the button action does not take place (thus behaving along the
user's expectations).

Now, to monitor the load progress add this code on the same frame:

  loadBtn_mc.onEnterFrame = function(){
    var loaded = chargeur_clip.getBytesLoaded();
    var total = chargeur_clip.getBytesTotal();
    if(total > 15 && loaded >= total){
      trace('tshirt.swf completely loaded');
      delete this.onEnterFrame;
    }
  }

Keep in mind that to access the properties of (former) tshirt.swf you now do
this through chargeur_clip.
If you have a function with the name test inside tshirt.swf, you now call
this function like:

  chargeur_clip.test();

You do not use the identifier 'tshirt' anymore.


HTH
-- ---- ------
Andreas Weber
motiondraw.com




-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
Supported by Fig Leaf Software
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
Lower Prices for Certified Training! Check out new lower prices for
Certified Macromedia Training from Fig Leaf Software. Expand your
skill set with courses in ColdFusion, Flash, Rich Internet
Applications and .NET in the new year.  Fig Leaf Software provides
the highest caliber instruction at our training centers in Washington  
D.C., Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at
your location.

Get the details at http://training.figleaf.com/
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
To unsubscribe, e-mail: flashnewbie-unsubscribe@(protected)
For additional commands, e-mail: flashnewbie-help@(protected)