Groups | Blog | Home
all groups > flash data integration > march 2006 >

flash data integration : impossible to use Set in a onLoad function with flash 8


vorpal
3/6/2006 5:19:30 PM
One could explain why this script works well with flash MX but not with Flash 8?
Thre trace command give me "bague" as expected with flash MX but "undefined"
with Flash 8 !!?

=====================================
tout= new LoadVars();


tout.onLoad = function () {
for (i in tout){ set(i,tout); }

trace (produit);
}

tout.load("vars.txt");
=====================================
vars.txt contains : produit="bague"&produit2="bracelet"
:confused;
Motion Maker
3/6/2006 11:45:35 PM
Running your script I get using Flash 8 publishing to Flash 8 format with AS
2.0

produit2=%22bracelet%22&produit=%22bague%22&onLoad=%5Btype%20Function%5D

with your script but not undefined unless I place the trace before the loop.


However why not just use the variables without the loop as follows:

trace(tout.produit);
trace(tout.produit2);



--
Lon Hosford
www.lonhosford.com
May many happy bits flow your way!
[quoted text, click to view]
One could explain why this script works well with flash MX but not with
Flash 8?
Thre trace command give me "bague" as expected with flash MX but
"undefined"
with Flash 8 !!?

=====================================
tout= new LoadVars();


tout.onLoad = function () {
for (i in tout){ set(i,tout); }

trace (produit);
}

tout.load("vars.txt");
=====================================
vars.txt contains : produit="bague"&produit2="bracelet"
:confused;

vorpal
3/7/2006 12:00:00 AM
However why not just use the variables without the loop as follows:

trace(tout.produit);
trace(tout.produit2);

cause this script was only a limited example of what I intend to do (wich
should be more complex).
AddThis Social Bookmark Button