-
Senior Member
Loading Problem
I have created a movieClip in the first frame of my movie and that movieClip loads an image. As I want different image to load in that particular movieClip, I have not mentioned the name of the jpg file for loadMovie. Rather I have used a variable called "imageName".
Then I created a button with property name "myButton" and I wrote the script to load a jpg file in that particular movieClip.
But it is not working.
I have only one frame in my movie and the situation is such that I cannot use more than one frame.
Here is the script that I am using.
_root.createEmptyMovieClip("imageClip",0)
_root.imageClip.loadMovie(imageName,this)
myButton.onRelease=function()
{
_global.imageName="image10.jpg";
}
Please help me with this
Smile is a small curve which can solve big problems
-
Senior Member
_root.createEmptyMovieClip("imageClip",0);
myButton.onRelease=function()
{
_global.imageName="image10.jpg";
_root.imageClip.loadMovie(imageName,this);
}
-
Senior Member
Thanks a lot for that. But that will not solve my problem. I don't want to create movieClip by clicking the button. The movieClip will remain on the state and when users click the button, the image will load.
Can you help me with this?
Smile is a small curve which can solve big problems
-
Senior Member
eh?
But the code I posted does not create movie clip by clicking on the button. See, the createEmptyMovieClip is not inside onRelease code. When button is clicked it sets imageName and loads the image.
Well, now that I look at the code, I think it should be like this (dont make new mc on level 0 and in loadMovie dont need "this"):
_root.createEmptyMovieClip("imageClip",1);
myButton.onRelease=function()
{
_global.imageName="image10.jpg";
_root.imageClip.loadMovie(imageName);
}
-
Senior Member
Oh sorry !!
I was in hurry! So I overlooked.
Thank you very much
Smile is a small curve which can solve big problems
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|