spycatcher2011

Members
  • Content count

    16
  • Joined

  • Last visited

Community Reputation

0 Newbie

About spycatcher2011

  • Rank
    Member
  1. Tweening to a curved line

    Thanks Carl What I was thinking of doing was just creating a fade then start a new bezier pattern . So function would go like this fade out a and stop first bezier follow path then reinstate next one ,each one a separate path with a separate movie clip attached to the path. Do you think that would work. Regards Peter .
  2. Tweening to a curved line

    Dear Carl I have tried to work with the code you gave me and modify to suit my purposes . The Timeline tween gives you a start and stop feature ,what I am really after is a continuous animation of wind flow over an airfoil surface not a start and stop animation more like the tween max to code with a path follower as bellow.Then I will add buttons to change the Bezier curve showing the effect of lift on a ice covered wing. Thanks in advance Peter import com.greensock.*; import com.greensock.easing.*; import com.greensock.motionPaths.*; var boarder:mcBoarder; var boarder1:myBoarder;//movie clip from library var path2:LinePath2D = new LinePath2D([new Point(200, 100), new Point(200, 300)]); addChild(path2); var path3:LinePath2D = new LinePath2D([new Point(100, 200), new Point(400, 200)]); addChild(path3); my_btn.addEventListener(MouseEvent.MOUSE_DOWN, createpath); //kill_btn.addEventListener(MouseEvent.CLICK, kill); function createpath(event:MouseEvent):void { for (var i:Number = 0; i<6; i++) { boarder=new mcBoarder(); path2.addFollower(boarder, i / 6, true); addChild(boarder); trace(boarder); } for (var k:Number = 0; k<6; k++) { boarder1=new myBoarder(); path3.addFollower(boarder1, k / 6, true); addChild(boarder1); trace(boarder1); } } TweenMax.to(path2, 5, {progress:1, repeat:-1, ease:Linear.easeNone}); TweenMax.to(path3, 5, {progress:1, repeat:-1, ease:Linear.easeNone});
  3. Tweening to a curved line

    Thanks Carl That will help me a lot. Best Regards Peter
  4. Tweening to a curved line

    Thanks Carl Is there in way of having the path start of as a smooth curve then and as chaotic curve as the ice builds up on the wing which increases the turbulence over the wing. As I do not know Java script which areas of the code would need alteration to work as an AS3 code in Flash. All the best and a Happy Christmas to you.
  5. Tweening to a curved line

    Gday Been a way from flash for a while ,and tween max. I have been asked to write an animation for airflow over a wing surface ,wondering if there is any way I can use a movie clip of a curved line and tween a path follower to it.Tried just adding a movie clip but came up with a warning . Line is not straight but has many curves ,as I have to show turbulent flow on an obstructed airfoil as well. Thanks for your help as always. Regards Peter
  6. sequencing a set of distribute to path objects

    Dear Carl Thanks for your help ,I tried the sequencing code and I got this error TypeError: Error #1009: Cannot access a property or method of a null object reference. at com.greensock::TimelineLite/insert() at com.greensock::TimelineLite/append() at acmtyp3a_fla::MainTimeline/frame1() I also tried to put the code inside the button handler but the result was the same. //////////////// As per your suggestion ,I removed the timer from the button event ,but I still get an error message. var tween1:Array=new Array(); tween1=["myTween","myTween1","myTween2"]; var b:Number b=-1var timerTween:Timer = new Timer(100, 3); timerTween.addEventListener(TimerEvent.TIMER, timerHandler); function timerHandler(e:TimerEvent):void { b++ tween1[b].play(); trace(; } button1_btn.addEventListener(MouseEvent.CLICK,change1); function change1 (e:MouseEvent){ timerTween.start(); } /////////////// Error Message TypeError: Error #1006: value is not a function. at acmtyp3a_fla::MainTimeline/timerHandler() at flash.utils::Timer/_timerDispatch() at flash.utils::Timer/tick() TypeError: Error #1006: value is not a function. at acmtyp3a_fla::MainTimeline/timerHandler() at flash.utils::Timer/_timerDispatch() at flash.utils::Timer/tick() TypeError: Error #1006: value is not a function. at acmtyp3a_fla::MainTimeline/timerHandler() at flash.utils::Timer/_timerDispatch() at flash.utils::Timer/tick() as soon as press the button. I am sorry ,I forgot to add to the code that I have a "pause all" function to stop all the tweens, and each tween is inside a movie clip so I can control the Alpha of the tween. If i remove the code "tween1.play();" within the button statement the trace works okay giving me 0,1,2. Thanks again peter
  7. Hello all thanks for your time I am trying to sequence a group of path following tweens one after the other ,and control the speed of the sequence. Example i have three tweens. var myTween1:TweenMax = new TweenMax(path1, 5, {progress:1, repeat:-1, ease:Linear.easeNone}); ///play next 1sec later var myTween2:TweenMax = new TweenMax(path2, 5, {progress:1, repeat:-1, ease:Linear.easeNone}); ////play next 1sec later var myTween3:TweenMax = new TweenMax(path3, 10, {progress:1, repeat:-1, ease:Linear.easeNone}) I would like to add play delay between each tween that is adjustable. I have tried to put each tween into and array and use a timer as bellow var b:Number b=-1 //// create array of tweens var tween1:Array=new Array(); tween1=[myTween1,myTween2,myTween3]; button1_btn.addEventListener(MouseEvent.CLICK,change1); function change1 (e:MouseEvent){ var timerTween:Timer = new Timer(1000, 3); timerTween.addEventListener(TimerEvent.TIMER, timerHandler); timerTween.start(); function timerHandler(eventObject:TimerEvent):void { b++ tween1.play(); trace(; } }; but i get a null object error,is there any way to do this or is something simple i have missed ? As the tweens do not stop I cant use the on complete function. at flash.utils::Timer/tick() TypeError: Error #1009: Cannot access a property or method of a null object reference. at MethodInfo-329() at flash.utils::Timer/_timerDispatch() at flash.utils::Timer/tick() Best Regards Peter
  8. constant tween on a path

    Dear All Thank you very much for your assistance,now its down to designing the system. Your tween engine should make it a lot easier than it has been in the past. Best Regards Peter
  9. constant tween on a path

    Thanks all for your help ,it is really appreciated. Sorry but I was unable to open the file Opamint so kindly attached in flash CS3 ,or run the file in Flash CS4 ,as I kept on getting errors. (I converted the file to CS3 for my work computer) CS3 Error 1061: Call to a possibly undefined method distribute through a reference with static type com.greensock.motionPaths:LinePath2D. (Before any one asks I do have the com folder in the same folder as the fla.) I have attached a diagram of the Aircraft system I am working on at the moment. As you can see ,the air flow pipes intersect at many locations,I do not only wont to change the level of the tween path followers ,but also as the paths followers cross . My aim is to make the underneath paths followers alpha zero then return the alpha back to 1as it continues on its way. The picture shows that there are many paths crossing each other ,if I leave all the path followers visible as they cross it not only looks untidy but makes the circuit path hard to follow. This can also be seen as the engine bleed air passes through the heat exchanger and out . To have the bleed air path flow stay at the same alpha as it passes over the heat exchanger ,does not really describe the actual path flow. Changing the alpha as it passes through the heat exchanger gives the impression that the air flow goes through not on top of the heat exchanger. Opamint says you can do it with mask which I totally agree with,but is there a way to make the lower paths alpha go to zero for specific section where the paths cross ,like if path followers are between x 1 and x 2 make alpha 0 ,or if less than x 1 or greater than x 2 make path followers Alpha 1. I apologize that I have not made myself clearer in the past , my background is in the Avionics systems on aircraft, not with program language ,also as I live in Asia I have had to teach myself flash and am now trying to come to grip with AS3 after learning AS2. Best Regards Peter
  10. constant tween on a path

    Dear All thanks for your help I have attached a zip file of what i am trying to accomplish The fla consists of two path crossing over one another ,what i would like to do is have the backs paths alpha be bought to 0 as the paths cross so it looks as if they are passing over each other. I tried to change the alpha of the path at that particular point with an if statement if path .x>number but it ended up changing the whole paths alpha. any help appreciated. Best Regards Peter
  11. constant tween on a path

    Thanks For your help Also if I can indulge is there a way of masking the tweened path directly without having to put in a movie clip. The animations I do have many crossing paths so to be able to show these crossings would be a real bonus. Thanks again for you patience with me I have been using AS2 for a while mainly using functions and some masking to set up the animations,this will take me another step forward. All the best Peter
  12. constant tween on a path

    Dear All please help I have been working on this for a few days and have tried every possible combination and I still cant seem to get it to work. I have come up with a simpler code example . I have tried remove follower ,remove Child and remove child at none seem to work . I have also tried to remove with a loop but this hasn't worked either ,please help I am desperate for a solution. also when apply the trace for the number of children only shows 1,I thought it should say 6. Code below import com.greensock.*; import com.greensock.easing.*; import com.greensock.motionPaths.*; var boarder:mcBoarder;//movie clip from library var i:Number var path2:LinePath2D = new LinePath2D([new Point(50, 100), new Point(50, 200), new Point(100, 300)]); addChild (path2); my_btn.addEventListener(MouseEvent.MOUSE_DOWN,createpath);//(this works ok) kill_btn.addEventListener(MouseEvent.CLICK, kill) //(kills tween but does not remove boarder instances. ) function createpath(event:MouseEvent):void{ for(var i:Number = 0; i<6; i++){ boarder=new mcBoarder(); //trace(boarder.numChildren); path2.addFollower(boarder, i / 6, true); addChild(boarder); trace(boarder); } } TweenMax.to(path2, 5, {progress:1, repeat:-1, ease:Linear.easeNone}); function kill(e:MouseEvent):void{ TweenMax.killTweensOf(path2) for(var k:Number=0;k<6;k++){ boarder.removeChildAt(k); } } Thank you all for your time and appreciation Peter
  13. constant tween on a path

    Dear all I have been looking at the reference data I have found how to stop the tween ,but not remove the display items . I have tried remove child method but this does not seem to work as there is no real Movie clip to remove. Also removing the path only does that ,and will not remove the squares that are on the path. any help appreciated. code for stopping tween kill_btn.addEventListener(MouseEvent.CLICK, kill) function kill(e:MouseEvent):void{ TweenMax.killTweensOf(path) removeChild(path); } Best Regards Peter
  14. constant tween on a path

    Thank you very much You have made my life a lot easier Best Regards Peter
  15. constant tween on a path

    Thank you for your help That is the code I have been playing with ,if the time can be set to infinity it would be okay. This is the part code I am struggling with //tween all of the squares through the path once (wrapping when they reach the end) TweenMax.to(path, 20, {progress:1}); can i change the "tween all the squares through the path once (wrapping when they reach the end)" to "tween all the squares through the path indefinitely (wrapping when they reach the end) so achieving a constant motion of squares. Best Regards Peter