Skip to main content
Participant
October 29, 2006
Question

createEmptyMovieClip problem

  • October 29, 2006
  • 2 replies
  • 291 views
Dear all,

I can not drag the movie clip when i write the following actionscript? What is the problem?


Ricky
This topic has been closed for replies.

2 replies

Inspiring
October 29, 2006
Next to kglad's truth this:

at first I found it confusing too, but in the script below the pic
movieClip is actually replaced by what's loaded. And thereby anything
attached to the loading clip (including your event handler).
It is not that pic is gonna contain the loaded image as a 'sub-clip'.

ricky1980 wrote:
> Dear all,
>
> I can not drag the movie clip when i write the following actionscript? What
> is the problem?
>
>
> Ricky
>
>
> this.createEmptyMovieClip("pic",this.getNextHighestDepth());
> pic.loadMovie("img/1.jpg");
> pic.onPress=function() {
> this.startDrag();
> }
>

--
----------
Manno Bult
manno@xs4all.nl
kglad
Community Expert
Community Expert
October 29, 2006
you must define mouse handlers AFTER loading is complete. ie, use preload code or the onLoadInit() of the moviecliploader class.

or load into a child movieclip of pic.