A Flash Developer Resource Site

Results 1 to 14 of 14

Thread: mc´s, buttons and wrong targets...

  1. #1
    Senior Member
    Join Date
    Oct 2000
    Location
    Brazil
    Posts
    291
    I´m creating a menu for a website...

    I´ve created a small mc named "visor". It has 5 frames with one graphic per frame, and all frames has a stop action. BUT THE FIRST FRAME IS BLANK!

    I´ve created 4 different mc´s with one different button inside each.

    The actions for the first button are:

    on (rollOver) {
    tellTarget ("_root.visor") {
    gotoAndStop (2);
    }
    }
    on (rollOut) {
    tellTarget ("_root.visor") {
    gotoAndStop (1);
    }
    }

    The actions for the second button are:

    on (rollOver) {
    tellTarget ("_root.visor") {
    gotoAndStop (3);
    }
    }
    on (rollOut) {
    tellTarget ("_root.visor") {
    gotoAndStop (1);
    }
    }

    and it goes for the fourth and fifth frames for each button...

    *** THE BUTTONS ARE INSIDE DIFFERENTS MC´S ***

    The problem is that when rollover any MC WITH A BUTTON INSIDE, "_root.visor" goes to frame 2! Always

    Even if the button tells "visor" to go to the third frame, it goes to the second...

    And it goes back to the first frame when rollout, that´s ok!

    *** IS THERE ANY PROBLEM USING BUTTONS INSIDE MS´S??? ***

    If someone could help me out...

    Thanks


  2. #2

    Try frame labels...

    Renato,

    I've also had this happen from time to time. One thing that worked SOME of the time (why not all, I don't know) is rather than

    gotoAndStop(2); //2 being a specific frame

    I labelled the frame "something"...

    gotoAndStop("something"); //frame label instead

    Other than making sure your paths are correct (and it seems that they are) you might want to try this. Worked for me.

    Dale Janzen
    http://www.degajegroup.com

  3. #3
    Senior Member
    Join Date
    Oct 2000
    Location
    Brazil
    Posts
    291

    thanks, but...



    I´ve tried using frame label instead but it did´t work...

    The strange thing is that I did some similar menus and this kind of problem didn´t happen!!

    really don´t know what happens

  4. #4

    What about dot syntax...

    Renato,

    Are you using tellTarget( ) because you want or need to keep the code Flash 4 format? If that doesn't matter, have you tried Flash 5 dot syntax...

    on (rollOver) {
    _root.visor.gotoAndStop (2);
    }

    ...and so on? Again, why I don't understand, but sometimes this will make a difference. Just trying anything...

    Dale Janzen
    http://www.degajegroup.com

  5. #5
    Senior Member
    Join Date
    Oct 2000
    Location
    Brazil
    Posts
    291
    Doesn´t work again...

    but the dot syntax is really better...
    I don´t know yet all scripts that may be converted, but it will take me some time later...

    but it stills running just the second frame of "visor"

    I discoverd my mistake!!!
    Instead of graphics as I said before. I´m using text inside "visor".

    At first, I´ve tried to use a dynamic text box with a variable, and on rollover each button would send a new content for the variable...
    I don´t know if it could work, but it didn´t...

    (I´ve tried variables cos I think it creates a small file)

    So, I´ve decided to use tell target and frames inside "visor"

    BUT...

    I was using the text inside a dynamic field, and that was the point...
    I just changed it to static field and now it´s ok...

    Ok, I´ve already knocked my head...

    but about the variables...
    do you know any possibility?

    I think I´ve used something like this:

    on (rollOver) {
    name="ANDIRA";
    }

    and the dynamic field holds the variable name

    sorry about my mistake, but this thread was really usefull...

  6. #6

    No problem...

    Renato,

    Don't apologize for asking questions, or venturing guesses... that's what this forum is all about. I'm glad you figured out the text vs. graphics situation. Now about the variables issue... are you wanting to assign the value of a variable (in a dynamic text box) a certain name - your example was "ANDIRA" - when the user's mouse rolls over a button? Or am I not understanding you correctly?

    Dale Janzen
    http://www.degajegroup.com

  7. #7
    Senior Member
    Join Date
    Oct 2000
    Location
    Brazil
    Posts
    291
    You got it...

    instead of loading a frame with a text on it (like was happening with "visor" mc, I want to load a variable on a dynamic text field...

    and this variable would be a name, like "ANDIRA"

    like a traditional menu... you rollover a button and then appears "CONTACT" or "PORTFOLIO" or anything

    It will look the same thing, but I think it would be better for file size (as I said) and for updates...

  8. #8

    ...to continue...

    Renato,

    These variables (like the name "ANDIRA", etc.), will they be somehow dynamically generated by something that the user does? Or are you wanting to assign values to the variables yourself, and be able to easily update or edit them later. If the second idea is what you want, then you could check into creating and loading an external text file containing your variables... but it sounds like a lot of work for what you're after. Sorry that I can't be of any better assistance with this issue. I'm still working through all this, too.

    Dale Janzen
    http://www.degajegroup.com

  9. #9
    Senior Member
    Join Date
    Oct 2000
    Location
    Brazil
    Posts
    291
    thanks again...

    I want to change the variable "name" everytime the mouse rollover a button...

    each button will send a different value to the variable "name" that will be shown at a dynamic text field...

  10. #10

    Taking a stb at it...

    renato,

    While this won't be actual code, what about this for a direction to try... Assuming the dynamic text field "name" is already set up, on each individual button:

    on (rollOver) {
    //make sure to use the correct path to the dynamic text field "name"
    name = chosenName //insert desired name in place of "chosenName"
    }

    Now what happens when you click on that button is another matter, but you've probably got that figured out.
    Does this help?

    Dale Janzen
    http://www.degajegroup.com

  11. #11
    Senior Member
    Join Date
    Oct 2000
    Location
    Brazil
    Posts
    291

    Now it´s done...

    Dale,

    It was easier than I tought...

    I think this thread is done
    Thanks a lot...




  12. #12

    OK!

    Renato,

    Yeah, we did go back and forth a bit... but in the end, if all is working as expected, that's what counts. It seems that sometimes to recognize the simple, you need to wade through the muck a little bit... at least for me. Glad to be of whatever help I can be.

    Dale Janzen
    http://www.degajegroup.com

  13. #13
    Senior Member
    Join Date
    Oct 2000
    Location
    Brazil
    Posts
    291
    Dale...

    After all that conversation (I discoverd that I was using dynamic text field intead of static text field) I´ve realized that the problem with the button inside the mc wasn´t fixed...

    I was using this scripts for the button:

    on (rollOver) {
    name="ANDIRA";
    }

    and with the button inside the mc it didn´t work...

    so I changed it to:

    on (rollOver) {
    _root.name="ANDIRA";
    }

    And now it´s working fine...

  14. #14

    Yup...

    Renato,

    Yeah, I have to always remind myself to check the path! When something SHOULD work, but doesn't, that's a good place to start troubleshooting. Glad you got it all to go.

    Dale Janzen
    http://www.degajegroup.com

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