A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: buttons that react differently based on their position to the stage

  1. #1
    Junior Member
    Join Date
    Sep 2004
    Posts
    22

    buttons that react differently based on their position to the stage

    Hi,

    I'm a flash newbie and would post in the newbie forums (i've already got some other stuff going in there) but i'm pretty sure this is a complicated AS question!

    I've made 4 different versions of a button. The button 'grows' a box with a small bit of info (like an ALT tag or tooltip). The 4 different versions grow in different directions (NE, SE, SW, NW).

    They will be placed on a map to draw attention to it's landmarks. The map will be movable which means that the buttons will grow in the correct direction at first, but if the map is moved...

    I'm hoping someone can show me a way to have the button load a different MovieClip for it's OVER state based on it's position.

    TIA for any help!

    PS. Currently i can only get the buttons to a) move with the map but not work, or b) work but not move with the map. I think i've got someone trying to help me sort that out though so don't worry about that unless you want to!
    Last edited by reamer; 09-27-2004 at 06:40 AM.

  2. #2
    Junior Member
    Join Date
    Sep 2004
    Posts
    22
    I hope this .fla allows you to see what i mean. I've removed the map and just put a large rectangle there instead.
    Attached Files Attached Files

  3. #3
    if(mymovieclip_mc._x == some numbered x axis cordinate ){
    place what you want it to do here....
    }esle(
    ect.
    }

    You will probally want to use >= or <= more than ==. The same is true for your y coordinates too. and you can use a box effect

    i.e.
    if (mymovieclip_mc._x >= 100 or mymovieclip_mc._x <= 200 and mymovieclip_mc._y >= 100 or mymovieclip_mc._y <= 200){....

    I'm not a 100% sureof the syntax, but I know you can sting this stuff out like this. Check your help icon in the actions pannel to find out what the syntax is if I'm wrong on that.

    Hope this helps.
    Q

  4. #4
    Junior Member
    Join Date
    Sep 2004
    Posts
    22
    Hi, Thanks a lot for getting back so quickly.

    Is there any chance you could apply that to one of the buttons in the .fla i posted? I kind of understand the AS you posted but it would be alot easier if i can see an example.

    Thanks a lot!

  5. #5
    hope this helps ya, I'm not doing the whole thing for ya or else ya won't learn it. But this shows you a basic if statment that will get you there.


    Hope this helps!

    Also go check out the info on listeners at macromedia that is more complex but will better suit your need in the long run.


    Quince
    Attached Files Attached Files

  6. #6
    Junior Member
    Join Date
    Sep 2004
    Posts
    22
    Thanks for your time but i'm a newbie, and while i can see how the example you posted works, i can't see how to apply the other example to it.

    If i can't make some progress on this today then my boss says i have to move on. I'd really like to be able to continue with it!

    I especially don't understand how i would put the AS on the button to tell it what direction to move in. I can see the instruction in the AS but where does it go?

    I'm not just being lazy, i don't understand and i'm hoping i can learn more from a working example.

    PS. I went to look at the stuff you suggested on the macromedia site but it was far beyond me. Thanks for pointing me there anyway.

  7. #7
    Junior Member
    Join Date
    Sep 2004
    Posts
    22
    Here is an example of what i've tried to do with the dynamically animated button.
    Attached Files Attached Files

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