-
My code won't work.. and i don't know why..
Code:
onClipEvent(load)
{
if(_root.mySO.data.stored)
{
text = _root.mySo.data.tex;
} else {
_root.mySO.data.stored = true;
text = texmex;
}
}
onClipEvent(enterFrame)
{
_root.mySO.data.tex = text;
}
variables text and texmex is both in the MC that this code is in.
But this doesn't work!? is anything wrong? i just want text to be replaced with texmex if text hasn't been leaded before..
plz help me! =)
thx in advance
-
if(_root.mySO.data.stored) if what?
-
onClipEvent(load)
{
if(_root.mySO.data.stored)
{
text = _root.mySo.data.tex;//_root.texttitle.text = "...";
} else {
_root.mySO.data.stored = true;
text = texmex;// _root.texttitle.text = "texmex";
}
}
onClipEvent(enterFrame)
{
_root.mySO.data.tex = text;//"text";
}
i could be completely wrong i'm no guru but maybe.
-
what is the location of textmex and text variables? are they in the same MC? also note that (load) event is fired when the MC "first" appears on the stage...
dave toland.com
If you test if something is true you can ommit the == true. The code assosiated with the if statement will be run if the expression inside the parentesis is equal to true.
Code:
if(true)
{
//this always code block is always executed...
}
if(false)
{
//... whil this is never executed!
}
/mirandir
-
-
Both textboxes is inside the MC that holds this Code.
-
textmex is of type inputtext I presume. is text that too? or is it just a dynamic textfield?
anyways you can do it something like this:
change text from being a variable to be the instance name of the textfield.
then on your Mc put this code:
Code:
onClipEvent(load)
{
if(_root.mySO.data.stored)
{
text.text = _root.mySo.data.tex;
} else
{
_root.mySO.data.stored = true;
text.variable = texmex;
}
}
onClipEvent(enterFrame)
{
_root.mySO.data.tex = text.text;
}
changes are in bold.
/Mirandir
-
http://www.edsberg.nu/tmp/tmp/
check this out.. you can have a quicklook at the swf.. then download the FLA and tell what i have done wrong.. i'm not that good at flash but it this gave me a real brain-teaser..
Thx for you help!
-
I'm not sure if the fla I got is a "compressed" version. but I was missing the initiation of the shared object. If you did forget it put this code on the first frame of the .fla file:
Code:
var mySO = SharedObject.getLocal("text");
Also! My code erlier is not quite correct. The text.variable = texmex line is wrong!
textfield.variable wants the name of the variable as a string. So the statement should be:
Code:
text.variable = "texmex";
/Mirandir
-
it worked!!! thank you very much!!
[Edited by Bjurstrom on 07-03-2002 at 03:39 AM]
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
|