all groups > flash actionscript > february 2006 >
You're in the

flash actionscript

group:

Trouble with Loader and If statement


Trouble with Loader and If statement LSNsaltlamp
2/8/2006 10:20:51 PM
flash actionscript:
I am trying to have a mc (my background) change based on the size of picture
that's loaded into the loader. If the picture is less than 400 I want my
background to change from landscape to portrate (land2port) and if it's greater
than 400 i want it to change from portrate to landscape (port2land). I've been
playing with this script for a while and cannot get it to work.

on (complete) {
if (_parent.pic.width<400) {
_parent.pbg.gotoAndPlay("land2port");
}
if (_parent.pic.width>400) {
_parent.pbg.gotoAndPlay("port2land");
}
}

Re: Trouble with Loader and If statement LSNsaltlamp
2/8/2006 10:23:55 PM
I forgot to mention that when I load a portrate picture it works but when I load a landscape it does nothing.

Thanks

Re: Trouble with Loader and If statement LSNsaltlamp
2/9/2006 2:34:55 AM
Re: Trouble with Loader and If statement gravideo
2/9/2006 4:04:54 PM
Re: Trouble with Loader and If statement LSNsaltlamp
2/12/2006 4:31:53 AM
Re: Trouble with Loader and If statement gravideo
2/12/2006 3:21:35 PM
Other than my observation about the if statements, ther is too little code here
to give you much help.
What is _parent.pic? If it's already loaded as a movie clip, why do you need a
loader? I am assuming that you are talking about a loader component based on
the wording of your question?
As I say, not enough here to help you with.

gravideo
AddThis Social Bookmark Button