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

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

  1. 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 { removeEventListener(Event.ADDED_TO_STAGE, onAdd); init(); } private function init():void { TweenMax.to(this, 1.5, { x:120, ease:Power0.easeInOut } ); }
  2. 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 to stop, or disappear (be killed), but tween alpha to 0. I can think of several ways to handle this, but not an elegant way. I feel certain that there is something in the Overwrite manager that would help me — but I'm not sure. I don't think I can simply kill() the tween since there's no bringToCompletion flag as there is with killAll — and in any case how do I make it so one kitten doesn't ruin it for everyone (i.e. killing the tween before everyone is home). I ended up just keeping a flag count and on ENTER_FRAME checking it, when it was 0 then tween the tween to 0. But it wasn't that elegant and wasn't working that well. Does anyone perhaps have a better suggestion? Thanks for any help!
  3. 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 new tween, grab the old tween and resume it. But it doesn't seem to work quite right. Thanks for any help. Just pointing me to the right part of the API would be fine. (Alternatively, of course, I could simply save the final destination and make an an entirely new tween to that place, but I was curious if the above would work)
  4. 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. How do I know where it is in relation to points along the rotated object's body? How do I know the distance to tween? In pseudocode: greenBox.x = blueBar.x; greenBox.y = blueBar.y; TweenMax.to(greenBox,1,{y:blueBar.y + blueBar.height, z:"some distance that is appropriate to the height I've tweened"}); This doesn't work. I am almost certainly approaching this wrong, but after some time spent poring through matrix3D's and perspectivePositions and the like, I feel I am simply missing some very obvious point — thanks for any help.
  5. I'm having some trouble grokking the relationship between an object's x and y position, and its 3D rotation and its z position. This is related to my earlier post (which Carl helpfully helped with) regarding moving an object within a random quadrangle. Here the object (it will be many) is moving back and forth between two lines projected in 3D space (so they are converging). I'd like to modify the code so that the object(s) at arbitrary positive z positions remain within the boundaries of an arbitrary quadrangle projected into 3D space. I've read a fair amount — and gotten some useful results with getRelativeMatrix3D() in terms of positioning things in 3D space, but I'm not sure how to apply this to above. Or should I use local3DToGlobal()? That seems somewhat inelegant (but perhaps not). But how does this apply to different points on a single object rotated in 3D space? As a bonus question (and thanks for any help) -- what else are the essentials to know in Flash 3D? Camera? Vanishing point? Thanks
  6. Once again... figured it out... I need to stop being so quick to post. Thanks
  7. I need to animate a bunch of sprites (well, they're animals) within a rectangular (but not square) boundary. I'd like to move them around in a random, non-jittery fashion -- perhaps random bezier curves. I'm also keen to move the ones at the top back in the z-space, and those at the bottom nearer (I suppose I can simply do a loop through each time and map y coord to z coord). I found some nice Greensock code (posted at the bottom) that will move animals in a circular area, but I need to be able to move within an arbitrary rectangular area (again, of arbitrary ratio, not necessarily square). Is there any other similar code here that would work for that, or is there any easy way to modify this code to make it work (boundary checking? Sin's and cos's are not my forte tonight). Any help much appreciated! var xCenter:Number = 275; var yCenter:Number = 200; var poolRadius:Number = 200; function tweenFish():void { var angle:Number = Math.random() * Math.PI * 2; //random angle in radians var radius:Number = Math.random() * poolRadius; TweenLite.to(fish, 2, {x:Math.cos(angle) * radius + xCenter, y:Math.sin(angle) * radius + yCenter, ease:Quad.easeInOut, onComplete:tweenFish}); } tweenFish();
  8. I'd like to use LoaderMax to load an xml file that will contain references to other xml files, one of which will contain nodes representing imageloaders. I don't want to add these images to the display list immediately but instead have reference to them, perhaps in an array. What's the best way to grab references to these loaded images from layers down? Put a complete function on each image loaded? Is there a simpler way I imagine the pseudo-xml something like this: _myLoaderMax.load(mainXML, onComplete:getTheImages); function getTheImages():void { _myImageArray = getTheImagesFromLoaderSomehow(_myLoaderMax); } <mainxml> <xmlloader url='imagexml' load='true'/> </mainxml> <imagexml> <imageloader url='myimage1' load='true'/> <imageloader url='myimage2' load='true'/> </imagexml> Would it be using getContent() at the appropriate level -- i.e. pseudocode _myXMLLoader= _myLoaderMax.getLoader('myXML'); _myImageContent:Array = _myXMLLoader.getContent() On another related note — what's the best practice for making sure everything loaded via LoaderMax is garbage collected? That is, I can set the main LoaderMax to have autodispose='true', but will that also dispose of all sub-loaders? I realize that if I put listeners on any loaded assets, etc, that will affect garbage collection, but do the GS loaders hold on to loaded assets in any fashion? Is there anything I need to do to make sure GC works well? I see that there are references to unload() in LoaderCore, but how does one recursively unload everything? Thanks
  9. Hey there, I have been trying to learn how to use greensock for all my animations for my entertainment technoloy classes. There is one menu I have been trying to recreate, and I am not sure how they did it. The site is www.newcastlebrown.com . the menu is on the left side of the website. I am sure it is something I am overlooking and probably somewhat simple to do. If anyone has any insigt to how to do this, please let me know. Code samples are much appreciated. I know they used greensock and tweenlite, so this is why I came to this forum to ask this question. Thanks guys!
  10. I have an instructions screen that I would like to be able to just flick off the screen. I was thinking about trying to implement the ThrowPropsPlugin into starling, but figured I would ask here first to see if anyone has successfully done this, as I know you can't use MouseEvents with starling, so it would have to be changed to the starling touchEvent. Thanks!
  11. hi Greensock A few questions reagrding killAll() 1) Where did the last parameter go? In Flash : killAll(complete:Boolean = false, tweens:Boolean = true, delayedCalls:Boolean = true):void vs. Docs : killAll(complete:Boolean = false, tweens:Boolean = true, delayedCalls:Boolean = true, timelines:Boolean = true):void 2) TimelineMaxs onComplete fires after TweenMax.killAll();??? package { import flash.display.Sprite; import com.greensock.TweenMax; import com.greensock.TimelineMax; import com.greensock.plugins.*; import com.greensock.easing.*; import com.greensock.events.TweenEvent; TweenPlugin.activate([ScalePlugin]); import flash.display.MovieClip; public class Main extends Sprite { public function Main() { // constructor code super(); Create(); } private function Create() { var arr:Array = new Array(); var Time:Number=2; for (var i:int=0; i<10; i++) { var m:MovieClip = new mc(); this.addChild(m); m.x = 40+(25*i); m.y=50; arr.push(m); } // solo tween var TM:MovieClip = new mc(); this.addChild; TM.x=40; TM.y=100; TweenMax.to(TM,6,{scale:2, ease:Linear.easeNone, onStartListener:ScaleTM, onComplete:CompleteTM }); // timeline var TL:TimelineMax = new TimelineMax({ onComplete:CompleteTL }); TL.insertMultiple(TweenMax.allTo(arr, Time, {scale:2, ease:Linear.easeNone, onStartListener:ScaleTL }, Time-0.5), 0); // delayed kill TweenMax.delayedCall(4,Kill); } private function ScaleTM(e:TweenEvent): void { trace('onStartListener: ScaleTM'); } private function CompleteTM() { trace('CompleteTM'); } private function ScaleTL(e:TweenEvent): void { trace('onStartListener: ScaleTL'); } private function CompleteTL() { trace('CompleteTL'); } private function Kill() { trace('Kill'); TweenMax.killAll( } } } trace is:onStartListener: ScaleTM onStartListener: ScaleTL onStartListener: ScaleTL onStartListener: ScaleTL Kill CompleteTL After killAll: As U can see TimelineMax onComplete fires but TweenMax onComplete dosn't
  12. Hi guys, I'm trying to build a 2 way tween (in 4 quadrants) using TweenLite with the colorTransform plugin. I'm doing this on a stage with a mouse move listener, so for example: stage.addEventListener(MouseEvent.MOUSE_MOVE, mve) function mve(evt:Event):void{ var percY = (stage.mouseY / stage.height).toFixed(2) TweenLite.to(mc, 1, {colorTransform:{tint:0xff0000, tintAmount:percY}}); } This works fine in 1 direction (top and bottom), but I want it to work 4 ways - have a look at screenshot which hopefully explains it better.. As you move towards each corner, top left, top right, bottom left, bottom right - the color should tween to that target (i.e. 100% or 0% of stage in both directions) I hope this question makes sense, any help would be appreciated, a little bit of an AS3 newb. Cheers
  13. I am working on a game in AIR for Android. I need to build a menu system for it. Are there any prebuilt menu systems avaiable? Thanks in advance, -ch
  14. Hi Everyone, I’m writing due to a “Scroll function” I’m having difficulties in implementing for an APP. I’ve developed an APP for ios and android in Flash professional cs6 with AIR 3.2 and everything works perfectly apart from the scroll function. I’ve used the ThrowPropsPlugin and the movement works fine however it doesn’t allow me to select what I want to select in the container. Instead when I take off my finger it selects that element I’ve stopped on. In the ThrowPropsPlugin I’ve applied the mouse_down and mouse_up events to make the vertical movement, and inside the container I have MovieClips associated with events of touch_tap. So when I take my finger off automatically the movieclip is activated. Does anyone have a solution to this problem? I feel like I’ve tried everything. Removed the event, added events, changed events, the pressure, resistence of the container, changed the properties of MouseChildren and nothing. If anyone has any advice on this problem I would be most grateful.
  15. Im new to all this and im sure what im after is very simple so can anyone help? I want a movieclips alpha to tween into alpha:1 stay like that for say 5 seconds and then tween back out to alpha:0 again. Can this be done in tweenlite? or do i need one of the other tweening platforms?
  16. Hi everyone, I'm new on this forum, first thanks to Greensock for the awesome library. But... I have a serious problem with the timelineMax. What i want to do: - declare 2 or more timelineMax's with tweens on the same target - calls multiple times in a short time the gotoAndStop method on a (random) timeline. - the latest gotoAndStop must overwrite every other tweens or timelines. The problem is that mostly the latest timelineMax.gotoAndStop is not set. You can see a simple example of my problem in my attachment. Just publish the fla with and without the comments on line 22 to 32. The result should by the same... but it isn't. Can someone help me with that? (I'm sorry for my bad English) Thank you, Pieter example.zip
  17. We are a growing advertising firm with need for a capable and creative thinker. We are building sites with flash/as3, html5, and js. We currently have a flash site that needs to be completed (most of the sections are done, but not coded). If you're interested in coding with us or you know someone that is and you know greensock and gaia well, we'd like to hear from you. pdf of spec: www.englishblackwell.com/englishblackwell_websitelayout_instructionsv3.pdf You may also contact us directly at andrea@englishblackwell.com
  18. Hey guys... This is my first post to this forum... I am working on a project and i want to have a tweening effect similar to the 'Custom Presets : fly-in pause fly-out' option in Flash IDE. Its just that i want to create it with action script and want to control it properly through code. For the rest of the tweening in my project i am using 'Greensock's TweenMax'. So if someone can help me creating the same effect in this engine it would be helpful. Thanks.
  19. http://forums.greensock.com/topic/6734-tweenlite-does-not-animate/page__gopid__24844#entry24844 What happened, I uploaded a file so someone could take a look but now it's gone...? Did I violate some rule?
  20. Ok I have an idea for a game that is similar to the old lights-out game. I have done it before in Java and even on Android. But I want to do it in flash now. My delema is I want to use images for the buttons, each is a different color. I am looking for a way to dynamically change button colors. So when you press/click a button it will work through a set list of colors. I am trying to find the lite-st way to accomplish this. Maybe a multi-layer button, where I could tween a color layer, if that could even be done. If I could animation going I can handle the rest. Any help would be appreciated. Thanks, cH
  21. Hi all, I am sure this is something that is quite simple, however I am a newbie and would like to know how I loop the following code so that my animation keeps repeating. Would I need to rewrite the whole thing? I am new to actionscript, greensock is amazing! import com.greensock.*; import com.greensock.easing.*; //Train tween TweenNano.to(train, 0.75, {x:400, ease:Quad.easeOut}); //Rotation 1 text tween in TweenNano.to(mc, 1, {x:20, ease:Quad.easeOut}); //Rotation 1 text tween out TweenNano.to(mc, 1, {delay: 3, x:800}); //Destination text tween in TweenNano.to(destination,1, {delay: 4,x:20, ease:Quad.easeOut}); //Speed text tween in TweenNano.to(speed, 1, { x:235, delay: 4, ease:Quad.easeOut}); //Speed text tween out TweenNano.to(speed, 1, {delay: 7, x:800}); //Price text tween in TweenNano.to(price, 1, {delay: 7, x:240, ease:Quad.easeOut}); TweenNano.to(booknow, 1, {delay: 7,scaleX:1, scaleY:1, alpha:1});
  22. Hi all, I am completely new to this stuff, and have a problem that I don't seem to find the answer for anywhere. I have made an animation in Flash CS5, where I have created a main animation and a loader with GreenSock SWFLoader, as the main animation is quite big (appx. 8 Mb). I have used the sample code on the LoaderMax information page, and created a .fla file with the following AS code in the first frame: 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("IntroAnim.swf", {name:"IntroClip", estimatedBytes:8000000, container:this, x:0, y:0, width:500, height:250, autoPlay:true}) ); LoaderMax.prioritize("IntroClip"); //same as LoaderMax.getLoader("photo1").prioritize(); queue.load(); function progressHandler(event:LoaderEvent):void { } function completeHandler(event:LoaderEvent):void { var image:ContentDisplay = LoaderMax.getContent("IntroClip"); TweenLite.to(image, 1, {alpha:1, y:0}); } function errorHandler(event:LoaderEvent):void { } As everyone can see, I have used the sample code from the LoaderMax page, just omitted everything except from the SWF part, as I don't need any images or anything else than the SWF animation to show up. I have also omitted the tracing functionality, as when I tested it in Flash, everything loaded nicely and the animation played as intended. All tracing information indicated success - therefore the tracing statements have been removed now. Even when I try to open the IntroLoader.swf file directly from my Windows Explorer, it plays as a charm. Now, I am creating a website in DreamWeaver CS5, where I have embedded the IntroLoader.swf loader in one of the pages. However, when I look at the page in Live View, or try to load it in any browser (have tried IE9, FirefFox 10, Opera 10, Google Chrome 17, etc) - all I see is the background color. No animation at all. A little comment: When I try to run the main animation alone - without the loader - it plays just fine in all browsers, as well as in Live View in DreamWeaver. I've tried practically everything, but am completely stuck. Hope that anyone here can help. Thanks in advance. Best regards.
  23. Hi I am working on an AS3 slideshow developed with TweenLite10 I need to be able to pause/resume the slideshow Is there an example/tutorial explaining how to add TweenMax10 pause() / resume() functionality to a project? Thanks
  24. Dear People, I love using your library, It's simple and very effective. I have a simple question, I've look in the documentation but can't find an answer. How can I recieve the TweenMaxEvent inside my event handlers ? example: TweenMax.to(iSprite, iRandTime , { y:_topYSpot, onComplete:onEffectComplete } ); private function onEffectComplete(e:Event = null):void { trace (e); } onComplete always comes to the function with no event, is there any way to recieve the event and know the target/currentTarget as usual AS3 code. Thanks In Advance and have a great day. K
×