Skip to main content
Srihari_Ch
Known Participant
February 18, 2009
Question

A small problem with dynamically loading of images

  • February 18, 2009
  • 2 replies
  • 543 views
Hi all,
I have a combo-box, which upon selection of specific item from combo-box, uploads an appropriate image onto the stage.
This image must be obtained on the stage dynamically(It is working iff these .jpeg files are placed in the same folder as that of .swf file), it is possible to get the images(.jpeg files) dynamically.

The problem is, I need to process Mouse_CLICK event on this dynamically obtained image(obtained after selection from Combo-box(runtime), which creates a circle(dot) at pixel-position I clicked. But, the dot appears and again disappears(instead of viewing) as soon as MouseEvent_Click event occured.

Srihari.Ch
This topic has been closed for replies.

2 replies

kglad
Community Expert
Community Expert
February 18, 2009
that will create a new circle with each click event and the dots won't disappear unless you have some other code causing them to disappear.

it just won't place them over the location where image1_mc is located (unless image1_mc is at 0,0).
Srihari_Ch
Known Participant
February 19, 2009
Hi kglad,
Actually, the code I sent works iff the MouseClick event occurs on the movie-clip (viz., image1_mc.)
but, here, when I am loading image (only a simple .jpeg file and not a MovieClip)onto the stage dynamically through code(instead of selection from menu: File->Import->Import to Stage...) how can e access the image to add event_listeners.
Here I require is to get the image onto the stage dynamically and convert it into MovieClip (thru AS3 code) dynamically(i.e., Not through F8->Convert to Symbol).

Srihari.Ch
Srihari_Ch
Known Participant
February 19, 2009
Hi kglad,

The code I sent is after converting the image into MovieClip. But, here I need is "How to convert the image(".jpeg file") into MovieClip after it is got/placed on the stage using AS3 code

Srihari.Ch
kglad
Community Expert
Community Expert
February 18, 2009
what code are you using to create the dot?
Srihari_Ch
Known Participant
February 18, 2009
Since, the image is to be converted into a MovieClip(let us assume it's instance name=image1_mc).
Then the code looks like: