how can i make a movie clip the same width and height of the stage using actionscript, when the width of the movie isnt known?
[AS]myMovieClip._width = Stage.width;
myMovieClip._height = Stage.height;[/AS]
doesnt work. when i do that, the movie clip doesnt even show up.
It works… :sigh:
Can you post your code?
holder.loadMovie(“jayza8.jpg”);
holder._width = Stage.width;
holder._height = Stage.height;
there is one movie clip named image, with an instance name of holder. im just loading an image into and trying to make it bigger.
When you load the SWF/JPG into the MovieClip, all (almost, actually) the properties of the MovieClip are set to their default values.
Either wait until the SWF/JPG has been fully loaded to set the values or you could use the code I posted in this thread: http://www.kirupaforum.com/forums/showthread.php?s=&threadid=27009
ohh ok. thanks. im not that experienced with actionscript… so this is kinda confusing to me, but ill give it a shot
No problem and good luck! =)
well i tried the code that was on that page, and it still doesnt show up when i try to change the height of it.
haha - I wasn’t sure if it would work for the _height/_width properties.
Preload the JPG then…
[AS]holder.loadMovie(“jayza8.jpg”);
this.createEmptyMovieClip(“holderPreloader”, 9876);
holderPreloader.onEnterFrame = function() {
if (holder.getBytesLoaded()>0 && holder.getBytesLoaded() == holder.getBytesTotal()) {
holder._width = Stage.width;
holder._height = Stage.height;
this.removeMovieClip();
}
};[/AS]
k, ill try it
youre awesome! it worked! thank you so much!
You’re welcome.
By the way, next time try to search the forum first, you’d have found the answer.