A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: How to control a sprite

  1. #1
    Senior Member -Attila-Berlin-'s Avatar
    Join Date
    Nov 2002
    Posts
    181

    How to control a sprite

    Hello,

    I just added a 3d-file from swift, which should be something like a button. It's an animation: A pyramid appears from the bottom and than rotates. The problem is that if i convert it into a button the pyramid comes again from the bottom if i roll over or push it. The animation has about thirty frames. At frame 10 the pyramid is on top and starts to rotate so I added at frame 30 a gotoframe10 action. Now the pyramid comes up and just rotates. this is what i wanted but it's too complicated to do this all with a button. My question is how i can control just a sprite so when i rollover something happens like a gotoframe action?
    Does anybody can help me. I would appreciate an answer.
    Thx a lot

    Attila
    O mi to fo

  2. #2
    Senior Member
    Join Date
    Jul 2002
    Location
    USA, NY
    Posts
    686
    Hi,

    I hope this helps... If you convert your animation to a sprite, then convert it to a button, you will find your sprite in all states of the button. For the roll over state you can assign an action on the button. You can even change the individual sprite actions after you have converted it to a button. Hope that helps.

    Just my $ .02
    ..--==Brian==--..
    There is no "Try". You either DO or you do NOT, DO.

  3. #3
    Flashkit historian Frets's Avatar
    Join Date
    Oct 2000
    Location
    flashkit
    Posts
    8,797
    Since you cant tell the sprite to play/stop by clicking on it

    Create an invisible shape and place it over your sprite.
    (a shape with no line or fill)

    On rollover
    tell target "/my sprite"
    play

    On rollout
    tell target "mysprite"
    Stop

    Frets

  4. #4
    Senior Member -Attila-Berlin-'s Avatar
    Join Date
    Nov 2002
    Posts
    181

    Thx

    Thanks a lot for your help. Frets, it worked, i thank you very much.

    O mi to fo[buddha bless U]
    Attila

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