A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: sprite (mock button)

  1. #1
    Senior Member
    Join Date
    Feb 2004

    sprite (mock button)

    I'm having a problem creating a "button," that's not really a Swishmax button. It's simply an audio player to retrieve a large RealAudio file on a server. (I'll do one for an mp3 later, but I want this one right first). It didn't look like the usual Swishmax button would work, so I've created my own 3 states-Up, Over, and Hit/Release. I want it so when rolled over the Up state dissappears and the Over state takes over. When released the Over state dissapears and the Hit state takes over and lasts for 3-5 seconds while it retrieves the large audio file. I'm having difficulty making the previous states dissappear and continue the progression. Any suggestions? The file is attached.
    Last edited by western5360; 11-10-2007 at 06:18 PM.

  2. #2
    Senior Member Dead Rabbit's Avatar
    Join Date
    Oct 2002
    Back in Tampa FLA again - and happy!
    One way to make a button is to have all 3 states in the same sprite. (For me, this is the easiest way.) Then use Button Events to move the playhead to the various points on the sprite's timeline. Seperate the actions with Stop actions to isolate the animation.

    In the attached example, Scene_2 contains only the button sprite I made. Note that I created a "HitRectangle" that is a shape with no fill. It is the top layer of the sprite and contains all the script. This shape is removed in the Hit state to prevent the On(Rollover) and On(Rollout) actions from changing the button state.

    I would suggest adding the LoadMovie() and UnLoadMovie() scripts on the timeline (using OnFrame) so you can keep the actions straight.

    Hope this helps!

    Attached Files Attached Files
    While changing my profile, I accidentally clicked the link that said
    "Add 'Dead Rabbit' to your Ignore List"
    so now I can't talk to myself anymore...

    The Repository -:- The Forum

  3. #3
    Senior Member
    Join Date
    Feb 2004
    Thanks. I'll continue to work with it. I appreciate the help.

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