Jump to content
GreenSock

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

Search the Community

Showing results for tags 'as3'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • GreenSock Forums
    • GSAP
    • Banner Animation
    • Jobs & Freelance
  • Flash / ActionScript Archive
    • GSAP (Flash)
    • Loading (Flash)
    • TransformManager (Flash)

Product Groups

  • Club GreenSock
  • TransformManager
  • Supercharge

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Personal Website


Twitter


CodePen


Company Website


Location


Interests

  1. This is almost certainly a bug in my code, but I'm moving some elements forward in z-space (that is low to high z) using TweenMax's in a TimelineMax // pseudo code TLM:TimelineMax = new TimelineMax; for (var i:int = 0; i< someNumber; i++) { var tw:TweenMax = new TweenMax(anAsset,TWEEN_TIME,{onUpdate:doUpdate,onUpdateParams:["{self}"],z:someFinalZ}); TLM.add(tw,TWEEN_Time/i); } private function doUpdate($tw:TweenMax):void { sortElementsOnZPosition(); // sort all the elements display position based on z, using addChild() if (something) { $tw.timeScale(0.5); // slow down }
  2. I've solved this, but I have no idea how, and I'm trying to understand what happened. I have TImelineMax's set up in a class. One of them is this, super-simple -- I use it to have a person 'escaping' or not escaping -- if they are escaping, they move off screen, if you click, the timeline is reversed and they come back. Instantiations of this class are being moved in z-space forwards, in a timelinemax which contains repeat = -1 tweenmaxes (as per Carl's great help) -- when the person disappears off screen in the distance I reset this timeline to get them not escaping anymore. I was using
  3. Hi, Probably very simple but i cant seem to get my head around timelineMax. I have a movieclip (spinY_mc) that i want to play backwards when i click a back button (back_mc). back_mc has various conditions and is done as a Click event. Can you help?
  4. I have a function set up to play a loaded MP3 by name string: protected function playSoundByName($name:String):void { // trace("play sound by name ", $name, LoaderMax); _currentSound = LoaderMax.getContent($name); // trace("current sound is ",_currentSound); if (_currentSoundChannel) _currentSoundChannel.stop(); // trace("the sound is ", _currentSound,_currentSound.length,_currentSound.url); _currentSoundChannel = _currentSound.play(0); _currentSound.addEventListener(Event.SOUND_COMPLETE,soundComplete,false,0,true); } Which works fine when I call it directly, but not when I call
  5. If you have more than one loaded asset with the same name, how does LoaderMax.getContent() resolve that? I have a lot of assets to load -- maybe 70 mp3s, and while I can make sure no names ever duplicate, I'm wondering whether it's not easier to use the instance version of LoaderMax's getContent, rather than the static. What is the best practice? Thanks!
  6. I have a situation where I want to have a number of objects tweening from different starting points towards a common goal. They are moving in the same direction, and should move at the same pace. I also want to get rid of the object when it reaches its goal, and add a new one (or the same one) at the back of the queue. Picture a line of people moving forward in a queue: they shuffle forward slowly, all at the same speed. We start the queue with a line already formed, that is, we 'open the scene' with the line in place. Is there a way to do this with TimelineMax? I had thought of som
  7. I've been trying to work up a 'shaking' effect on elements, using RoughEase. Rotations, x, y all get stuck at the end and don't return to their original spots, as yoyo:true, repeat:1 would seem to indicate they would. (centPoint is stageWidth/2, stageHeight/2) —I'm sure I'm missing something but I was curious whether doing yoyo and repeat with transformAroundPoint and RoughEase was a problem in some way… private function makeNewShakeUpTimeline($objects:Array):TimelineMax { var tl:TimelineMax = new TimelineMax; var centPoint:Point = new Point(TTConstants.FULL_WIDTH/2,TTConstan
  8. As I understand it, a Timeline is set up so that it uses the values of variables at the time the timeline is created. Thus, if n=100 tl.to(mc,1,{x:n}); will move mc to x = 100. What happens if I do var n:int = 100; tl.addCallback(function() {n = 200}); tl.to(mc,1,{x:n}); More importantly, what if I want the timeline to use values that are determined at the time the timeline plays? (Yes, I could do a test of above, but I'm trying to understand this once and for all, conceptually — I'm setting up complex timelines with many moving parts and subcalls, and trying to understand what
  9. This is another no-brainer that's puzzling me. If someone could show me the error of my ways I'd be grateful. In this code tl.to(startButton,0.25,{autoAlpha:1}, "+=1"); tl.addCallback(waitForStartButtonPush,"+=0.01"); tl.to(startButton,0.25,{autoAlpha:0}, "+=.01"); where "tl" is a timelinemax appended to the main timeline and 'startButton' is a movieclip on stage, followed by private function waitForStartButtonPush():void { _mainTimeline.pause(); startButton.addEventListener(MouseEvent.CLICK,startButtonClick,false,0,true);} the issue I was having is that the startButton was on
  10. I've been making good use of TimelineMax's convenience methods: timeline.to(....), etc. As I understand it, these are syntatic sugar for timeline.add(Tweenlite.to(...)), etc Is there a way to change it so that the convenience methods would instead use TweenMax? Ran into an issue where I was trying to use 'yoyo' but wasn't working…and it's because TweenLite doesn't offer 'yoyo', I believe. I offer it as a suggestion for future releases, if it's not currently implemented.
  11. This seems like it should be a no-brainer, but I've searched the API and can't see how to kill a Tween(Max) and force it to complete. I see how to kill ALL tweens and force to complete, or child tweens of a particular object and force them to complete, but for a TweenMax I didn't see the option to force to complete. Could someone point me in the right direction? Thanks!
  12. Is there any built-in functionality to the gs platform to allow the discrete tweening of variables? That is, if I want to tween a var from 0 to n in discrete, integral steps?
  13. I need to 'spin' a coverflow that will go from the start element to another random element after looping through the entire coverflow list a couple of times. That is, let's say you were spinning a wheel like the wheel of fortune (the game show) -- you have integers on the wheel that range from 0 to 8 (or whatever) -- you are staring at some random place (e.g. 3) and will simulate a random spin to another value (e.g. 6) -- you have different spin directions -- the user can spin left and right. In this case, it's not a wheel, so I can't use rotation — it's a coverflow, and I need to up
  14. Just downloaded the latest 'bonus' AS3 files and am getting strange TimelineMax errors, in particular it doesn't seem to grok 'to' and 'from" -- the funny thing is I haven't touched the code generating the error recently -- It just started when I grabbed the new libraries -- it's happening with TImelineMax .to() and .from() 1061: Call to a possibly undefined method from through a reference with static type com.greensock:TimelineMax. -- and stopped when I put the old libraries back
  15. Is there any reason one can't TweenMax.updateTo() a TweenMax nested inside a TimelineMax? I'm sure it's me, but it's driving me crazy. I do this (I have an object being tweened from z:500 to z:0 or something like that, but not on x), thus (simplified): _obstacleTimeline.add(TweenMax.to(obstacle,OBSTACLE_SPACING-1,{z:obstacle.finalZ})); and later $tween.updateTo({x:stage.stageWidth,autoAlpha:0,ease:Quint.easeIn},false); and the object that's being tweened does what it's supposed to and then goes _back_ a way in z-space and comes forward again from the left. I'm not restarting the tween (u
  16. Today is the day of many Timeline questions — thanks for your help and patience. I'm interested to the extent of which multiple nested timelines are "baked in the cake", that is how much you can change not-yet-played timelines on the fly. Can you update the child timelines and tweens before the parent is played and while it is playing? Also I was experimenting with the ability to play timelines independent of their parents. Apparently it doesn't work. That is, if you have a timeline added to another timeline, you can't seem to play() the child timeline prematurely. Is this true?
  17. If one has has a long timeline with various 'sections', which one could delineate by labels, what is the best way to know when it has played through a section? Is there a way to 'listen' for a tlmeline passing through labels — or is the best way to add a callback at the end of each section which would dispatch an Event? PSEUDO CODE _timeline.addLabel('start section 1',_timeline.totalDuration()); _timeline.to(...); _timeline.addLabel('end section 1',_timeline.totalDuration()); // can I detect when this passes? _timeline.addCallBack(dispatchAnEvent(finishedSection1),_timeline.totalDuratio
  18. SOLVED Forgive me in advance, please, if this is very basic — I'm setting up timelines (TimelineMax'es) and building them with relative offsets, e.g _tutorialTimeline.to(swipeToAvoid,0.25,{autoAlpha:1},"+=.5"); // add 'swipe to avoid'_tutorialTimeline.to(obstacle,4,{autoAlpha:1,z:-500},"+=1"); // move forward I'd like to be able to add labels at particular sections, so I can go back and play sections of the tutorial timeline above later, separately from the rest. From what I can see I have to add labels at particular times, like '3 seconds' -- and of course I could keep a running total o
  19. UPDATE: The question below is still valid — but in the end I'm going to be playing parts of an already established timeline (as detailed in another post) so I believe that simply stopping the main timeline and playing my other one and continuing the main one is the best option, unless there's a way to insert a section of a timeline into another timeline I have a game that runs by playing one grand timeline from start to finish. The variations in game play occur by simply updating some individual tweens if the players hits a target, etc — the main timeline keeps running. I've just been i
  20. I am trying to create a rough ease by copying the sample code on the site (switching random from 'false' to 'true') but am getting errors. The code var rough:RoughEase = new RoughEase({strength:3, points:50, template:Strong.easeInOut, taper:"both", randomize:true});And the error 1118: Implicit coercion of a value with static type Object to a possibly unrelated type Number. I'm unclear what I'm doing wrong. Any help appreciated. UPDATE: Tried using the default RoughEase.ease easing tl.to($objects[i],TTUtils.getRandomNumber(0.25,.5),{rotationZ:rotationZ,ease:RoughEase.ease}); and got th
  21. I know that when you nest timelines within timelines, you need to have the child-timelines be 'playable', that is not have paused == true. I'm creating complex timeline(maxe)s within separate functions and then adding them to the main timeline. This seems to work, but I feel uneasy — I don't know how the child timelines 'know' to remain paused until they are added to the main timeline. I believe I read here on the forums that a timeline will wait until the next enter-frame to start -- but how do I really know when that is? Thus, in pseudo code, I have something like this _mainTimel
  22. Hey guys quick question. Do you know of any reason to why my hitTestObject wont initiate when i add this line to my mcPlayer Class: TweenMax.to(this, 1.5, { x:120, ease:Power0.easeInOut } ); My hitTest function works perfectly fine but once i add this code to it, my player just goes straight through the object this is how my mcPlayer class is setup public class mcPlayer extends MovieClip { public function mcPlayer() { addEventListener(Event.ADDED_TO_STAGE, onAdd); } private function onAdd(e:Event):void
  23. I have a game in which when an object — let's say its a kitten — goes on one side of a border line (there are two, opposite sides of the screen), a blinking alert line needs to flash. I set the flashing alert to be a tweenmax, alpha on and off, repeat:-1, yoyo:true. The issue I'm dealing with is there are maybe a hundred kittens. I need to have the tween running when any of them is the 'wrong side of the line' and off when all are on the right side of the line (again, there are two lines, but you get the idea). When they are all back in the kitty-corral then the tween needs not just
  24. I'm curious if there's a way to update a TweenMax on the fly so that it will continue to its original destination but from new start points. I see how to update the destination. I'm asking because I have a situation in which I have a Tween in progress but sometimes (randomly) I will want to stop that tween and have the object head somewhere else. If it is clicked on it should stop its new tween and go where it was supposed to go originally. My solution was to pause the original tween, save it in a variable in the object, make a new tween -- and then if the object is clicked to kill the
  25. I didn't have much luck with my last post, and can't delete or change the topic. Here's something I'm having some trouble figuring out — and perhaps it's a start to solve my other questions: how would I tween an object in 3d space along another object in 3D space? The second object is rotated along its x-axis. I'm trying to understand how to get the dimensions of objects placed and rotated in z-space -- what their boundaries are, and where other objects are in relation to them. So, in the attached graphic, I'd like to pin a green square to a blue bar and move it up and down. Ho
×