A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Help with Buttons, Variables especially... Desparate

  1. #1

    Help with Buttons, Variables especially... Desparate

    Summary:
    Basically I need help getting variables, passed from flashvars into movie clips based on if clauses...

    Details:
    So in the flashvars are a couple of variables. Lets say, button01text=DESIGN&button02text=NEWS&button03text =CONTACT

    I can already get it so that the text fields show the text DESIGN | NEWS | CONTACT

    that part is cool.

    but the way each button works is like this...

    clicking on button01 which now has the text DESIGN over it, causes a movie clip called animationforbutton01 to play. at the end of that animation, i need it to redirect using geturl to content.pl?x=D

    clicking on button02 which now has the text NEWS over it, causes a movie clip called animationforbutton02 to play. at the end of that animation, i needit to redirect using geturl to content.pl?x=N


    make sense? the problem is I cant get it to pick up the button01text, button02text, and button03text variables in the buttons so that they can then be somehow passed to animationforbutton01 and then somehow be passed into the geturl() call.

    I am really in need of help on this one.
    .-->
    (
    )_____)

  2. #2
    ActionScript Insomniac
    Join Date
    Jan 2003
    Location
    43d03.21'N, 89d23.65'W
    Posts
    1,173
    Don't try to pull stuff out of the text on the button. It can be done, but is more trouble than it's worth.

    Assign each button a target property, and in the button's onPress function, assemble the URL using that property:

    code:

    _global.URLBase = 'content.pl?x=';
    _global.onPress = function() {
    var newURL = _global.URLBase + this.target;
    getURL(newURL, "_blank");
    }


    button1.target = 'N';
    button2.target = 'D';

    button1.onPress = button2.onPress = _global.onPress;



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