Kaleb242

ShockinglyGreen
  • Content count

    5
  • Joined

  • Last visited

Community Reputation

0 Newbie

About Kaleb242

  • Rank
    Newbie
  • Birthday 09/13/1977

Profile Information

  • Gender
    Male
  • Location
    San Francisco, CA
  1. Since autoPlay:false loops through all movieclips of the loaded swf and stops them from running, you may find that you'll need to restart all movieclips on the timeline of your loaded swf when you want to play it at a later time on demand... just calling play() on the rawContent may not be enough. In my case, I discovered that the designer that gave me several AS3 swfs to load, also included several animated movieclip masks on the timeline, which autoPlay:false had stopped every clip on the timeline, so they needed to be restarted. The appearance was not the same without these movieclips playing too. It would be handy to have a public method to restart those same timeline clips that are stopped by autoPlay:false 's trigger of the _stopMovieClips method. In my case, I created a method to play the internal clips by reverse-engineering the _stopMovieClips method: var contents:ContentDisplay = LoaderMax.getContent("mainClip"); playMovieClips(contents.rawContent); public function playMovieClips(obj:DisplayObject):void { var mc:MovieClip = obj as MovieClip; if (mc == null) { return; } mc.play(); var i:int = mc.numChildren; while (--i > -1) { playMovieClips(mc.getChildAt(i)); } } Would be a nice addition to SWFLoader, considering that we'll need to write a playMovieClips function for every project that uses SWFLoader with autoPlay:false that has loaded swfs with movieclips containing timeline animations inside them. Perhaps I should be using autoPlay:true to avoid the _stopMovieClips method from ever being called, and then call a stop() on the main timeline of the loaded swf when the load is complete, to avoid every MovieClip on the main timeline from being stopped.
  2. Thanks Jack. LoaderMax.getContent("mainClip").rawContent.visible = true; LoaderMax.getContent("mainClip").rawContent.play();
  3. After using SWFLoader with autoPlay:false to load a swf and stop it's contents, how can you get the content to play later (on demand)? Here's my set of loaded swf files... var queue:LoaderMax = new LoaderMax({name:"mainQueue", onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler}); queue.append( new SWFLoader("swfs/main.swf", {name:"mainClip", estimatedBytes:211461, container:container_mc, x:0, y:0, visible:false, autoPlay:false}) ); queue.append( new SWFLoader("swfs/promo1.swf", {name:"promo1", estimatedBytes:190440, container:container_mc, x:0, y:0, visible:false, autoPlay:false}) ); queue.append( new SWFLoader("swfs/promo2.swf", {name:"promo2", estimatedBytes:76251, container:container_mc, x:0, y:0, visible:false, autoPlay:false}) ); I see that there is a protected method in SWFLoader.as called _stopMovieClips(obj:DisplayObject) used when autoPlay==false, but I don't see a public method such as playMovieClips() to be used later if you have used autoPlay:false initially. What is the best strategy for preloading several swfs with autoPlay set to false, then targeting one of these later and play() it's contents? I'm loading in AS3 .SWF files that are timeline animations provided by a designer with no stop frames on them, so I need to use autoPlay:false, and want to trigger one to play at a later time (after loading is complete, of course). I traced the following trying to pinpoint the loaded swf to target, but I'm having difficulty trying to get it to play... trace((container_mc.getChildAt(0).name)); // mainClip trace((container_mc.getChildAt(0).parent).name); // container_mc trace((container_mc.getChildAt(0).parent.parent).name); // root1 trace((queue.content)); // [object ContentDisplay] It's probably something very simple, I'm just not finding a quick solution in the documentation and I want to make sure that I do this the proper way, as intended by LoaderMax. Thanks, ~K
  4. Works beautifully, you are the master. Thanks Jack! ~K
  5. Hey Jack, don't know if this exists, but I ran into a snag trying to use the ColorTransform plugin and ColorMatrix plugin in the AS2 version of TweenLite / TweenMax for a banner project with the ridiculous requirement of Flash 7 AS 2.0 and 30k file size, (yeah that's right, Flash 7, I was equally shocked) so the AS2 ColorTransform plugin and ColorMatrix plugin don't work since Flash 7 lacks flash.filters.BitmapFilter, which is what supplies the guts for those two plugins. In order to tween a Color Transform on a MovieClip pre-Flash 8 / pre-BitmapFilter, I think I'd need an "endObject" plugin similar to the "endArray" plugin to tween between two objects holding Color Transform values and apply them over time with onUpdate and onUpdateParams. I tried hacking together an onUpdate:applyColorTransform method that cycled through properties of one object to another object used for animating the values, but had trouble with it... AS 2.0 Flash 7 and below requires the use of Color() and use of the old setTransform() and getTransform() methods on that "Color"... It would be nice if I could just specify a color object to use for the start values, and an endObject to specify the end values, taking a very similar approach to the endArray plugin, but for objects that have the same name/value pairs like Color() objects have. For example... var DEFAULT_TRANSFORM:Object = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0}; var ROLLOVER_TRANSFORM:Object = {ra:100, rb:50, ga:100, gb:50, ba:100, bb:50, aa:100, ab:0}; var myObj:Object = DEFAULT_TRANSFORM; var colorObj = new Color(targetClip); colorObj.setTransform(DEFAULT_TRANSFORM); TweenLite.to(myObj, 1, {endObject:ROLLOVER_TRANSFORM, onUpdate:applyColorTransform, onUpdateParams:[myObj]}); function applyColorTransform(obj:Object):Void { colorObj.setTransform(obj); } Maybe there's a better way to go about it that I haven't thought of, but I think that kind of plugin would be handy and generic enough to have around... but maybe that's what TweenLite is already doing, looping through the matching properties of two objects and applying them to the target over the duration and easing type specified. My attempt wasn't looking so smooth, but maybe it was the lack of rounded props or my lack of sleep. ; )