A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: Using AS3 instead of timelime line - can someone point me in the right direction?

  1. #1
    Junior Member
    Join Date
    Jun 2009
    Posts
    6

    Using AS3 instead of timelime line - can someone point me in the right direction?

    I want to do something very simalar to this site: http://www.bam.org/ but i was wondering if its best to use actionscript instead of using motion tweens on the timeline? I was thinking it would keep the .swf file size down. Can anyone point me in the right direction or tutorial?

    Thanks,
    smgtech.

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Do a search for "tween engines". There are several 3rd party tweening engines which make animating tweens through code much easier (and more efficient) than Adobe's built in Tween class.

    I think two of the most popular are Tweener and TweenLite.

  3. #3
    Junior Member
    Join Date
    Jun 2009
    Posts
    6
    thanks for the help but do you know of anything thats just CS4 and AS3 code only? I could easily tween this stuff with small amounts of AS and make it do what I want but I am trying to learn how to make AS do what I want without tweening so a more efficient way with hopefully a small or ok file size. I mean I have seen what AS can do over at gotoandlearn.com for the carousel tutorial of the f that moves by your mouse and I believe they did it all with AS or the Flex environment.
    Last edited by smgtech; 06-03-2009 at 11:43 PM.

  4. #4
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Those ARE code only. And using them, you will probably achieve a smaller file size.

  5. #5
    http://pat.theorigin.net cresquin's Avatar
    Join Date
    Jun 2003
    Location
    Los Angeles, CA
    Posts
    685
    I think smgtech is looking for some tutorials on how to execute that type of effect. A noble end. I suggest grabbing those class packages and diving into them. The code is well written, easy to read and well commented.

  6. #6
    Junior Member
    Join Date
    Jun 2009
    Posts
    6
    5tonsofflax and cresquin, thanks. I just wasn't looking deep enough and thought that the tweener or tweenlight was just a kid version of moving things around from the demo on tweenlight. Cresquin hit it on the nail I just need to dive in and learn it because the code can do what I want without the timeline which is what I am looking for. thanks again.

  7. #7
    AS2 intolerant person
    Join Date
    Jan 2009
    Location
    Swansea
    Posts
    352
    also tweenlite has a delay property, so you can string tweens together more dynamically. just remember to use the property; overwrite:0 to avoid overwriting tweens on the same object.

    flos

    ps i suggest you get tweenmax because it includes a number of effects like blurring, which is nice when tweening something thats meant to look like its moving fast.

  8. #8
    Junior Member
    Join Date
    Jun 2009
    Posts
    6
    Im trying to learn how to use Tweenmax it seems more efficient but I just learning AS3 so I need a little help. My code:

    import gs.TweenMax;

    fader.addEventListener(MouseEvent.MOUSE_OVER, RollOver);
    function RollOver(event:MouseEvent):void {
    TweenMax.to(fade, 1, {alpha:0});
    }

    fader.addEventListener(MouseEvent.MOUSE_OUT, RollOut);
    function RollOut(event:MouseEvent):void {
    TweenMax.to(fade, 1, {alpha:1});
    }

    I'm trying to get the fade symbol to go to alpha 0 when I mouse over just like the BAM.org site has on the side of its flash. I publish it and this code doesn't work? What am I doing wrong?

  9. #9
    Junior Member
    Join Date
    Jun 2009
    Posts
    6
    Sorry guys/gals I persevered and this worked just like I wanted it too but now I am getting error code 1121 when I try to get the left fade to work...:

    import gs.TweenMax;

    fadeleft.addEventListener(MouseEvent.MOUSE_OVER, RollOver);
    function RollOver(event:MouseEvent):void {
    TweenMax.to(fadeleft, 1, {alpha:0});
    }

    fadeleft.addEventListener(MouseEvent.MOUSE_OUT, RollOut);
    function RollOut(event:MouseEvent):void {
    TweenMax.to(fadeleft, 1, {alpha:1});
    }
    faderight.addEventListener(MouseEvent.MOUSE_OVER, RollOver);
    function RollOver(event:MouseEvent):void {
    TweenMax.to(faderight, 1, {alpha:0, overwrite:0});
    }

    faderight.addEventListener(MouseEvent.MOUSE_OUT, RollOut);
    function RollOut(event:MouseEvent):void {
    TweenMax.to(faderight, 1, {alpha:1, overwrite:0});
    }

    Does anyone see my mistake?

    Thanks.

  10. #10
    Junior Member
    Join Date
    Jun 2009
    Posts
    6

    How would TweenMax ease many objects at one time?

    I want to move 5 pictures left across the stage slowly and the same 5 pictures to repeat continuously. When I rollover the center picture I want the scroling/moving left to stop so that I can click on the picture and it take me to the webpage on the site about that picture.

    I was thinking create a movie clip of the 5 photos within the stage and within the movie clip convert each photo to a button. Add the Tweenmax easing action script to the movie clip and the stop action script when moused over. And since the photo was converted to a button it would go to the URL associated with that button if I click on it. But I wanted to know if Tweenmax could do this in a simpler way if so can some one point me to that page or give me some tips.

    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center