Jump to content
Search Community

Carl last won the day on December 24 2023

Carl had the most liked content!

Carl

Moderators
  • Posts

    9,821
  • Joined

  • Last visited

  • Days Won

    546

Everything posted by Carl

  1. yeah, when your object moves away from the mouse, that will trigger the ROLL_OUT. the solution in most cases is just to create a hit area that doesn't move while the btn is moving. in your file I added an invisible button called "hit" to your home button. the general idea is that hit has ROLL_OVER/OUT listeners that trigger tweens that move your orange rectangle and text. here is a code sample: home_btn.hit.addEventListener(MouseEvent.MOUSE_OVER, homeOver); function homeOver (event:MouseEvent): void { TweenLite.to(home_btn.btn, .3, {y:-5, ease:Back.easeOut}); } ***note in the fla when creating this new movie clip which contains a "hit" area separate from the object that's moving... I changed the registration point on "Button_mc" so that the y values in the tween were easier to understand and adjust.
  2. I made a quick little demo for you: http://snorkl.tv/dev/swing/ I know you are learning GreenSock right now, so this may be a little much to start with, but since you have multiple tweens running, it is best to sequence them with TimelineLite/Max the code I used looks like: import com.greensock.*; import com.greensock.easing.*; var tl:TimelineMax = new TimelineMax() tl.append(TweenMax.fromTo(mc, 1, {rotationX:40}, {rotationX:-40, repeat:3, yoyo:true, ease:Quad.easeInOut, immediateRender:true})) tl.append(TweenMax.fromTo(mc, 2, {rotationX:40}, {rotationX:0, ease:Back.easeOut, easeParams:[5]})); the timing isn't perfect but it contains the basic meat of what you might use. this might be a bit much to swallow from the start as it uses a number of GreenSock features packed into a small space. focus first on how to get a single tween to swing an object: TweenMax.to(mc, 2, {rotationX:180} then investigate the repeat property and then TweenMax.fromTo http://www.greensock.com/as/docs/tween/ ... ml#fromTo() TimlineLite/Max is super powerful, but it can be a touch overwhelming if you jump in before having a strong foundation with TweenLite/Max. Trust me, it is well worth the effort. http://www.greensock.com/timelinelite I have a attached an cs4 fla. save it to a directory that has the greensock com folder.
  3. hi, just so you know, gotoAndLearn has their own forums where you may get help from people with more intimate knowledge of their tutorials. http://www.gotoandlearnforum.com/index.php I looked at that tutorial and it comes with a finished file. you should be able to just compare yours and the start file. perhaps if you post your code, something will jump out at us, but again, you may do better at gotoAndLearn. *** note that tutorial uses an outdated version of the greensock tweening platform. download the latest greensock files : http://www.greensock.com and update your import statements: import com.greensock.*; import com.greensock.easing.*;
  4. yes, there are some plugins that are activated by default in TweenMax. go to the PluginExplorer http://www.tweenmax.com and you will see that there are check marks next to the plugins that TweenMax activates. furthermore, if you don't want them activated you can edit the source code in com/greensock/TweenMax.as TweenPlugin.activate([ //ACTIVATE (OR DEACTIVATE) PLUGINS HERE... AutoAlphaPlugin, //tweens alpha and then toggles "visible" to false if/when alpha is zero EndArrayPlugin, //tweens numbers in an Array FramePlugin, //tweens MovieClip frames RemoveTintPlugin, //allows you to remove a tint TintPlugin, //tweens tints VisiblePlugin, //tweens a target's "visible" property VolumePlugin, //tweens the volume of a MovieClip or SoundChannel or anything with a "soundTransform" property BevelFilterPlugin, //tweens BevelFilters BezierPlugin, //enables bezier tweening BezierThroughPlugin, //enables bezierThrough tweening BlurFilterPlugin, //tweens BlurFilters ColorMatrixFilterPlugin, //tweens ColorMatrixFilters (including hue, saturation, colorize, contrast, brightness, and threshold) ColorTransformPlugin, //tweens advanced color properties like exposure, brightness, tintAmount, redOffset, redMultiplier, etc. DropShadowFilterPlugin, //tweens DropShadowFilters FrameLabelPlugin, //tweens a MovieClip to particular label GlowFilterPlugin, //tweens GlowFilters HexColorsPlugin, //tweens hex colors RoundPropsPlugin, //enables the roundProps special property for rounding values (ONLY for TweenMax!) ShortRotationPlugin, //tweens rotation values in the shortest direction //QuaternionsPlugin, //tweens 3D Quaternions //ScalePlugin, //Tweens both the _xscale and _yscale properties //ScrollRectPlugin, //tweens the scrollRect property of a DisplayObject //SetSizePlugin, //tweens the width/height of components via setSize() //SetActualSizePlugin, //tweens the width/height of components via setActualSize() //TransformMatrixPlugin, //Tweens the transform.matrix property of any DisplayObject //DynamicPropsPlugin, //tweens to dynamic end values. You associate the property with a particular function that returns the target end value **Club GreenSock membership benefit** //MotionBlurPlugin, //applies a directional blur to a DisplayObject based on the velocity and angle of movement. **Club GreenSock membership benefit** //Physics2DPlugin, //allows you to apply basic physics in 2D space, like velocity, angle, gravity, friction, acceleration, and accelerationAngle. **Club GreenSock membership benefit** //PhysicsPropsPlugin, //allows you to apply basic physics to any property using forces like velocity, acceleration, and/or friction. **Club GreenSock membership benefit** //TransformAroundCenterPlugin,//tweens the scale and/or rotation of DisplayObjects using the DisplayObject's center as the registration point **Club GreenSock membership benefit** //TransformAroundPointPlugin, //tweens the scale and/or rotation of DisplayObjects around a particular point (like a custom registration point) **Club GreenSock membership benefit** {}]);
  5. I don't know for sure, but I'm guessing your tweens are fighting each other. try using one tween that you play() and reverse(); import com.greensock.*; import com.greensock.easing.*; var slideTween:TweenMax = TweenMax.to(mc,4,{x:483,ease:Quad.easeInOut,paused:true}); slideTween.currentProgress = .5;//but mc in middle left_btn.buttonMode = right_btn.buttonMode = true; right_btn.addEventListener(MouseEvent.ROLL_OVER, btnOver); right_btn.addEventListener(MouseEvent.ROLL_OUT, btnOut); left_btn.addEventListener(MouseEvent.ROLL_OVER, btnOver); left_btn.addEventListener(MouseEvent.ROLL_OUT, btnOut); function btnOver(e:MouseEvent) { TweenMax.killTweensOf(slideTween); slideTween.timeScale = 1; if (e.target == right_btn) { slideTween.play(); } else { slideTween.reverse(); } } function btnOut(e:MouseEvent) { TweenMax.to(slideTween, .5, {timeScale:0}); } fla attached:
  6. i think it is because you are defining your tween inside a ROLL_OVER function. every time you roll over a button you are creating a new 20 second tween public function earthPanLeft(e:MouseEvent):void { var panLeftDuration:Number = Math.abs(panningEarth.width - panningEarth.x) / stage.width; earthPanLeftTween = TweenMax.to(panningEarth, 20, {x:0, paused:true}); earthPanLeftTween.timeScale = 1; earthPanLeftTween.play(); } move it outside your function like in my example. that should do it. c
  7. yup, you shouldn't be using pause() on ROLL_OUT. that will make the tween stop abruptly. please excuse the confusing comment: //advance the slideTween's progress by an additional 20% and ease out as I forgot to remove that when making the change. file attached
  8. try tweening the timeScale function btnOver(e:MouseEvent){ slideTween.timeScale = 1; slideTween.play(); } function btnOut(e:MouseEvent){ //advance the slideTween's progress by an additional 20% and ease out TweenMax.to(slideTween, .5, {timeScale:0}); }
  9. hi klu, I don't have an answer for you, but perhaps more info will help someone diagnos your problem. is this app loading the videos off a local drive? if so, is it necessary to preload them all? wouldn't they play virtually instantaneously upon request? in which case you could just load and unload them as needed? have you tested on another pc to rule out hardware issues? it seems that your pc is pretty beefy, but h.264 can be pretty demanding on the cpu/gpu. are you enabling hardware acceleration if available? have you googled about issues relating to your specific video card? have you experimented with different encoding settings/formats? My gut feeling is that LoaderMax isn't doing anything to cause problems or can do much to fix the issue, but hopefully someone can help get you closer to a fix.
  10. if its just that one image that needs to be sent to the back... import com.greensock.*; var tl:TimelineMax = new TimelineMax({repeat:-1}); tl.append(TweenLite.to(mc, 2, {x:400, onStart:sendToBack, onStartParams:[bg]})); tl.append(TweenLite.to(bg, 1, {y:"-150"})); tl.append(TweenLite.to(bg, 1, {y:"150", onStart:bringToFront, onStartParams:[bg]})); function bringToFront(object:DisplayObject):void { object.parent.addChild(object); } function sendToBack(object:DisplayObject):void { //place object at bottom-most depth object.parent.addChildAt(object, 0); } fla attached
  11. this will make the existing tween easeOut for an additional 20% on ROLL_OUT var slideTween:TweenMax = TweenMax.to(mc, 2, {x:300, paused:true}); btn.addEventListener(MouseEvent.ROLL_OVER, btnOver); btn.addEventListener(MouseEvent.ROLL_OUT, btnOut); function btnOver(e:MouseEvent){ slideTween.play(); } function btnOut(e:MouseEvent){ slideTween.pause(); //advance the slideTween's progress by an additional 20% and ease out TweenMax.to(slideTween, .5, {currentProgress:".2"}); }
  12. no problem. thanks for reporting that it works now.
  13. when testing your swf you will get a runtime error if an asset can not be loaded. if you think there is in fact an error with prependURls, the only way we will know is if we see the files you are using. please upload your fla, xml and image so that we can test. these can just be sample files that illustrate the error. note: when viewing a swf in an html page paths to external assets are relative to the html page. when viewing a swf by itself, paths are relative to the swf.
  14. use an onComplete callback: TweenMax.to(soundChannelBG, 1, {volume:0, onComplete:stoSount}); function stopSound(){ soundChannelBG.stop(); }
  15. I really don't see anything wrong or improper with what you are doing. if you want an array of all the ImageLoaders from your xml you could do yourXMLLLoaderInstance.getChildren() // it takes some important parameters docs: http://www.greensock.com/as/docs/tween/ ... tChildren() then you would have an array to loop through... so not much different then what you are doing. --------- another option would be to give all the ImageLoaders an onComplete handler that calls a single function that extracts the image.
  16. this will give you the url of the asset that you passed into the loader: function errorHandler(event:LoaderEvent):void { trace("******error loading " + event.target.url + "******"); }
  17. I would imagine you would have to make individual LinePath2D paths for each group of points. you would then make the first tween run and then trigger the the second tween on complete.
  18. i'm pretty sure the tween doesn't know what its target is until after it is created. if you defined CURRENTMC yourself prior to the tween being created then you could do: var CURRENTMC:MovieClip = text_mc; TweenNano.to(CURRENTMC, 1, {x:CURRENTMC.myX}) I'm a little unclear why if you are already defining text_mc as the target, you can' t just use it like you currently are for generating the x value. TweenNano.to(text_mc, 1, {x:text_mc.myX});
  19. the easist thing to do would be to store a reference to the individual tween you want to pause and resume var boxTween:TweenMax = new TweenMax(box, 1, {x:300}); boxTween.pause(); boxTween.play(); OR use TweenMax.getTweensOf(box) and then loop through the array of tweens and pause/resume them all http://www.greensock.com/as/docs/tween/ ... tTweensOf()
  20. Hi, You will get better support in a forum dedicated to swfAddress or a general actionscript forum like kirupa.com or actionscript.org. There may be a swfAddress expert hanging around in here but your chances of success are much higher where the forum isn't so specialized. carl
  21. i'm not at all familiar with LinePath2D, but I think it may be because all your points are being placed in the same array: points.push(new Point(point[0],point[1])); I gather that your xml is divided into 2 separate nodes so that each of them is for a separate group of points forming a line.' by putting all the newPoint()s into points, I think LinePath2D sees it as one long line.
  22. glad you are enjoying this. and yes, storing your rurs in an array is very helpful. just to be clear. my previous code did not create 20 rurs. there were only 10.
  23. it is important to note that in GreenSock's solution he is not directly tweening the rotation of myMC. he is tweening the currentRotation property which lives within the scope of the main timeline, in this case "this". the main timeline has a var/property called currentRotation. when currentRotation gets tweened, the the onUpdate function updates the rotation of myMC. his code was written for a very exact solution to the code you specified. If you want to implement his suggestion in another project, feel free to modify it to suit your needs. In general, yes, you can tween any property of any object, you are not forced to use "this". you simply reference the object who's properties you want to tween.
×
×
  • Create New...