That’s because once the JPEG is loaded into the movie clip, most of its properties are set to their default value and event handlers are deleted. :-\
You could either 1) wait until the image has been fully loaded to define the event handler, or 2) create a child movie clip and load the image into it.
Thanks a lot kode for your exhaustive answer.
I user method #2 and it seems to work better indeed, yet I still have two problems :
1°) I have two layers : actions and preloader (preloader is not used yet), actions is the first one. The script you saw is executed in the actions layers.
But in order to have my movieclip shown, it seems I need to specify _root.createEmptyMovieClip(…) instead of this.createEmptyMovieClip(…).
2°) This problem is probably related to the first one : the onMouseDown event is triggered wherever I click on the movie. I tried to set the width and height of the created MC to minimum values but still.
I think it really shouldn’t make a difference… could you attach your FLA so I can check it out?
Use an [font=courier new]onPress[/font] or [font=courier new]onRelease[/font] event handler instead of the [font=courier new]onMouseDown[/font] handler?
Also, you’re modifying the [font=courier new]_width[/font] and [font=courier new]_height[/font] properties before the image has been loaded…
Originally posted by kode
*That’s because once the JPEG is loaded into the movie clip, most of its properties are set to their default value and event handlers are deleted. :-*
Erm yes indeed i’ll theck in the original fla
And for the fact that you can click anywhere and it triggers the onPress event of pmpPlay do you see where this comes from ?
You didn’t delete the [font=courier new]onMouseDown[/font] handler from the code, just use the code I posted in my previous reply and it should work fine.