Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing value down to imported swf

Status
Not open for further replies.

mickjbud

Programmer
Jun 13, 2002
48
GB
Hi all

How do I access and pass information down to an imported swf file. The imported swf file contains an embedded movie object which needs information from an xml file for it to load the images and settings, but how do I pass this down.

The route to the object is:

_root > object_instance > imported swf file > embedded movie_instance > variable.

I was thinking on the lines of:

_root.object_instance.imported_swf.swf.movie_instance.variable_name = value..

but this aint doing it.

I am not sure if this is the way to do it or even if it can be done.

I can run the imported swf stand alone with no problems so the XML import is ok as is everything else. It's just a matter of getting the information down to the right place.

Any help is appreciated.

Thanks

Regards

Mick



<a href="<a href="<a href="<a href="
 
What is "object_instance"? Is it a MovieClip you load "imported_swf.swf" into? And what is "movie_instance"? Is it a MovieClip in "imported_swf.swf"?

If so it would be:
[tt]object_instance.movie_instance.variable_name[/tt]

Kenneth Kawamoto
 
Thanks Kenneth and apologies but I am still trying to get the concept into my head so writing it down for someone else to understand is even more testing.

I will try to explain in more detail.

The main flash movie has a flash component(purchased component) on the stage. This component imports from the library or an external source either a jpg, a movie instance or an swf file(external), in this case an external swf file is imported into the component as and when needed. The imported swf file contains several layers of which one is a simple jpg and the other is another flash component(purchased component). This flash component reads information from an XML file to load images etc... into it.

The problem I was getting the XML information down to that level. I have now discovered(by logically thinking about it) that the imported swf file doesn't need the XML info passing down through the main flash movie, it is independent and can take the XML directly.

Having solved this problem I now had the problem of accessing a function in the imported swf component at it's root level. Initially I referenced the _root.function_call() which was looking at the main _root and not that of the imported flash component. I have since discovered the _lockroot function but I am still treading carefully here as I may come to a brick wall once again.

I hope this makes more sense to you than it does to me.

Flash is not my thing although I am eager to learn it. The two purchased components are written by independent companies and I am trying to suss out the inner workings of them so I can get them to work together(I am not rewriting their code just incorporating the components into a finished app).

Many thanks for your help it is most appreciated.

Regards

Mick

mymapofseychelles
eWOC
LookandBookIt
Rotography

 
Sounds like you can access the function from _root timeline:
[tt]aComponent.anotherComponent.function_call();[/tt]

If you "Debug Movie" from Flash IDE you can see the structure of your movie. This will help you to understand what's going on.

Kenneth Kawamoto
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top