Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

biodapesada

Members
  • Posts

    2
  • Joined

  • Last visited

biodapesada's Achievements

1

Reputation

  1. Thanks! The useFrames parameter helped me to synchronize the frames. The problem is exactly that you said. I converted the tweens of the object loaded to frames. The code that I made: var swfloaderObject:SWFLoader = SWFLoaderObject; //Loaded swf convertTweensOf(swfloaderObject); function convertTweensOf(swfLoader:SWFLoader):void { var tweenMaxClass:Class = swfLoader.getClass("com.greensock.TweenMax"); //get the TweenMax in the swfloader var _tweensConverted:Array = new Array(); swfLoader.rawContent.addEventListener(Event.ENTER_FRAME, function enterFrameFunc(e:Event):void { if(swfLoader.rawContent.currentFrame == swfLoader.rawContent.totalFrames) { swfLoader.rawContent.removeEventListener(Event.ENTER_FRAME, enterFrameFunc); } var tweens:Array = tweenMaxClass.getAllTweens(); //Get tweens of the object for each(var tween:* in tweens) { var verify:Boolean = false; for(var i:int = 0; i < _tweensConverted.length; i++) { if(tweens[i] == tween) { verify = true; break; } } if(!verify) { var paramsInfo:Object = tween.vars; if(!paramsInfo["useFrames"]) { paramsInfo["useFrames"] = true; //Set true paramsInfo["delay"] = int(paramsInfo["delay"]*swfLoader.rawContent.loaderInfo.frameRate); //Convert seconds to frames tween.pause(0); // pause to start tween.kill(); //kill current tween tween = new tweenMaxClass(tween.target, Math.round((tween.duration()*swfLoader.rawContent.loaderInfo.frameRate)), paramsInfo); //add new tween with frame cont _tweensConverted.push(tween); //push new tween to control } } } }); } Now, the first code, when I play the object tweens and the tweenmax, they are synchronized. Sorry for my English. I'll try to take more care next time. Thanks again!
  2. I load a swf file in my application, and the swf have some tweens (TweenMax). The problem happens when I play and stop the object, like this: var swfloader:SWFLoader = SWFLoaderObject; //SWFLoaderObject is my swf loaded var tweens:Array = tweenMaxClass.getAllTweens(); for each(var tween:* in tweens) { tween.seek(0); //0 is example } swfloader.rawContent.gotoAndPlay(0); //0 is example The objects are out of sync, and can not correctly resume animations, either by stress processor or other problem.
×