views:

2900

answers:

2

Hi!

I have to dynamically send a flashvars value from <object>/<embed>, for example "<object name="flashvars" value="test=myxml.xml"> to my swf file.

And in my AS, I have this:

var xmlPath:String = _level0.test;
doc.load(xmlPath);

So, this way I want to read several xml files (at least it's my intention!). But nothing of what I do works...

I also tried

doc.load(_root.test)

but it didnt work too.

If I do:

doc.load("someXML.xml")

It works just fine!!

I'm trying to solve this for many many hours and still didn't find any solution!!

Thanks in advance!!!

A: 

I think the problem lies in your HTML markup:

For an <object> tag you need to use a param tag within it, e.g.

<object ...>
<param name="FlashVars" value="test=myxml.xml">
</object>

For an <embed> tag, its an attribute of the tag

<embed FlashVars="test=myxml.xml" ...>

Here's an Adobe TechNote on using FlashVars which might help you too.

Paul Dixon
Paul, my html is correct... :- It's not that... unfortunely...
AndreMiranda
A: 

Foudn the solution! Thanks! :-)

AndreMiranda
Why not post your solution to help others searching on the same topic?
Paul Dixon