I have a main .fla file that I am using to load a sequence of three games. If the user wins a game, they go on to the next game. Is it in any way possible to pass to the main project whether the user has won the game? I have tried using loader.content, but that does not seem to be working. I am using Flash CS3.
相关问题
- garbage collection best practices
- Should I wait for Flash Player 10.1 or go with Fla
- How to load flex swf from flash?
- Pass code to a method as an argument
- Can I parameterize labels and properties on CREATE
相关文章
- How can I convert a PHP function's parameter l
- Using UNREFERENCED_PARAMETER macro
- Is there a simple way to pass specific *named* Pow
- PowerShell Pass Named parameters to ArgumentList
- ocaml %identity function
- [removed] Which parameters are there for the onerr
- Are there any benefits when using final in AS3?
- Pass multi-word arguments to a bash function
You can pass data to and from loaded swfs no problem. What it sounds like you are trying to do is communicate from the loaded swf to the loading swf. The ideal way to do this is to dispatch an event on the loaded swf and listen for it in the loading swf. Roughly (not tested it because i'm in a rush) you need something like this. Load the swf. Have a load complete handler. Get the content of the loader and listen to a custom event. You can pass whatever you want on this custom event.
If you've never used custom events before check this link (or google for more)
http://www.adobe.com/devnet/flash/articles/creating_events.html
As a disclaimer thats the quick way to get the data into you main class. Personally i'm not a massive fan of passing data in events. I'd rather fire a empty event and the get data from properties of the firing object)... but that's just a personal preference.
You can use the
LocalConnection
class.