Communicate Between Loaded And Parent Swf?
Mar 8, 2009
I started learning the basics of as3.0 a year ago by doing a lot of experiments.. I never read a book or took lessons or something.. I guess i'm still missing important logics when i'm programming. I'm creating my personal flash imagegallery but I can't figure out how to communicate between a loaded swf and its parent swf.
I have a main.swf file with document class main.as which loads external swf files into a movie container. I am also loading a background sound like[code]...
The only work around I was thinking about would be to keep showing the stop/start sound button from the main.swf when a slideshow instance is called.. but then I'll screw up my design I want a second button inside the slideshow that can also stop the main bg sound.
View 1 Replies
Similar Posts:
Nov 6, 2004
How do I get a targeted mc to communicate with the parent timeline? I'm not using levels but targeted mc.
I need the playback head to go from the targeted movie clip (this is called nested, correct?) to the parent timeline and stop at a particular movie instance or frame label. I have been unsucessfully using this:
gotoAndPlay(_parent.instancename);
View 5 Replies
Aug 2, 2008
i got communication working going to the Loader() swf, but how do i have the swf thats loaded in via the Loader object talk to the parent swf?
View 9 Replies
Feb 14, 2011
I've made a big pretty website. So big and so pretty that it takes more than two minutes to load. I figured I could make it smaller by breaking it up into separate swfs and loading them into a holder as required, but I have no idea how to make them talk to eachother. I'll give a basic example.So, i've loaded up my movie into the holder movie with:loadMovie("page1.swf","page1MC");and in page1.swf there is a button called "page1_buttonA". In the old giant overweight site, onRelease it did a gotoAndPlay, but now I would like it to load the next part excitingly named page2.swf. For my own sanity's sake I'd like to keep the most of the code controlling all the to-ing and fro-ing in the holder movie. So, what's the format (syntax?) for getting the holder movie to notice what happens in the child movie and getting it to react accordingly?
//button that loads page 2
page1MC.page1_buttonA.onRelease = function() {
_root.createEmptyMovieClip("page2MC",2);
[code]....
View 2 Replies
Aug 29, 2009
Within ninja.swf, there are six scenes, and in the later 5 scenes, there is an movie clip (consule2)with has a halfdozen buttons (of which one is home_btn) that serve as the navigation across the site. So, in the consule2, I set up an Actions layer, and for Home_btn, have created this piece of code:
//Home Buttonfunction gotodsHome(event:MouseEvent):void{ MovieClip(root).gotoAndPlay("FullLoaded","01_Landing_Page");}Home_btn.addEventListener(MouseEvent.CLICK, gotodsHome);
[code]......
View 5 Replies
Nov 6, 2004
How do I get a targeted mc to communicate with the parent timeline? I'm not using levels but targeted mc.
I need the playback head to go from the targeted movie clip (this is called nested, correct?) to the parent timeline and stop at a particular movie instance or frame label. I have been unsucessfully using this:
gotoAndPlay(_parent.instancename);
View 5 Replies
Dec 23, 2010
I have a external swfs that I am using as skins for a app launcher. They are loaded in to the main movie via xml and loadMovie.How can I pass intervals and as commands to my skins. I need to send things like:button command for closing projectorvar clockValue for clock text fields in the skinxml menu info to nested movieclip in skin.swfI was thinking shared libraries, but I want to load the skin.swf dynamically with my xml, and I want the skin to maintain its structure so the ui style can be completely changed, instead of just placing mc's in the same place each time with only a slightly different theme
View 8 Replies
Aug 3, 2006
I have a site I am building in AS3. I have a main SWF, site.swf, that loads the subsections as seperate SWF's only when a user clicks on them (to save on initial load time).or my subsections, I need to be able to communicate with the SWF that loaded it. In AS2, this was simple enough - just say something like_parent._parent.gotoAndPlay("something"), and step up enough levels to speak to movie clips in the main SWF.Trying to do this in AS3, however, results in errors such as this when trying to compile my subsection SWF:Code:TypeError: Error #1009: Cannot access a property or method of a null object reference.... because it thinks I am trying to communicate with something that doesn't exist. The result is that I can't compile my subsection SWF's.For example, I am unable to reference a variable in the main SWF using this code in my subsection SWF:
View 8 Replies
Mar 5, 2010
I am building a highscore system for my site, and I was wondering how to communicate with classes that are included in an external swf that i've loaded in.
Basically, how does mindjolt do this:
[Code]....
View 1 Replies
Jun 25, 2010
I am comming from AS2, obviously. I have looked at many of the post people have to get "something" to be avaialble on a root type method, but I haven't found anything that has worked for this yetFor those who are saying "you're missing the point", and the rest of the "this is a bad idea" or "not needed" comments would you mind detailing the process of making a variable avaiable from a subMovie to a mainMovie and from mainMovie back to subMovie; or changing the property to an object inside of a SWF that has been added to a movie using addChild()?These are the constraints I have to work within. I can't restructure the 100-150 some odd pieces that are already in existance using AS3. New funtionality is needed that requires communication between the two movies.
View 6 Replies
Jan 14, 2009
This has quite a long background history, so I`ll first ask the question: how can I make a loaded SWF file activate a function inside another loaded SWF file - both in the same 'parent' movie, domain and directory - when the user clicks a 'link' on the first swf?I'm new to actionscript, been only working with it for 2 months and I've been learning on the go. So far, so good, flash cs3 help has been useful, as well as this forum and other sites. My project is a website, no innovations, just simple info and light animations.The site should have an intro page (I called it index), a preloader, then the actual site (home), with links to each specific area (pages). In home, a small slideshow movie clip should always be on the upper left corner looping images until the user clicks a link to a page, when the slideshow fades away. With this briefing, I made a file for the index, and a uiloader in it would get the home file and that 'should' be it.My stage resizing event listener was working perfectly on home - standing alone - moving the slideshow exactly as it should. But when home was loaded inside index, the slideshow moved way more than it should never getting in the right place. After various unsuccessful attempts, I decided to move the slideshow into its own swf and load it directly in the index, together with the home file. This way, I managed to make it relocate precisely, but got myself the problem I'm asking here. I need to get the slideshow to fade away when the user clicks a page link, but they are separate files.
I tried to use a Loader.content based function, located at the index, but figures Flash help was not exactly clear on how I had to use it properly, so I did not manage to get it to work. It always reported an unspecified property. I searched around here and over the net, found similar problems and their solutions but could not resolve my problem. I think this is a little too specific..
View 1 Replies
Mar 6, 2011
I have an app with a setup page that requires the user to select a scenario for a quiz. Their choice determines the content that's loaded next.
With as2 I would have used a global variable to indicate the users choice but of course that's not longer an option, and I don't think I can send an event because the next page isn't loaded yet.
So how do I communicate with a class belonging to a dynamically loaded swf that isn't loaded yet?
View 1 Replies
Apr 6, 2011
I have a heck of time here with an issue. I have an xml document that when a certain button on the stage is clicked it loads it's corresponding external swf into an empty movieclip on the stage. This empty movie clip is a holder for all external swfs.So what I'm trying to do is when an external swf is loaded that has buttons on it, I need those buttons to communicate with the main timeline and remove a mc that is on the Stage. I need the currently loaded swf(s) to be able to do this.So whatever the currently loaded external swf is that's loaded, I need it to talk to the main timeline. (I have quite a few external swfs that need to do this) So I imagine I need to somehow target the currently loaded external swf to get it to talk to the main timeline.The code below in summary doesn't work but it doesn't give errors either. I don't pretend to know what I'm doing and I haven't been successful in searching for a solution to this particular issue.
// main timeline object
var index:Object=this;
function loadComplete (e:Event) {
[code].....
View 3 Replies
Sep 23, 2010
I have a shell swf that is loading a swf. How do you have the loaded swf tell the parent loader to unload itself after the loaded swf finishes playing?
View 4 Replies
Jun 14, 2011
Im working on a project that has a main swf file associated with the document class. It loads XML that provides the text content for the project, then it loads a swf that contains a font in its library, then it loads the first of several content module swfs. When the font swf has inited, I'm registering its library font with Font.registerFont(), and using it in a TextFormat object. After everything is done, I can add code to the document class to create a text field on the stage of the main swf and format it successfully with the TextFormat object, but when I try to do the same thing inside the loaded content module swf, the text doesn't show up there at all.
View 1 Replies
Jun 15, 2011
I'm working on a project that has a main swf file associated with the document class. It loads XML that provides the text content for the project, then it loads a swf that contains a font in its library, then it loads the first of several content module swfs. When the font swf has inited, I'm registering its library font with Font.registerFont(), and using it in a TextFormat object. After everything is done, I can add code to the document class to create a text field on the stage of the main swf and format it successfully with the TextFormat object, but when I try to do the same thing inside the loaded content module swf, the text doesn't show up there at all.
View 7 Replies
Apr 20, 2009
I have a child class that is loaded into the parent class when the swf begins, like so: var myvar = 'hello'; public function Parent() { this.child = new Child(); }; How can I retrieve the variable 'myvar' from within child?
View 1 Replies
Oct 14, 2011
I have a parent swf with three buttons: next button, back button, ticker on/off button.I have three child swfs, each with a ticker mc. When I click on ticker button on parent swfit dispatches a custom event which brings ticker MC on stage and thus ticker becomes visible (ticker off button displaces it out of stage by changing the value of ticker_mc.y).
the problem I am facing is when ticker is on and I click next or back button to load next or previous child swf, the ticker goes off. How can I make sure that ticker is on all the time and closes only when I close it. How can a loaded child swf 1 communicate to next child swf, child swf 2, which is currently not loaded, that since the ticker is on on swf 1 so you please keep the ticker on on swf 2 as well?!
I think I know the problem. I have put a default value of ticker_mc = 160 (makes ticker inactive) on every child swf. So, the ticker becomes inactive everytime I load a new child swf. If someone could guide how can I do this, my problem will be solved: When first child swf is loaded, the default value of ticker_mc.y should be 160. I want to hold this value in a variable. When I click ticker active btn, position of ticker_mc changes to 194 so the value of variable should change to 194. When I click next btn, the variable value (160 or 194) should be sent to next child swf and ticker_mc.y should be equal to variable value.
This is the code so far
"Next button"
go_mc.next_btn.addEventListener(MouseEvent.CLICK, playNext);
function playNext(e:MouseEvent):void {
if (swf_no < (clips.length-1)) {
[code]....
View 1 Replies
Jul 27, 2010
I have a external swf loaded into a parent swf. It loads fine and plays. I have an EventListener in the external swf, I would like to have trigger a function in the parent swf. Is there a way to do this in AS 3.0?
View 2 Replies
Jun 8, 2010
Well, I know how to access the loaded swf variables from its parent, but how do I access the parent SWF variables from a loaded SWF?! I'm trying it.. But get no results.
View 6 Replies
Feb 5, 2010
[code]All clips are squared.Ok, on the PlayerPlane, there are little soldiers, which have hotkeys. The effect I'm trying to create is I want to position the GameStage so that the currently selected soldier appears in the center of the GameClicker clip.The GameStage is movable by the player (to scan other areas of the map)by holding the CTRL key, so it's easy to kinda lose track of where your players are.I have tried using localTo Global and globalToLocal techniques, but I think I'm lost on the actual math of getting the GameStage to move the correct distance so that the selected soldier is centered to the GameClicker.[code]
View 2 Replies
Feb 13, 2010
I have an elearning course, a .swf, that loads multiple .swfs as the user progresses through the course. At the end, there is a quiz.
The quiz.swf uses the radiobutton component. I have developed some custom skins to use on the radiobutton component. I have figured out that:
I have to add an instance of a radiobutton in the main .swf for the radiobuttons in the quiz .swf to show.I have to copy the radiobutton intance from the quiz swf library to the main swf library if I want my custom skins to show in the quiz swf While, this works fine. It is not practical. I want the quiz.swf to more modular. So I can pop it in to any course and not have to go back in and add the radiobutton skins to each course.
View 2 Replies
Jun 25, 2009
I want to load an external swf movie into the parent one using for example the UILoader component and I want it to have access only to one object of the parent (the main swf movie). I tried sth like my_uiloader.content.parent = null, but obviously it doesn't work as the parent property is read-only.
View 15 Replies
Jul 9, 2009
is it possible to load a .swf and play it in such a way, that this loaded clip will become a root effectively substituting a loading clip on top of the hierarchy?
Saying this another way round - rather than loading external .swf as a child of a "host" movie I would like it to replace host movie entirely.
View 4 Replies
Aug 25, 2009
I have a swf that loads an external swf. I want the external swf, (the one that was just loaded), to interact with the timeline of the swf that just loaded it. I've been trying MovieClip(root). or MovieClip(parent). but they give me errors. How should I use as3 in the external swf so that it interacts correctly with the parent?
View 3 Replies
Jan 22, 2010
I have a child SWF file that has the Camera functionality. It works fine if I run the child SWF by itself.
However, when I load the child SWF into a parent SWF, the Camera functionality does not work. Doing some tracing it says that Camera access is denied. That happens without me even clicking on the deny button and in fact the usual security popup does not even show up.
[Code]...
View 1 Replies
Jul 17, 2009
Making the move from AS2 to AS3 and need a little assistance/guidance.
In AS2 I have been using the below to send instructions to parent[code]...
View 2 Replies
Jun 29, 2010
I'm trying to reach main movie from loaded swf.I load the swf using this:
ActionScript Code:
var roomloader:MovieClipLoader = new MovieClipLoader();
var roomloadHandler:Object = new Object();
roomloader.addListener(roomloadHandler);[code]...
I tryed _parent and _global. But nothing works.
View 1 Replies
Sep 23, 2010
I have a shell swf that is loading a swf. How do you have the loaded swf tell the parent loader to unload itself after the loaded swf finishes playing?
View 3 Replies
Jan 21, 2009
syntax for calling a function (and sending arguments) located in an external SWF from a parent SWF?
View 2 Replies