A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Action within a sprite

  1. #1
    Cherosh
    Join Date
    Jul 2007
    Posts
    1

    Action within a sprite

    I am trying to make a action within a sprite work once the sprite begins to play. I have a scrolling object, a long graphic that you can scroll back and forth. I need to have certain objects on that graphic open a new sprite. I have been able to create transparent rectangles over those areas that when clicked will open a sprite with more information (basically a fade in text box), and it works until you move the scroller, at that point the rectange is no longer available. I have even made the rectangle move as the main graphic scrolls, so it is always over the same area. Can anyone help me to make this work?

    To see it go here and click on 1957 without scrolling, then attempt to find it once you move the scroller...

    Thank for any assistance

  2. #2
    Flashkit historian Frets's Avatar
    Join Date
    Oct 2000
    Location
    flashkit
    Posts
    8,797
    So,,, on(load)

    In an onload situation the action only occurs once (when the sprite loads)

    Or you could qualify it with an if statement

    MyCounter++ (adds)

    If (MyCounter ==1)
    {//whatever


    Also name your sprites and have them multiply.
    Sprites can have child sprites and you can telltarget or just
    targetSpriteName.gotoAndPlay()
    You could have a child sprite with two frames and just instructions
    frame(1)
    (targetSprite.What you want only once()

    frame(2)
    {stop

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