Movieclip - Button - Location on stage

Fellow Gurus!
I am using Flash 8.
I rendered some boxes on the stage. One is for a menu and
another is for graphics. The idea is to have a picture pop-up in
the graphic box whenever one passes a mouse over a button in the
menu (which is in the menu box).
I have added movie clips to each button’s mouse-over.
The movie clips contain a picture (at least for now). Thus when you
pass a mouse over the button, a picture pops up. That is the easy
part.
Now, I could simply reposition the movie clip until it
appears within the graphic box. My problem is – I have a
bunch of buttons and they may or may not be placed in the menu in
exact positions. If I were to change a button’s position, the
movie clip’s position is relative to the button and not the
stage thus it would have to be repositioned as well.
Therefore, the pop-up pictures within the movie clips which
are within the buttons must all pop-up in the graphic box
regardless of where I place or reposition the buttons.
Let’s say I have the graphic box located at x=500 and y
= 120.
Let’s say the button’s name is First_btn.
Let’s say the movie clip’s name is OneTest_mc.
And, I can bring it on stage in order to add an instance name
of perhaps TestOne.
Now, I have looked at localToGlobal and globalToLocal. I am
not sure which one work for my situation.
I am assuming that I can add AS2 to the movie clip’s
(OneTest_mc) timeline – if that is not where it goes - let me
know.
I have looked at the various scripts on the Internet and all
they do is confuse me, namely because they are rotating graphics,
etc. In another words, they complicate the examples. What I need is
a script to add to each button/movie clip to make them all place
the pop-up graphic in the box regardless of where the button is
located.
However, I do not just want a piece of script. I would
appreciate some explanation of the code so I can learn from it
– not just giving me a fish but teaching me how to fish.
Thanks in advance,
Bill

I am not sure if I get this.
First of all, I am no sure if it is globalToLocal or
localToGlobal that I need to use – or maybe you are
discussing something else entirely.
You said: “… the sum of your button's _x property
and the _x property of your graphic relative to your button) is the
_x property you want to assign your movieclip if you want it to
appear on the same timeline as your button and overlap your graphic
(assuming your reg points are comparable). likewise for the _y
property.”
I read and reread the above answer. However, I do not have
enough of a handle on Action Script to see the logic.
“I am illuminated with darkness,” as Tennyson
might have said. I am assuming that I should figure out how to get
the button’s x & y no matter where it is placed –
and not by reading them as numbers. I guess I need a hint –
how do I capture the button’s x & y coordinates if they
are changeable?
I think this captures the x & y for the button –
have I got it right?
Var point = new Object ();
point.x = First_btn.x; // First_btn is the name of the button
point.y = First_btn.y; // First_btn is the name of the button
OneTest_mc.globalToLocal (point); // OneTest_mc is the name
of the movie clip
If the above script is valid, and it most likely is not since
I haven’t a clue what I am doing, then the movie clip would
end up located where the button is located on the stage.
Thanks for your help past and future as well as anyone
else’s help.

Similar Messages

  • Changing stage timeline from inside a movieclip button

    I create a movieclip button, and I want to change main timeline from it. what should I do ?
    Is it useful to use MovieClip(root).gotoAndPlay(...) ; ?
    Is there any other way to change main timeline?

    Example:
    Add something to trigger the event in the child:
    dispatchEvent(new Event("eventTriggered"));
    In your parent swf, listen for the event using a listener for the child with a corresponding event handler...
    childName.addEventListener("eventTriggered", eventHandler).
    function eventHandler(event:Event):void {
        trace("child dispatched an event");
         // gotoAndPlay(etc);

  • MovieClip buttons inside a MovieClip button inside another MovieClip button

    I am trying to make a Portfolio of my study abroad experience and can get something right about the movie clip buttons inside each other. I have a button to click on titled "travel" and a window shows up with more movieclip buttons to organize different locations of pictures. I can click on the button to have to slide of pictures but nothing happens. I have the "turnOffAllButtons"  coding and  also have the coding for stay clicked, but I can't get the 3rd set to show up. what am i not doing?
    I don't have any errors or output comments showing up

    I have it working now. what I did, I make a slideshow setup (gotoAndStop(1);) in a specific frame and the code I put in for the next, didnt work.
    this is was I have now, without the "turnOffAllButtons" coding:
    Main Button (actions Layer):
    stop();
    travelButton_mc.buttonMode=true;
    travelButton_mc.addEventListener(MouseEvent.ROLL_OVER, colorizetravelButton);
    function colorizetravelButton(givenEvent:MouseEvent){
      if (givenEvent.currentTarget.currentFrame != 50)
      travelButton_mc.gotoAndPlay(2);
    travelButton_mc.addEventListener(MouseEvent.ROLL_OUT, decolorizetravelButton);
    function decolorizetravelButton(givenEvent:MouseEvent){
      if (givenEvent.currentTarget.currentFrame != 50)
      travelButton_mc.gotoAndPlay(21);
    travelButton_mc.addEventListener(MouseEvent.CLICK, loadtravelLocations);
    function loadtravelLocations(givenEvent:MouseEvent){
      travelButton_mc.gotoAndStop(50);
      travelLocations_mc.gotoAndPlay(1);
    Inside the travelLocations_mc I have currently one button to show a slide of pictures, this is the second layer of buttoncode:
    stop();
    scotlandButton_mc.buttonMode=true;
    scotlandButton_mc.addEventListener(MouseEvent.ROLL_OVER, colorizescotlandButton);
    function colorizescotlandButton(givenEvent:MouseEvent){
      if (givenEvent.currentTarget.currentFrame != 50)
      scotlandButton_mc.gotoAndPlay(2);
    scotlandButton_mc.addEventListener(MouseEvent.ROLL_OUT, decolorizescotlandButton);
    function decolorizescotlandButton(givenEvent:MouseEvent){
      if (givenEvent.currentTarget.currentFrame != 50)
      scotlandButton_mc.gotoAndPlay(21);
    scotlandButton_mc.addEventListener(MouseEvent.CLICK, loadscotlandInfoPage);
    function loadscotlandInfoPage(givenEvent:MouseEvent){
      scotlandButton_mc.gotoAndStop(50);
      scotlandInfoPage_mc.gotoAndPlay(1);
    I turned the alpha up so you can see the mc that loads
    I currently have a keyframe at 60 with a code of stop(); so the travelLocations_mc will still
    does this make sense?

  • Accessing buttons on main stage from inside of a movie clip

    Greetings...
          here is the scenario:
                 - I have buttons on main stage, and a swf file which is loaded to scene using a LOADER in AS3
                 - this is a website, so the problem rises when user moves its cursor around the page and now  buttons in main stage,
                    are still active since they are behind the loaded swf file.
                 - i would like to learn, how can i CODE inside the loaded SWF file, to either remove the buttons in main page, or remove
                    the event listeners. not sure if my case has anything to do with .Parent or .roo, (I want to access those main stage
                    buttons from the SWF file which is loaded)
                 - The general case is, i have SWF files loading inside another SWF files, is it possible to access items on each stage from
                    inside of loaded SWF files on that specific stage. Similarly i would be interested to learn about accessing main stage from inside
                    of movieclips running on stage. how can i access something not in present FLA file yet, in FLA file that is loading the page as SWF.
                    Thanks.

    If you load an swf into another using the Loader class, then the Loader itself is the parent of the loaded swf., so MovieClip(parent.parent) might help you to target the timeline that the Loader was born from.  The more proper way to have a loaded file talk to a parent file is thru dispatching events that the parent assigns listeners for after the file has loaded.  Here's a link to a posting that might help explain how to implement this.
    http://forums.adobe.com/thread/470135?tstart=120
    As for the buttons that you want to disable, you could either use the removeEventListener() method to remove the listeners you have assigned, or you could set their mouseEnabled property to false, or you could set their visible property to false.

  • Movieclip registration point defaulting to top left of nested movieclip when placed on stage

    basicaly there is a movieclip holding multiple movieclips with animations that pass from right to left making the overall registration point of the parent MC to somewhere right of the stage
    in the parent movieclip there is a background that is the exact size and placement of the stage and the top left of that background is where the parents registration point is being loaded at..I
    I'm not sure if this has any relivance but i defined the movieclip as a variable and placed that variable at the specified coords..
    addChild(PLevel);
        PLevel.x = w/2;
        PLevel.y = h;
    where w is the max width of screen  and h is the min height
    my registration for that moveclip would be the bottom of the movieclip centered on the stage background

    I can't find anything of a question or problem in your posting.  You mention three different locations for registration points, but I am unable to determine anything from your doing so.

  • Changing a boolean inside a movieclip via the main stage.

    I have a movieclip and within it is a bit of actionscript and a couple of different movieclips to make it function like the button on a ball point pen (you click it and it stays clicked until you click it again).
    var booleanClick:Boolean = false;
    var colorTransform:ColorTransform = optBox.transform.colorTransform;
    optHitState.addEventListener(MouseEvent.CLICK, onClickHandler);
    function onClickHandler(myEvent:MouseEvent){
         if (booleanClick == false ) {
              colorTransform.color = 0xB5CDE6;
              optBox.transform.colorTransform = colorTransform;
              booleanClick = true;
         } else {
              colorTransform.color = 0xFFFFFF;
              optBox.transform.colorTransform = colorTransform;
              booleanClick = false;
    I have thirty-some-odd of these ball point pen movieclips on my main stage.
    I want to be able to "clear" all the movieclips so that the optbox color is white and the booleanClick is false with a button that is on my main stage. Currently I've got it working for the optbox color, but when i try to trace out my boolean - it gives me nothing (not even an error).
    var cClear:ColorTransform;
    var optionArray = new Array ( mc1, mc2, mc3, mc4, mc5, mc6 ); // all my ball point pen movieclips are in this array.
    clearButtons.addEventListener(MouseEvent.CLICK, goClear);
    function goClear(e:MouseEvent):void {
         for (var i:int = 0; i < optionArray.length; i++) {
              cClear = optionArray[i].optBox.transform.colorTransform;
              cClear.color = 0xFFFFFF;
              optionArray[i].optBox.transform.colorTransform = cClear;
              trace(optionArray[i].booleanClick + i);
              optionArray[i].booleanClick = false;
              trace(optionArray[i].booleanClick + i);
    I don't want to get deeper into this monster of a project without making sure this is working first. Is my boolean working and just my trace statements aren't worded right or is my method to change the boolean wrong?

    I'm not sure what you are trying to trace (boolean + number?), but try changing it to...
    trace(optionArray[i].booleanClick, i);
    and see if that's more like what you are expecting

  • Buttons null; losing stage instance names

    Hello, I apologize if this question has already been asked but as the title states I'm having problems with the instance names of my buttons. I am using Actionscript 3 with Flash CS5. I apologize in advance for being verbose but it'd be best if I explained my problem in detail.
    I have my project set up so that everything occurs in one MovieClip and buttons within the MovieClip are clicked to navigate through the MovieClip. The MovieClip contains several frames which are all unique and contain a variety of textboxes, MovieClips, buttons, classes and other custom classes. All of these components are created directly in Flash Professional by dragging them from the library onto the stage inside of the MovieClip.
    I then name these components using Flash Professional and use these instance names to work with the components. Usually this works without a problem. However, now that I am using a nested MovieClip for my project many problems are occuring. I have it so that when buttons are clicked, the MovieClip goes to a certain frame via the gotoAndStop(x); command. This works fine but I am having problems accessing the buttons that I have named earlier. It gives a null object reference error and when I trace the button it traces as "null".
    Originally I thought that this problem was because the MovieClip had not yet initialized but I had used the ADDED and RENDER event listeners, Timeline scripting, and other methods but the button was still null, leading me to believe that the problem was more than that.
    So I used a click event listener that traced the instance names of the components that I was clicking (trace(e.target.name)). I have a total of 8 buttons on the specific frame of my MovieClip so I clicked on them all. 6/8 of the buttons traced the correct instance name that I had given them whereas the other two buttons traced "instance 169" and "instance 177" instead of the instance name.
    With all this strangeness, I commented out the code for these 2 specific buttons to see if it would work without them. Sure enough it did.
    I believe that my buttons have lost their stage instance names and I do not know how to fix this problem. I have tried deleting the buttons and creating them again but to no avail. It does work, however, if I use the Button component that Flash has but I do not want to do that because I'd like to use my own custom buttons (I know the Button component is customizeable, but I'd like to use my own anyways).
    If anyone could help, please how can I fix this problem? If my .fla or specific code needs to be provided, I can do so.

    Without looking at your code I can't say 100% what is going on. However, I suspect what is happening is that you're doing the following:
    Your button is on stage in frame 1
    You add an event listener to that button
    At some point, you go to a frame where the button does not exist.
    When you come back to frame 1, your listener doesn't work anymore
    Or some variation of above, where an instance was on the stage, is removed, and even though it appears to have been added back you can't reference it anymore.  I've discussed fixes for this issue in depth in this article, but it all boils down to the fact that when the object is removed from the stage the variable that contained the instance the first time will go to null, and then when you go back to the frame with the instance on it, the variable will be populated with an instance which is probably not the same as the first one.
    If the problem is what Ned Murphy speculated, you can easily fix it by setting mouseChildren to false on the buttons.

  • Movieclip button AS 2.0 help

    I have a movieclip button with up-over and out states
    plays fine but in the over state I need to have two more buttons
    1 button for each icon
    I need to make the hit state in one area with room for two I would guess invisible hit state only buttonds on top of the icons?
    how do I get two separate working buttons in there?
    any help?

    OK, after looking around I see what I need to do is have Nested Movieclips in a drop down menu.
    The drop down menu I made is here
    http://www.mediafire.com/?lynnkzjhkjt
    I think I may have been unclear in what I need to do but when you open the fla you see that the movieclip in the over state needs to have two separate buttons (or movieclips) acting as buttons so I can go to another frame. the mc/buttons shpuld have the hit states or target the two icons.
    I have tried everything as I did see some things for AS 3.0 but not for 2.0
    anybody?

  • Menu buttons live on stage

    I am no longer able to edit the menu buttons on my stage.
    If I click on the buttons layer tab all buttons are
    selected, but if I then try to select an individual button it just
    takes me to the corrosponding page and will not select.
    Please assist
    Thanks

    Hmm... this is very strange.
    If they are all placed in one layer, try rightclicking them
    when they are marked, and choose disribute to layers.
    If u grouped them, try ungrouping...
    If none of these things works, I really don't know what could
    be wrong.
    U can try posting ur .fla, and I'll see if I can help!

  • Linking a MovieClip button to a URL?

    Hello all,
    I have recently followed a Adobe Flash tutorial, which has helped me make MovieClip buttons which extend to the left when hovered over.
    This tutorial can be found here:
    http://www.schoolofflash.com/2008/05/flash-cs3-tutorial-movie-clip-buttons/
    An example and download link for the project is at the bottom of that page.
    Everything on the tutorial went fine, but now I am trying to work out how to make these MovieClip buttons link to another URL.
    What code do I need to do this, and where do I need to put it?
    Any help is appriciated, I am using Flash version CS5.5
    Thanks,
    Vanilla

    Below is the Code to load an url
    btn_mc.addEventListener(MouseEvent.CLICK,onButtonClick);
    function onButtonClick(e:MouseEvent):void{
        var request:URLRequest = new URLRequest("http://www.foundation-flash.com/");
        navigateToURL(request);

  • Converting AS3 to AS2. Some movieclip buttons not working.

    25 movieclip buttons in frame 126 maintimeline. Buttons are on top layer above all other content.
    Buttons 1_1, 2_1, 3_1, 4_1, and 5_1 work. All buttons have correct instance name. The buttons are in a 5x5 grid. Hence the naming convention of column_row. So all row 1 buttons are working. Do not get hand cursor over any of the other buttons. This is totally baffling. I am using Flash CS4. The file is saved as CS3 and the publish settings are AS2, Flash player 8.
    Here is the AS for frame 126.
    stop();
    trace("tScore = "+tScore);
    trace("i = "+i);
    if (i == 0) {
        i++;
    this.podium.signin.unloadMovie();
    videoBtn1_1.onRelease = function() {
        gotoAndStop(127);
        videoBtn1_1.play();
    videoBtn2_1.onRelease = function() {
        gotoAndStop(127);
        videoBtn2_1.play();
    videoBtn3_1.onRelease = function() {
        gotoAndStop(127);
        videoBtn3_1.play();
    videoBtn4_1.onRelease = function() {
        gotoAndStop(127);
        videoBtn4_1.play();
    videoBtn5_1.onRelease = function() {
        gotoAndStop(127);
        videoBtn5_1.play();
    this.videoBtn1_2.onRelease = function() {
        gotoAndStop(127);
        videoBtn1_2.play();
    videoBtn2_2.onRelease = function() {
        gotoAndStop(127);
        videoBtn2_2.play();
    videoBtn3_2.onRelease = function() {
        gotoAndStop(127);
        videoBtn3_2.play();
    videoBtn4_2.onRelease = function() {
        gotoAndStop(127);
        videoBtn4_2.play();
    videoBtn5_2.onRelease = function() {
        gotoAndStop(127);
        videoBtn5_2.play();
    videoBtn1_3.onRelease = function() {
        gotoAndStop(127);
        videoBtn1_3.play();
    videoBtn2_3.onRelease = function() {
        gotoAndStop(127);
        videoBtn2_3.play();
    videoBtn3_3.onRelease = function() {
        gotoAndStop(127);
        videoBtn3_3.play();
    videoBtn4_3.onRelease = function() {
        gotoAndStop(127);
        videoBtn4_3.play();
    videoBtn5_3.onRelease = function() {
        gotoAndStop(127);
        videoBtn5_3.play();
    videoBtn1_4.onRelease = function() {
        gotoAndStop(127);
        videoBtn1_4.play();
    videoBtn2_4.onRelease = function() {
        gotoAndStop(127);
        videoBtn2_4.play();
    videoBtn3_4.onRelease = function() {
        gotoAndStop(127);
        videoBtn3_4.play();
    videoBtn4_4.onRelease = function() {
        gotoAndStop(127);
        videoBtn4_4.play();
    videoBtn5_4.onRelease = function() {
        gotoAndStop(127);
        videoBtn5_4.play();
    videoBtn1_5.onRelease = function() {
        gotoAndStop(127);
        videoBtn1_5.play();
    videoBtn2_5.onRelease = function() {
        gotoAndStop(127);
        videoBtn2_5.play();
    videoBtn3_5.onRelease = function() {
        gotoAndStop(127);
        videoBtn3_5.play();
    videoBtn4_5.onRelease = function() {
        gotoAndStop(127);
        videoBtn4_5.play();
    videoBtn5_5.onRelease = function() {
        gotoAndStop(127);
        videoBtn5_5.play();

    You can probably reduce all that interaction code to a loop...
    for(i=1; i<6; i++){
       for(k=1; k<6; k++){
          this["videoBtn"+i+"_"+k].onRelease = function() {
              gotoAndStop(127);
              this.play();
    As for why movng the buttons to another layer fixed anything, it will not have mattered.  Whatever fixed the problem will remain a mystery.  It could have been an issue with instance names/frames since you are at frame 126 for some reason.  If you transition the buttons into place, that might be related to what the problem was.

  • HT5654 Where is the Help button located within Itunes on a windows computer?

    Where is the Help button located within Itunes on a windows computer?

    It's in the top right corner of the app, like where you would see it in other apps.
    You should able able to find the info your looking for here too.

  • Where is the home button located so i can use siri?

    WHere is the home button located so i can use siri?

    The Home button is the round button on the front of your iPad.
    Which iPad do you have? Siri is only available on the new iPad with iOS 6. The original iPad and the iPad 2 do not support Siri.

  • Where is authorize this computer button located in new i tunes

    Hi,
    Where is authorize this computer button located in new i tunes?
    Can't find it.
    Thanks

    Click on the store menu item then select authorize this computer.

  • Movieclip Button RollOver/RollOut

    I have a movieclip button name "about". In the about movieclip button when you rollover it will play a looping movieclip. When you rollout it will play another animation or movieclip.
    The problem I am trying to solve is how do I code it so that when you rollout, the movieclip of rollover stops playing and will not finish the full movieclip. As of right now the way it is when you rollout, movieclip of rollover will play to full length before it stops.
    The effect i'm trying to achieve can be seen in this template.
    h**p://www.templatemonster.com/flash-templates/7981.html
    If someone can point me to a tutorial or sample code of the effect please. Thanks

    Well, I am not a professional but like I said I posted a question similar to this and I was told to add and remove listeners like such:
    about_mc.buttonMode = true;
    about_mc.addEventListener(MouseEvent.ROLL_OVER, buttonOver);
    about_mc.addEventListener(MouseEvent.ROLL_OUT, buttonOut);
    function buttonOver(e:MouseEvent):void
        about_mc.removeEventListener(MouseEvent.ROLL_OVER, buttonOver);
        e.currentTarget.gotoAndPlay("over");
        about_mc.addEventListener(MouseEvent.ROLL_OUT , buttonOut);
    function buttonOut(e:MouseEvent):void
        about_mc.removeEventListener(MouseEvent.ROLL_OUT, buttonOut);
        e.currentTarget.gotoAndPlay("out");
        about_mc.addEventListener(MouseEvent.ROLL_OVER , buttonOver);

Maybe you are looking for