Groups | Blog | Home
all groups > flash (macromedia) > june 2004 >

flash (macromedia) : undifined - why?


Pluda
6/10/2004 11:52:05 PM
Hello there!

I realy need help whith this thing...

I'm doing my own email/contacts manager software, but I can't display inside
one movieclip the details of my contacts...

I'm generating the first name of each person whith the loadvars object,
loading data from a MySql database using this:

tgt=this;
lv = new LoadVars();
lv.load("Phps_Txts/listar_A.php");
lv.onLoad = function(){
str1 = unescape(lv.vars);
str2 = str1.split("+").join(" ");
arr = str2.split("\n");
arr.pop();
for(var iv=0; iv!=arr.length; iv++){
tgt.createTextField("txt"+iv,iv,0,64+(25.5*iv),250,18);
//tgt["txt"+iv].text = arr[iv];
tgt["txt"+iv].html = true;

tgt["txt"+iv].htmlText += ""+arr[iv]+""+'<img src="botao.swf" vspace ="-12"
hspace="0" id="botao+iv">'+"</a>";

tgt["txt"+iv].embedFonts = true;
tgt["txt"+iv].border = true;
tgt["txt"+iv].borderColor = 0xBAB9B8;
tgt["txt"+iv].leftMargin = "2";
tgt["txt"+iv].rightMargin = "2";
tgt["txt"+iv].setTextFormat(f1);
}
}

This is working fine, but now I need to be able to click on one name and make
flash pass that name again to Php so he can ask the database for the complet
information of my contact.

That's the problem. - I get always an undifined error.

I'm doing like this (this code is in the external button I used in the img src
tag):

on(press) {

_root.Detalhes._visible = true;
_root.Detalhes._x = 184,1;
_root.Detalhes._y = 45,8;

Nome = _parent.arr[iv];
trace(_parent.arr[iv]);

... and some more code.

Why isn't Flash passing the Nome variable to the button? He was "embebed"
using the img src, so I presume he should share the variables from the main
swf, shouldn't he?

Please help, I've spended hours and hours whith this and can't find a solution.

Many thanks :-)

Pluda
6/11/2004 10:48:44 AM
anyone, please...

Thanks

Pluda
6/11/2004 10:49:12 AM
anyone, please...

Thanks

Shawn Hughes
6/12/2004 4:27:28 PM
Just a quick answer off the cuff as I'm dashing out just now:

Try making the variable a _global variable and see if it passes to the MC
correctly then.

I can't provide much more direction than that; I'm rather a novice at AS,
but I tend to use _global variables most of the time so I'm absolutely sure
the variable is available on all the timelines.

Shawn Hughes

[quoted text, click to view]

AddThis Social Bookmark Button