Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by chrisatflash

  1. I created a util for this, so now I can stop all tweens of any displayobject. package com.chris.util { import com.greensock.TweenMax; import flash.display.DisplayObject; /** * ... * @author Chris S */ public class TweenMaxUtil { static public function stopAnimation(obj:DisplayObject):void { var tweenArray:Array = TweenMax.getTweensOf(obj); for (var i:int = 0; i < tweenArray.length; i++) { var tweenref:TweenMax = tweenArray[i] as TweenMax; tweenref.pause(); } } static public function startAnimation(obj:DisplayObject):void { var tweenArray:Array = TweenMax.getTweensOf(obj); for (var i:int = 0; i < tweenArray.length; i++) { var tweenref:TweenMax = tweenArray[i] as TweenMax; tweenref.play(); } } } }
  2. thanks for the reply! It's great that this feature is available! Regards, Chris.
  3. Hello, Is it possible to pause a specific tween by it's diplayobject type? I noticed TweenMax.pauseAll() , but Is there also something like TweenMax.pause(obj) and TweenMax.resume(obj) ?
  4. Hello, In my projects I usally the onComplete: param, and set the visibility of the object to false after it's done tweening. TweenMax.to(mc, 1, { alpha:0, onComplete:hideAway }); function hideAway():void { mc.visible = false; } I was wondering if there is a property like autohide? that does this automatically. If not, it would suggest it on the wish list if possible. Regards, Chris.
  5. Hi Carl, Thanks for your nice example and explenation! It helped me a lot. The autoDispose property was indeed responsable for the error's i got. So now it's working great. I tried your pause method, but that deed not seem to work, so i tried your example like this and that worked form me! var allMyLoaders:Array = _que.getChildren(); for (var i:int = 0; i < allMyLoaders.length; i++) { var videoLdr:VideoLoader = allMyLoaders as VideoLoader; videoLdr.pauseVideo(); } Thanks for the reply, Regards, Chris.
  6. Hello, I am using the VideoLoader class. I have multiple videoclasses in my page and am trying to loop to the VideoLoader classes and run the pauseVideo method, but it's collapsing and giving errors on the setter videoPaused. I tried debugging and it's giving error's starting from _setForceTime(0); I tried uncommenting each line after, but it seems that even the _ns object = null, like the _sprite =null and so on. This is all my code i used to setup the VideoLoaders. What am i doing wrong? Or is this a bug? And is it possible to play multiple video's at once? Now they only played after they are loaded completely. I would like to have them played like youtube.. progressively, is that build in? public function startLoadingAllVideos():void { LoaderMax.activate([VideoLoader]); _vidurls = []; _vidLoadersArray = []; for (var i:int = 0; i < vidholdersArray.length-1 ; i++) { _vidurls.push("video/page5/wo_" + (i + 1).toString() + ".f4v"); } var que: LoaderMax = LoaderMax.parse(_vidurls, { maxConnections:1, autoDispose:true, repeat:-1, onChildComplete:childCompleteHandler, onComplete:queCompleteHandler}); que.load(); } private function childCompleteHandler(event:LoaderEvent):void { trace("on child complete handler"); var videoLdr :VideoLoader = LoaderMax.getLoader(_vidurls[_vidcounter]); _vidLoadersArray.push(videoLdr); videoLdr.volume = 0; var vidcontent : ContentDisplay = videoLdr.content; var holder : MovieClip = vidholdersArray[_vidcounter] as MovieClip; vidcontent.width = holder.width; vidcontent.height = holder.height; holder.addChild(vidcontent); _vidcounter++ } private function queCompleteHandler(event:LoaderEvent):void { trace("on que complete handler"); } } public function pauseAllVideos():void { for (var i:int = 0; i < _vidLoadersArray.length; i++) { var videoLdr:VideoLoader = _vidLoadersArray as VideoLoader; videoLdr.pauseVideo(); } }
  7. You noticed that i used maxConnection, that should be maxConnetctions , so i think it's my bad I am going to test it online and if there is a problem with it, i will send you the fla and all source code with the to load assets. Thanks Jack! I am just switching from the caurina tweener to your very enhanced tweener and loader classes! So far excelent work! i'm goint to make a donation soon because it safes me a lot of time
  8. Hello, I am using the parse method of the LoaderMax with a maxConnection of 4. like this: var urls:Array = ["img4.jpg", "img5.jpg", "img3.jpg", "img2.jpg"]; _que = LoaderMax.parse(urls, { maxConnection:4, onChildComplete:_childCompleteHandler}, { width:80, height:110, scaleMode:"strech"}); in the method onChildComplete i have: private function _childCompleteHandler(event:LoaderEvent):void { var currentContent : ContentDisplay = event.target.content; trace(event.target + " finished) } The strangest thing is, that img4 is about 3MB and the others are about 10kb. I would think that the img4.jpg would be loaded as last, but that is not the case. With the above urls in this sequence, i get onChildComplete first ( img5, img4, img3, img2), but that shoud be (img2, img5, img3, img4) What am i doing wrong? Or is not the way the loader works when using a higher MaxConnection, that the lightest file is loaded first and the largest file is loaded last? And / Or is there a way to pass a array of estimateBytes that correspond with the urls Array?
  9. Thanks, but i got an error: Implicit coercion of value with static type Object to a possible unrelated type com.greensock.loading.core:LoaderCore is used it like you said, var index:int = _que.getChildIndex(event.target); What am i doing wrong? the _que is a variable setup like this: _que = LoaderMax.parse(urls, { maxConnection:1, onProgress:_progressHandler, onComplete:_queCompleteHandler, onChildComplete:_childCompleteHandler}, { width:80, height:110, scaleMode:"strech"}); oops, i just see it, i had private var _que : LoaderMax; but it's not of that type i guess ?
  10. Hello, I can someone help me out please? Perheps it's very simple, but when using the parse method of LoaderMax you can't give each item an id. The reason why is because item2 in the array can be much larger to load then item 0 or 3 so what i would like is to check when some item is finished loading and then add it to the stage and do some tween motion with this current loaded item. My question is, can you get an id ? or the position in the array of the current item that is loaded? so, img1.jpg = id0, card2.swf = id1, etc.. This is the code i have so far: var containers:Array = [clip1, clip2, clip3, clip4]; private function loadMultipleItems():void { LoaderMax.activate([imageLoader, SWFLoader]); var urls:Array = ["img1.jpg", "card2.swf", "img3.jpg", "img4.jpg"]; var que:LoaderMax = LoaderMax.parse(urls, { maxConnection:4, onProgress:_progressHandler, onChildComplete:_childCompleteHandler}, { width:80, height:110, scaleMode:"strech"}); que.prependURLs("assets/cards/"); que.load(); } private function _progressHandler(event:LoaderEvent):void { //trace("progress ", event.target.progress); } private function _childCompleteHandler(event:LoaderEvent):void { var currentContent : ContentDisplay = event.target.content; //can i get the event.target.id ?? where for example the id is the position in the url array? //something like this: var idLoaded: int = currentContent.id ; containers[idLoaded].addChild(currentContent); }
  11. Hello, When you initialise a tween : TweenLite.to(this, .7, { rotation:45, ease:Quad.easeIn, onUpdate:onUpdateCheck}); Can you remove the onUpdate listener of a Tweenlight too, like the adobe tween? function onTweenUpdate(e:TweenEvent):void { if(some condition) { e.currentTarget.removeEventListener(TweenEvent.MOTION_CHANGE,onUpdateCheck); } }
  12. Thanks Carl! That is a great feature, i did not know about tweening an array, with TweenMax.allTo
  13. Hello, Is there a listener for the tweener, to listen for the last item in a loop that is finished? I know you have onComplete, but that is for every tween. For example: for(var i:int = 0; i var tile:Bitmap = tileArray; TweenMax.to(tile, 5, {rotation:50, ease:Quad.easeOut, delay:0.02*i, onLastItemComplete:finishedWithAllItems }); } function fishinedWithAllItems():void { trace("the last tile finished with tweening"); }