A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: set RGB in timeline?

Hybrid View

  1. #1
    Junior Member
    Join Date
    Mar 2005
    Posts
    3

    set RGB in timeline?

    I have a timeline with a movie clip symbol moving across the screen. At the end of the timeline I have a go to and play (1) so that the timeline loops. That part works fine. I want the color of the symbol to change each time the timeline loops. I put a set RGB random action at the end of the timeline.

    The problem is everytime my timeline hits the setRGB action it does change the color the way I want it to but it stops the timeline from playing. It always stops the timeline playing whereever I put the setRGB action. Is there a way to get the timeline to keep playing after this?

    Thanks.

  2. #2
    Registered User Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Show your code.

  3. #3
    Junior Member
    Join Date
    Mar 2005
    Posts
    3
    Thanks, here it is...

    myColor = new Color(Sailboat);
    myColor.setRGB(random(256) << 16 | random(256) << 8 | random(256));
    gotoAndPlay(1);

    This is on the last keyframe on my timeline. It does change the color randomly but then it just sits there.

    If I put the gotoAndPlay(1); at the top it does change the color and goes to frame 1 but then it still just sits there at frame 1 and doesn't play.

    Thanks again.

  4. #4
    Registered User Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    PHP Code:
    random(256);
    random(256);
    random(256);
    colorHexString R.toString(16)+G.toString(16)+B.toString(16);
    colorhex parseInt(colorHexString,16);
    myColor = new Color(fillColor);
    myColor.setRGB(colorHex);
    gotoAndPlay(1); 

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