Re: [Flashcoders] AS 2.0 (AS 3.0) question - knowing when a MovieClip is on it's last frame.
If you are loading an AS2 SWF into an AS2 swf, you can cast the loaded SWF to a class of your choice by using the __proto__ method which is shown below: Then you write a class that has an enter frame / tick, etc. to monitor playback and cast your loaded SWF to an instance of this (Animation is my class that monitors the _currentframe, etc.): private var _player:MovieClip; private var _currentAnim:Animation; private var _loader:MovieClipLoader; private function _loadAnim(file:String):Void { _loader.addListener(this); _loader.loadClip(file, _player); } //Implement MovieClipLoader listener functions private function onLoadInit(pClip:MovieClip) { _loader.removeListener(this); _player.stop(); _player.__proto__ = Animation.prototype; _player.__constructor__ = Animation; _player.__constructor__.apply(_player); _player._lockroot = true; _currentAnim = Animation(_player); _currentAnim.addEventListener(animend, Delegate.create(this, _playNextIntro)); _currentAnim.rewind(); _currentAnim.stop(); } If you are loading into an AS3 swf, you can't do this and I am not sure, but I guess you do have to do the onEnterFrame work around. Paul Andrews wrote: AS2.0 question: I have some AS2.0 swfs supplied to me (generated by captivate) that are loaded as part of my application. Unfortunately they don't have a stop() on the last frame, so they loop. Fortunately they are completely linear, so they play through from start to finish (and over again). I'd like to have them stop when they reach the last frame. About the only way to do it that I can think of is to use onEnterFrame to monitor the playhead of the loaded swf and and stop it when it hits that last frame. Am I missing any other way of doing this? I'm trying to avoid having the swfs regenerated. AS3.0 question. Currently my main application is written using AS 3.0 and having AS2.0 swf supplied was a bit of an unexpected surprise. I realise that AS3.0 cannot directly control an AS2.0 swf that's been loaded, but are there any completely reliable solutions to communicating between these to allow the AS3.0 application to send one-way messages to the AS2.0 swf? Thanks, Paul [The swfs are actually swf versions of powerpoint slides. Sadly every mechanism I can find for generating swf from powerpoint or via screen capture only creates AS2.0 based swfs] ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Glen Pike 01326 218440 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS 2.0 (AS 3.0) question - knowing when a MovieClip is on it's last frame.
Hello Paul, Regarding messaging an AS2 swf within an AS3 swf, I've found Grant Skinner's SWFBridge reliable: http://www.gskinner.com/blog/archives/2007/07/swfbridge_easie.html HTH, Ian On Fri, May 30, 2008 at 10:56 AM, Paul Andrews [EMAIL PROTECTED] wrote: AS2.0 question: I have some AS2.0 swfs supplied to me (generated by captivate) that are loaded as part of my application. Unfortunately they don't have a stop() on the last frame, so they loop. Fortunately they are completely linear, so they play through from start to finish (and over again). I'd like to have them stop when they reach the last frame. About the only way to do it that I can think of is to use onEnterFrame to monitor the playhead of the loaded swf and and stop it when it hits that last frame. Am I missing any other way of doing this? I'm trying to avoid having the swfs regenerated. AS3.0 question. Currently my main application is written using AS 3.0 and having AS2.0 swf supplied was a bit of an unexpected surprise. I realise that AS3.0 cannot directly control an AS2.0 swf that's been loaded, but are there any completely reliable solutions to communicating between these to allow the AS3.0 application to send one-way messages to the AS2.0 swf? Thanks, Paul [The swfs are actually swf versions of powerpoint slides. Sadly every mechanism I can find for generating swf from powerpoint or via screen capture only creates AS2.0 based swfs] ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS 2.0 (AS 3.0) question - knowing when a MovieClip is on it's last frame.
Paul, This post includes sending data between AVM2 and AVM1 but it also shows manipulation of a movie clip. You could apply the same technique to the SWF PPT. http://www.learningactionscript3.com/2007/12/14/sending-data-from-avm2-to-av m1/ Rich http://www.LearningActionScript3.com On 5/30/08 5:56 AM, Paul Andrews [EMAIL PROTECTED] wrote: I realise that AS3.0 cannot directly control an AS2.0 swf that's been loaded, but are there any completely reliable solutions to communicating between these to allow the AS3.0 application to send one-way messages to the AS2.0 swf? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders