Jump to content
Search Community

Carl last won the day on December 24 2023

Carl had the most liked content!

Carl

Moderators
  • Posts

    9,824
  • Joined

  • Last visited

  • Days Won

    546

Everything posted by Carl

  1. i can't seem to find where you are tweening screen 1 2 or 3 TO alpha:0 you seem to be using FROM alpha:0 which is probably the problem. change timeline.append( TweenLite.from( mc_screen3, 0, {alpha:0} )); to timeline.append( TweenLite.to( mc_screen3, 0, {alpha:0, immediateRender:false} )); immediateRender:false will prevent the tween from rendering as soon as it is created. 0 duration tweens are technically completed the instant they are created.
  2. I don't see where you are setting _isPlaying to true or where you are declaring its initial value or creating it so I have to assume it always has to be false and thus you will always load and play a new sound. Also it is not clear what the Timer is doing. I think you have to find a way to tell your button what it's sound is when you create the button then when you click to play the sound you should check to see if the sound has loaded and whether or not it is playing. you can use the LoaderStatus and playProgress of the MP3Loader to determine both. consider the following example: import com.greensock.loading.*; import com.greensock.events.LoaderEvent; import flash.events.MouseEvent; var mySound:MP3Loader = new MP3Loader("sampleSound.mp3"); play_btn.addEventListener(MouseEvent.CLICK, playSound); function playSound(e:MouseEvent):void{ trace("\nmySound.status = " + mySound.status); //0 - READY //1 - LOADING //2 - COMPLETED //if the sound hasn't fully loaded then try to load it if(mySound.status != LoaderStatus.COMPLETED){ mySound.load(); trace(" *** the sound has not yet loaded. it will autoPlay as soon as it can ****" ) } else { trace("sound is fully loaded"); //only play the sound if the soud is done playing if(mySound.playProgress == 1){ trace("I will allow the sound to play"); mySound.gotoSoundTime(0, true); }else{ trace("\n **** Sorry the sound is currently playing, ****"); trace("\n **** Please wait " + (mySound.duration - mySound.soundTime) + " seconds"); } } } attached is a sample file that illustrates the basic concepts of a sound - only loading if it hasn't yet loaded. - only playing if it is not currently playing. feel free to implement this into your project's design as you see fit. more on LoaderStatus: http://www.greensock.com/as/docs/tween/ ... tatus.html
  3. I'm quite sure that putting the OverwriteManager code in the parent will suffice and you only need it once. I would recommend that you create a totally separate project somewhere and try to get the TransformAroundPointPlugin to work in a very simple example. At least then you will have confirmation that there is nothing wrong with the files that you purchased.
  4. the first issue could just be an overwrite issue. http://www.greensock.com/overwritemanager/ use OverwriteManager.init(2) let that run as soon as your class is instantiated. as for the TransformAroundPointPlugin issue, I really don't know why the plugins are not being found. Do you have an old greensock swc or class files that could be causing a conflict when the app compiles? If the problem persists please post back here. Its important that you get this resolved. '
  5. you are going to need 3 tweens. I would recommend using TimlineLite/Max as it makes sequencing a breeze. clouds.x = 500; var tl:TimelineMax = new TimelineMax({repeat:1}) tl.append( TweenLite.to( clouds, 1, {x:-100 ) ); tl.append( TweenLite.to( clouds, 2, {x:1000 ) ); tl.append( TweenLite.to( clouds, 1, {x:500 ) ); you could also create a function that includes a series of delayed tweens and have the last tween call the function again if you want to loop over and over and over. OverwriteManager.init(2) clouds.x = 500; function createAnimation(){ TweenLite.to( clouds, 1, {x:-100 ); TweenLite.to( clouds, 2, {x:1000, delay:1 ); TweenLite.to( clouds, 1, {x:500, delay:3, onComplete:createAnimation ); } createAnimation(); To learn more about TimelineLite/Max read : http://www.greensock.com/timelinelite And watch these videos : http://active.tutsplus.com/series/timel ... ter-guide/
  6. just a hint you can use tweens in your timeline that have 0-second durations if you want to very quickly move santa down to the next line var tl:TimelineMax = new TimelineMax({repeat:-1, yoyo:true}); //move right tl.append(TweenLite.to( santa, 1, {x:300})) //jump down tl.append(TweenLite.to ( santa, 0, {y:"60", immediateRender:false}), .2); //move left tl.append(TweenLite.to( santa, 1, {x:-60})) //jump down tl.append(TweenLite.to ( santa, 0, {y:"60", immediateRender:false}), .2) tl.append(TweenLite.to( santa, 1, {x:300})) tl.append(TweenLite.to ( santa, 0, {y:"60", immediateRender:false}), .2); tl.append(TweenLite.to( santa, 1, {x:-60})) tl.append(TweenLite.to ( santa, 0, {y:"60", immediateRender:false}), .2); tl.append(TweenLite.to( santa, 1, {x:-60})) tl.append(TweenLite.to ( santa, 0, {y:"60", immediateRender:false}), .2) *immediateRender:false is used to make sure that those tweens don't render until their time comes while the timeline plays. when you have tweens with 0-second durations, TweenLite automatically thinks: "oh, this tween has no duration, i better run it right now!" which is usually the desired behavior if a tween has no duration. in this case we want the downward shift to wait for the right time. to get around the immediateRender issue you could also use a duration of .01 seconds (really fast) and everything will be groovy. file attached. this should be enough to get you going. your timeline is going to be more complex with multiple santas and lines of text.
  7. I would build a simple animation in the Flash IDE and get the boss's approval before coding a single thing;) There are multiple ways of approaching something like this, you could make it totally dynamic: based on how many lines of text you have you could loop through your textfields and switch between odd and even iterations to append tweens that would move santa and the text left or right. you could use some trickery to attach the text to santa and after a certain distance detach the text. --- if its only 4 lines of text, just manually build a timelinelite with a series of tweens appended. its really not the extra effort to make it flexible enough to handle 50 or a hundred lines. the tricky part is probably going to be getting the text to follow santa at the same speed, detach, and then have santa continue moving. you might have to play around with that for awhile. once you get it right i'm sure it will be easy to duplicate for each direction.
  8. it appears the playback of your animation is tied into the loading of your sound. does "sound complete" trace every time you rollover? the way you have things set up there are many possible points of failure that you need to test: 1: doe the clip go to frame 2? 2: does the timeline get created properly 3: does the sound load properly? 4: does the timeline play? if it is at all within your skill set I would urge you to try to come up with a way that you can load your sound once and create your timeline once. then when ever you do a roll over you just have to tell the timelinemax to restart().
  9. Carl

    smooth wiggle

    adding a filter makes it render on whole pixels. if you need to use filters, BlitMask does a great job of smoothing it out as seen in the rotated/glowy text example on the BlitMask page http://www.greensock.com/blitmask/
  10. use TweenMax's repeat and yoyo special properties timeline.append(TweenMax.to(mc_smarterGlow, 1, {alpha:1, repeat:1, yoyo:true}), -0.1);
  11. use TweenMax's onCompleteListener import com.greensock.*; import com.greensock.easing.*; //*** MUST import TweenEvent import com.greensock.events.TweenEvent; TweenMax.to(mc, 1, {y:100, onCompleteListener:done}); function done(event:TweenEvent):void{ trace(event); trace(event.target); //the tween trace(event.target.target) // the target of the tween event.target.currentProgress = .5; }
  12. in your completeHandler you can use queue.getChildren() to get an array of all the loaders. you can then loop through all the loaders and tell them to playVideo(). since you have an ImageLoader in there at the end you don't want to playVideo() on that loader. when you loop through the loaders you can - run the loop only 5 times if you know there will only be 5 videos or - use a conditional statement to make sure that the loader is a VideoLoader something like: if(myArrayOfLoaders[i] is VideoLoader){ myArrayOfLoaders[i].playVideo(); }else{ trace("found a loader that isn't a VideoLoader"); }
  13. from the first code you posted it did not appear that bAC was inside menu as bAC was trying to target menu and vcam from the same scope. i don't know where your code is in relationship to your buttons so I can't really troubleshoot your path issues. assuming all your code is on the main timeline or in a document class: container.menu.bAC.addEventListener(...) should work.
  14. Carl

    smooth wiggle

    thanks for posting your example. it looks like you have a case of the jitters: preview http://www.snorkl.tv/dev/jitters/jitters.html cs4 fla http://www.snorkl.tv/dev/jitters/jitters.fla
  15. i don't see why that would be happening. is it a big difference? does one object have a filter on it? if one object has a filter it could be snapping to whole pixel values and the other object is sitting on sub-pixels which would make them appear out of sync. the same thing might happen if one object has a stroke with "hinting" turned on which forces the stroke to snap to whole pixel values. if the objects start in the same position and they end in the same position, I would put them into a container and just move the container. you can do this in the Flash IDE by just putting them in the same movie clip symbol or with code var container:Sprite = new Sprite(); addChild(container); container.addChild(vcam); container.addChild(menu); //i don't know how your project is set up so you may have to set the x/y of vcam and menu to 0:0 and then set the x/y of container to where you want it to start bAC.addEventListener(MouseEvent.CLICK, ACmove); function ACmove(evt:MouseEvent) { TweenLite.to(container, 1, {x:100, y:100}); } you can always upload a zip of your fla (CS5 or less) with just enough in it to exhibit the problem.
  16. Carl

    error problem

    you're welcome. glad to hear that you didn't have to do a bunch of stuff 600 times. ouch. c
  17. thanks for the added info it really helped focus where to look. a little advice moving forward, once something doesn't work, trace as much as you can until you reach the point of failure. here is what I did to find the problem in xmlLoaded(): trace(xData); //all good trace(xImgList); //all good trace(xImgList.length); // BAD no trace trace(xImgList.length()); //all good : 8 //use length(); for ( var i:int = 0; i you should be all set.
  18. I'm glad to hear that you are making progress. I don't fully understand your question exactly but here are some thoughts: If I am using TimelineLite/Max for animation I like to keep as much as possible in one timeline so that the whole animation can be controlled as whole: paused, reversed, repeated etc. So instead of having one timeline play and then onComplete call a function that starts another timeline I much rather prefer to put both timelines in one parent timeline. --- You can call a function from TimelineMax by using the addCallback() method. My next video on AT+ will cover this. myTimelineMax.addCallback(someFunction, someTimeOrLabelInTheTimeline); You can also call a function from TimelineLite by inserting a TweenLite.delayedCall(); myTimelineLite.append( TweenLite.delayedCall(delay, someFunction) ); --- in the case of your explode stuff, you can certainly put all that code in a function that returns a timeline and then call that function from an insert() or append() method like function explode():TimelineLite { var t:TimelineLite = new TimelineLite(); t.insert(...); t.append(...); t.append(...) return t; } someOtherTimeline.append( explode(), 5); this approach is used here: http://www.snorkl.tv/2011/09/flash-gene ... -blending/
  19. is thumbHolder a Movie Clip on the stage of your Flash timeline? I'm wondering if it a) needs to be created thumbHolder = new MovieClip(); needs to be added to the stage addChild(thumbHolder); I see you are adding your images to thumbHolder but I don't see any other reference to it. I would think you would get errors. It would help if you would do any or all of the following if your problems persist: a) post your your files tell us which traces are running: are you seeing "Thumbs Loaded" c) put some traces in the xmlLoaded function and let us know if you can verify that the xml is loading.
  20. Carl

    smooth wiggle

    you could try something like this: import com.greensock.*; function wiggle(){ TweenLite.to(paket1, .2, {x:95+Math.random()*6, y :110+Math.random()*5, onComplete:wiggle}); } wiggle();
  21. Carl

    error problem

    first I'm pretty sure this: http://www.snorkl.tv/2010/11/part-1-bui ... flash-as3/ is the tutorial you are referencing. (just so others have an idea). did you try using var mapItem:Sprite = e.target as Sprite() technically you can get rid of that line all together and just use TweenMax.to(e.target, .5, {tint:0xFF9900}); I really don't know anything thing about the map shapes (external class) you are using but a Sprite should have no problem changing it's color with TweenMax when you roll over it.
  22. i think 2 things could be wrong 1: it appears you are calling tl.append(explode) twice. 2: you are trying to loop through your textFields when the SplitTextField is deactivated. try this var greetingWords:SplitTextField = new SplitTextField(XmasText, "words"); greetingWords.deactivate(); var greetingCharacters:SplitTextField = new SplitTextField(XmasText); var explode:TimelineLite = new TimelineLite(); var i:int = greetingCharacters.textFields.length; var explodeOrigin:Point = new Point(greetingCharacters.width * 0.4, greetingCharacters.height + 100); while (i--) { var angle:Number = Math.atan2(greetingCharacters.textFields[i].y - explodeOrigin.y, greetingCharacters.textFields[i].x - explodeOrigin.x) * 180 / Math.PI; explode.insert( TweenMax.to(greetingCharacters.textFields[i], 2, {physics2D:{angle:angle, velocity:Math.random() * 200 + 150, gravity:400}, scaleX:Math.random() * 4 - 2, scaleY:Math.random() * 4 - 2, rotation:Math.random() * 100 - 50, autoAlpha:0, delay:1 + Math.random()}) ); } greetingCharacters.deactivate(); XmasText.visible = false; var tl:TimelineMax = new TimelineMax({onStart:activateWords, onRepeat:activateWords, repeat:-1, repeatDelay:5}) tl.appendMultiple( TweenMax.allFrom( greetingWords.textFields, .5, {alpha:0, y:"50" } ), 0, "normal", .2 ) tl.addCallback(activateChars, tl.duration); tl.append( explode); function activateWords(){ trace("activate words"); greetingCharacters.deactivate(); greetingWords.activate(); } function activateChars(){ trace("deactivate words"); greetingWords.deactivate(); greetingCharacters.activate(); }
  23. just remove the () in test() GOOD TweenLite.delayedCall(4, test, []); this passes in the name of the function to call after 4 seconds BAD TweenLite.delayedCall(4, test(), []); this tells test() to execute immediately
  24. yup. check this out: viewtopic.php?f=6&t=6013&p=23167&hilit=mp3loader+sound+object#p23167
  25. you can use a delayed call: import com.greensock.*; //wait four seconds to start loading TweenLite.delayedCall(4, startLoading); function startLoading(){ youLoaderMax.load(); }
×
×
  • Create New...