Jump to content
GreenSock

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

kariannking

Members
  • Posts

    11
  • Joined

  • Last visited

kariannking's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. function fadeAndRemove() { if (arrAllPops.length >= 3) { for (var x = 0; x < arrAllPops.length; x++) { TweenMax.to(arrAllPops[x], 0.5, { opacity: 0, onComplete: removeManyPops, onCompleteScope: x }); } } function removeManyPops(ff) { $(arrAllPops[ff]).remove(); arrAllPops.splice(ff, 1); } console.log(arrAllPops); } // end of fadeAndRemove function I think I'm using onCompleteScope wrong.. basic premise is once an array gets larger then 3 elements, tween away all those greater than 3 and, once the tween has finished, remove those elements from the dom and the array.
  2. Aha! So your example pointed me in the right direction, thank you so much. The magical answer seemed to be absolute positioning, and also the ".unshift()" jquery method. I wasn't aware it was possible to push a new array item to the front of an array. Although, now that I say that, it seems pretty obvious that there would be.
  3. in the codepen, if you click the button, it appends a div to a wrapper and tweens it upward, and adds it to an array. When you click the button again, it makes all previous appended divs jump up without a tween. I've poked around on the forums here for solutions without much luck. Instead of making it just jump up, can I tween them up? I already tried to do it with a "position: absolute" in the css, but nothing tweens after the initial tween. They just stack (z-index wise) on top of one another.
  4. I use to use GSAP in Flash, but it's been awhile as I've transfered over to javascript and jquery. I'm having trouble with a set of three images where I want to fade them out and then back afterward. var tl = new TimelineLite(); tl.add( TweenLite.to(img01, .2, {opacity:0, ease:Linear.easeNone}), TweenLite.to(img02, .2, {opacity:0, ease:Linear.easeNone}), TweenLite.to(img03, .2, {opacity:0, ease:Linear.easeNone}) ); tl.add( TweenLite.to(img01, .2, {opacity:1, ease:Linear.easeNone}), TweenLite.to(img02, .2, {opacity:1, ease:Linear.easeNone}), TweenLite.to(img03, .2, {opacity:1, ease:Linear.easeNone}) ); // tl.add( TweenLite.to(img01, .2, {rotation:-10, right:30, ease:Linear.easeNone}) ); // tl.add( TweenLite.to(img03, .2, {rotation:10, left:30, ease:Linear.easeNone}) ); window.onload = function(){ tl.play(); } It doesn't work. I can see some fading happening.. but it's as though the first and second .add are happening at the same time. As I have it set up, shouldn't it first finish the first .add and then play the second .add? unrelated: you use to be able to tween the color/tint of images in flash. Can you still do that in the JS version?
  5. Whoa, I didn't know you could have an onComplete in a tween. The solves the problem. Thank you!
  6. If that's not in there, then it doesn't go at all after the first run. Here's a CS4 version of the file: http://www.royalsong.net/wcc/timelineTransitionCS4.fla
  7. I have a quiz flash game I'm working on. I want to use TimelineMax to help transition to the next question. This works perfectly the first time I click my button.. but the second time, my onRepeat works, but the movieclip doesn't tween. Then on the third click, nothing works at all. (You can view the swf here: http://www.royalsong.net/wcc/timelineTransition.html) Here's just the actionscript involved in the transition (and you can download the .fla at http://www.royalsong.net/wcc/timelineTransition.fla that has the full actionscript of a simplified version of what I'm trying to do. The actual project is much bigger.) var timelineTransition:TimelineMax = new TimelineMax({repeat:1, yoyo:true, onRepeat:timelineRepeat, onComplete:timelineComplete}); timelineTransition.append( TweenMax.to(transitionMe, .8, {width:989, height:989, ease:Linear.easeNone}) ); timelineTransition.pause(); goNext.addEventListener(MouseEvent.MOUSE_DOWN, gotoNextFunction); function gotoNextFunction(e:MouseEvent):void { goNext.alpha = 0; // This gets reversed in a different function not displayed here on greensock goNext.mouseEnabled = false; // This gets reversed in a different function not displayed here on greensock transitionMe.alpha = 1; timelineTransition.play(); i++ } function timelineRepeat():void { arrayString[i](); // this array is full of functions that change the question and multiple answers questionFeedback.text = ""; } function timelineComplete():void { transitionMe.alpha = 0; timelineTransition.clear(); } Pretty sure this is just me not knowing what I'm doing with timeline max.
  8. Okay, so there's something odd going on with dashes in file names.. which just might be a bug with flash? My naming scheme was: bio110_fig3-4-loader.swf bio110_fig3-4-basal.swf and I threw the null object reference error at me. If I changed the name of the loader from dashes to underscores.. bio110_fig3_4_loader.swf It works fine.
  9. The issue stopped when I stuck the queue.load() code in a mouse event. For some reason it was ignoring my stop code. I ran into an entirely different problem. Now I get a null object reference error. Which seems to be originating in the swf files I'm trying to load. When I tried it with a different swf file that just had a static image in it, it worked perfectly. The swf files that are loading have a movieclip that's dynamically loaded from the library into the actionscript. Could that be the cause of the problem?
  10. this code.. stop(); import com.greensock.*; import com.greensock.loading.*; import com.greensock.events.LoaderEvent; import com.greensock.loading.display.*; var queue:LoaderMax = new LoaderMax({name:"mainQueue", onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler}); queue.append( new SWFLoader("bio110_fig3-4-basal.swf", {name:"basalClip", estimatedBytes:5120, x:90, autoPlay:true}) ); queue.load(); function progressHandler(event:LoaderEvent):void { trace("progress: " + event.target.progress); } function completeHandler(event:LoaderEvent):void { var movClip:ContentDisplay = LoaderMax.getContent("basalClip"); TweenLite.to(movClip, 1, {alpha:1, y:100}); trace(event.target + " is complete!"); } function errorHandler(event:LoaderEvent):void { trace("error occured with " + event.target + ": " + event.text); } outputs this indefinitely until i close the test movie window. progress: 0.9899961707830749 progress: 1 LoaderMax 'mainQueue' is complete! progress: 0.9899961707830749 progress: 1 LoaderMax 'mainQueue' is complete! progress: 0.9899961707830749 progress: 1 LoaderMax 'mainQueue' is complete! progress: 0.9899961707830749 progress: 1 Any clue what I'm doing wrong? When I stick container:this in the code, it loads the swf repeatedly over and over on top of one another in a window cascade style. I've never used loadermax before. My end goal is to have two .swf files and have the audience be able to click a button to switch from one to the other. Any suggestions?
×