|
-
Set max width/heigth for dynamicly called MC
How do i set the maximum width and height of a dynamicly created MC.
It is a mc holding an loaded image.
This is what i got sofar:
Code:
createEmptyMovieClip("imagecontainermedium", getNextHighestDepth());
// set the alpha to not see the picture loading...
imagecontainermedium._alpha = 0;
imagecontainermedium.loadMovie("photo/images/1.jpg");
onEnterFrame = function(){
if(imagecontainermedium.getBytesLoaded() >= imagecontainermedium.getBytesTotal() && imagecontainermedium.getBytesLoaded() > 0){
imagecontainermedium._x = 320 - imagecontainermedium._width/2;
imagecontainermedium._y = 67 - imagecontainermedium._height/2;
delete onEnterFrame;
imagecontainermedium._alpha = 100;
}
};
Can someone help me with this.
-
I think you can use this>
if (yourMc._xscale >= x){}
if (yourMc._yscale >= x){}
-
Code:
if (imagecontainermedium._xscale >= 317)
{imagecontainermedium,_width=316}
if (imagecontainermedium._yscale >= 317)
{imagecontainermedium._height=316}
Like this?
-
yes 
(in second line you wrote , insted of . )
-
I couldn't get it to work.
Do i use it like this (Sorry, my syntax sucks):
Code:
createEmptyMovieClip("imagecontainermedium", getNextHighestDepth());
// set the alpha to not see the picture loading...
imagecontainermedium._alpha = 0;
imagecontainermedium.loadMovie("photo/images/1.jpg");
if (imagecontainermedium._xscale >= 317)
{imagecontainermedium._width=316}
if (imagecontainermedium._yscale >= 317)
{imagecontainermedium._height=316};
onEnterFrame = function(){
if(imagecontainermedium.getBytesLoaded() >= imagecontainermedium.getBytesTotal() && imagecontainermedium.getBytesLoaded() > 0){
imagecontainermedium._x = 320 - imagecontainermedium._width/2;
imagecontainermedium._y = 67 - imagecontainermedium._height/2;
delete onEnterFrame;
imagecontainermedium._alpha = 100;
}
};
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
|