# Problem with MovieClip on dynamically loaded image

**URL:** <https://forum.kirupa.com/t/problem-with-movieclip-on-dynamically-loaded-image/290063>\
**Category:** Uncategorized\
**Created:** [June 9, 2009, 10:09am UTC](https://forum.kirupa.com/t/problem-with-movieclip-on-dynamically-loaded-image/290063 "2009-06-09T10:09:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SrihariCh](https://avatars.discourse-cdn.com/v4/letter/s/f1d935/32.png) [@SrihariCh](https://forum.kirupa.com/u/SrihariCh)\
**Post date:** [June 9, 2009, 10:09am UTC](https://forum.kirupa.com/t/problem-with-movieclip-on-dynamically-loaded-image/290063/1 "2009-06-09T10:09:06Z")

</div>

Hi all,

```
  I am new to Flash and ActionScript 3.0. I am using Flash CS3 and ActionScript 3.0.
  I think there is someone who spends 2 minutes of your valuable time in providing solution for my problem or issue.

```

My description for my problem(with layer numbers/names) starts from here:  
**Layer-1:**  
I am loading an external image(.jpeg) onto the stage dynamically when “Submit” button(which is created & placed in Layer1) is clicked using the following sample code:

```auto

        submit_btn.addEventListener(MouseEvent.CLICK,onSubmit);
        function onSubmit(e:MouseEvent):void
        {
            trace("Inside onSubmit() function");
            var url:String = "http://www.helpexamples.com/flash/images/image2.jpg";
            var urlRequest:URLRequest = new URLRequest(url);
            var loader:Loader = new Loader();
            loader.load(urlRequest);
            addChild(loader);
        }

```

```
    The jpeg image is loaded perfectly and works fine.

```

**Layer-2:**  
When I click on this loaded image, a Pop-up must be visible. So, I created Pop-up in Layer2, which is nothing but a MovieClip(with instance-name myPopup), is a rectangular box with light-yellow colored background, which makes us to feel like a pop-up). So, I created this Pop-up in a layer named “Pop-up”.

```
   My requirement is : Whenever I click on the image loaded, I need to view the Pop-up upon this loaded image near to the pixel-position where CLICK_Event has occured.
  To view an example of my requirement,just go through the following url:

```

[http://maps.google.com/](http://maps.google.com/)  
Once you open the above url, then you right-click on the right-side image(which is a geographical map). You can view a Pop-up with some of the items\*\*(viz.,Directions from here, Directions to here, Zoom in, Zoom out & Center map here)\*\*

**Layer-3:**  
In the same way, in my application ,I want to display few hyperlinks on this pop-up. So, I had created **TextFields** on the stage(which are **hyperlinks** ) using **“Text Tool from ToolsBox”** in Layer3 named as **“TextFields”**. I am accessing these TextFields using  
**\<TextField-instance\>.htmlText** to make it a hyperlink.

```
    **So, here my problem is: After loading of the jpeg image, When I try to click on the image, the Pop-up(MovieClip) and "Submit" button appears to be under the loaded image and the TextFields are visible over the loaded image.Hence textfields/hyperlinks visibility works fine i.e., on the loaded image as hyperlinks.**

    Now, What I should do in order to make the MovieClip(Pop-up) and "Submit" button visible on the loaded image?

```

Please can anyone help me in this context…

Thanks in advance…

Srihari.Ch
