How do I call variables of my external swf file from my index.swf timeline?
this is what I did:
createEmptyMovieClip(“container”,5);
loadMovie(“external.swf”);
_________.variable._visible = xxx;
What do I put in the blank?
How do I call variables of my external swf file from my index.swf timeline?
this is what I did:
createEmptyMovieClip(“container”,5);
loadMovie(“external.swf”);
_________.variable._visible = xxx;
What do I put in the blank?
hi,
that will depend on where the variable in the external movie is.
if it is in the main timeline:
container.variable._visible = false;
I suggest you read my understanding target paths
actually, my problem is a little more complicated than the question I asked
In the main timeline:
container.onEnterFrame = show;
function show() {
if (container[namesArray[0]]._alpha != 100) {
trace("entered");
container[namesArray[0]]._alpha +=5;
}
else {
container.onEnterFrame = null;
}
}
only the ‘trace(“entered”)’ is displayed but the alpha of ‘container[namesArray[0]]’ didn’t change
Do you have a solution for my problem?
try tracing the alpha to see what you get, instead of the entered:
trace(container[namesArray[0]]._alpha);
[/As]
you may not be able to assure that _alpha != 100. depending on what you're doing, you may use
_alpha<100
or
_alpha>100
with methods, instead of
container.onEnterFrame = null;
you may use:
delete container.onEnterFrame
or
delete this.onEnterFrame
I solved that part of my problem. I transfered the portion of my script to the next frame.
Now, my problem is that in this script:
if (xxxxxx) {
container._alpha += 5;
}
when traced, the output is has decimals on it. Why is that?
that’s got to do with the way flash handles numbers
that’s why I wrote that
you may try to use
Math.round()
Math.floor()
Math.ceil()
if you need to…
:: Copyright KIRUPA 2024 //--