Answered
Can a loaded SWF call a function that lives in the parent?
I'm building a pretty simple Flash site in AS3. There is a
main movie (main.swf) that simply loads different swfs via buttons
on a main nav bar. The user clicks on a MC in "main.swf" and a
function is called, loadMyContent("section1.swf"), is called and it
animates in nicely. Other buttons use the same function, loading
section2.swf, section3.swf, etc.
I've defined how "loadMyContent()" works in the the main movie's document class file. It's all working fine when I just need to load content from a user action from the buttons that live in "main.swf". I want to call that same "loadContent" function from within "section1.swf" and have "main.swf" run it's "loadContent" fuction, but I can't seem to figure out how to make a child call a function that lives in the parent.
Is there any way of having my child do this?
I have a suspicion I may have to define that "loadContent" somewhere else, but I'm a little stumped now. I'm not really familiar with design patterns yet, although I want to get an understanding of them sometime soon. Can anyone offer some help with my immediate need or suggest a route to a solution? Thanks.
I've defined how "loadMyContent()" works in the the main movie's document class file. It's all working fine when I just need to load content from a user action from the buttons that live in "main.swf". I want to call that same "loadContent" function from within "section1.swf" and have "main.swf" run it's "loadContent" fuction, but I can't seem to figure out how to make a child call a function that lives in the parent.
Is there any way of having my child do this?
I have a suspicion I may have to define that "loadContent" somewhere else, but I'm a little stumped now. I'm not really familiar with design patterns yet, although I want to get an understanding of them sometime soon. Can anyone offer some help with my immediate need or suggest a route to a solution? Thanks.