3 Replies Latest reply on Nov 6, 2013 12:13 PM by kglad

    X Y coordinates are different in each symbol?

    CE_1234

      Hello,

       

      First, let me start by saying I'm very new to Flash (less than 2 weeks experience). I am working on a project where when a user rolls the mouse over an image a big text box appears in the open space above it. There are five images on the page and each time a user rolls over an image it should produce the same size text box in the exact same spot on the screen. However, I'm realizing that I am not able to position all of the boxes in the exact same place on the screen because the X and Y coordinates on image 1 (which I have converted to a movie symbol) are different than the X and Y coordinates on image 2 (which I have converted to a movie symbol).

       

      Is there an easy way to like all of these boxes up?

       

      Thanks,

       

      Jeremy

        • 1. Re: X Y coordinates are different in each symbol?
          kglad Adobe Community Professional & MVP

          if your images have been converted to movieclips:

           

          var tf:TextField=new TextField();

          tf.type="dynamic";

          tf.width=300;

          tf.multiline=false;

          // if you wanted to display a tooltip (ie, text near the image, assign tf.x and tf.y in overF).  otherwise, if you want to display text at the top center of the stage:

          tf.x=stage.stageWidth/2-tf.width/2

          addChild(tf);

           

          image1.textS="this is the text that should display when image1 is rolled over";

          image2.textS="this is the text that should display when the 2nd image is rolled over";

          etc

           

          for(var i:int=1;i<=5;i++){

          this["image"+i].addEventListener(MouseEvent.MOUSE_OVER,overF);

          this["image"+i].addEventListener(MouseEvent.MOUSE_OUT,outF);

          }

           

          function overF(e:MouseEvent):void{

          tf.visible=true;

          tf.text=MovieClip(e.currentTarget).textS;

          }

          function outF(e:MouseEvent):void{

          tf.visible=false;

          }

          1 person found this helpful
          • 2. Re: X Y coordinates are different in each symbol?
            CE_1234 Level 1

            Thank you for the response.

             

            I'm sure that what you are telling me to do is correct but I don't think I'm at a point in ActionScript where I really understand any of it . I guess the thing that I am struggling with is conceptually, what is happening to change the X and Y coordinates...

             

            The way my project is set up is that I have ten pictures stretched across a 970px by 600px stage. All of the pictures are placed on frame 1 of the main timeline. Each of the images is then converted to a symbol. I double click on the picture and it brings me into the timeline for that symbol. However, the stage in that symbols timeline does not match the stage of the main timeline, and I don't understand why.

             

            Also, on the timeline inside each symbol, it appears that items are also changing size. For example, I have a large whitebox inside the symbol of picture 2. I copy and paste that same box into the symbol on picture 3, but it gets larger. However, when I click to check the properties, Flash reports that both boxes are the same size, even though they are visibally different sizes.

             

            Like I said, I'm pretty new to Flash so if I'm asking something that is very basic I apologize.

            • 3. Re: X Y coordinates are different in each symbol?
              kglad Adobe Community Professional & MVP

              anything that appears to be different sized but is reported to be the same size is probably because you have different magnifications on different timelines.

               

              mag.jpg

              1 person found this helpful