PDA

View Full Version : disable movie clip if nothing loaded



flavasociety
04-13-2007, 05:52 PM
Hey Guys,
Me again... i want to load a thumbnail into a movieclip dynamically.. which is easy however i dont want the movieclip square to be visible if there is no thumbnail to load.
so basically.. if there isnt "thumb1.jpg" in the folder then movieclip "square1" doesnt show up or is not visible in my flash movie.

is this a if statement thing?

Holler at me!!

Thanks

BLiZZaRD
04-13-2007, 06:23 PM
Make "square1" an empty MC.

insert new movie clip >> name it square1, check export for action script

You are now in edit mode for the MC. Click "scene1" to return to your main timeline. Drag the square1 MC from the library to the stage where you want it.

At this point, nothing is in the square1 MC, so nothing shows up. Use AS to load it with an image and the image appears where square1 is placed.

flavasociety
04-13-2007, 06:46 PM
Make "square1" an empty MC.

insert new movie clip >> name it square1, check export for action script

You are now in edit mode for the MC. Click "scene1" to return to your main timeline. Drag the square1 MC from the library to the stage where you want it.

At this point, nothing is in the square1 MC, so nothing shows up. Use AS to load it with an image and the image appears where square1 is placed.

Ahh i get that much .. i guess i failed to mention that i have a button action set on the movieclip so then when the images isnt loaded the movieclip is still clickable... so it looks kinda weird.. maybe there is a way to disable button action if there is nothing loaded kinda thing..

BLiZZaRD
04-13-2007, 07:31 PM
Oh sorry, misunderstood.



onClipEvent(load){
if(/*put your image loaded stuff here*/){
buttonSquare1.enabled = true;
}
else if (/*put your image is NOT loaded AS here */){
buttonSquare1.enabled = false;
}
}


should get you started. My context may be a little off, but the idea is there. :)