IDE :: Get Child Swf To Communicate With Main Swf?

Feb 2, 2009

how do I get my child swf to communicate with my main swf?

(this is main1.swf)
var homeRequest:URLRequest = new URLRequest("window1.swf");
var homeLoader:Loader = new Loader();

[Code]....

Obviously, MovieClip(root) is not getting to the main.swf's root timeline. What code do I need to do this?

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Communicate To A Child In Different Frames?

Jul 8, 2010

I have no clue on how to reference to different childs in a movieclip on different frames. Let me explain the situation:

I have a movieclip containing different views of a car distributed on frames. On these frames there are targets that must respond when clicked (the position of the targets vary from a frame to another) I can only reference to targets on the first frame.

ex: Movieclip.target1.addEventListener(MouseEvent.CLIC K, showPart)

how can I communicate to the targets on the other frames of my Movieclip ?

View 4 Replies

ActionScript 2.0 :: [CS3] Parent And Child Communicate?

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

Actionscript 3 :: How Can A Loaded Child Swf 1 Communicate To Next Child Swf, Child Swf 2, Which Is Currently Not Loaded

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

ActionScript 2.0 :: Communicate With Main Timeline From Attachmovie?

Sep 22, 2011

i am using attachmovie to load a movie clip from library into an empty movie clip. Everything works ok but now i have a problem... i am trying to create a button that is inside this movie clip that goes back to the main timeline on a certain frame and also unload that certain movie clip

I tried all sorts of things but none work...is there a solution to this? Cant a clip that is loaded with attachMovie communicate with main timeline?

View 1 Replies

ActionScript 3.0 :: Communicate A Variable From A Main Swf To An Loaded Swf?

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

ActionScript 3.0 :: Embedded Symbol Communicate With Main Timeline?

Jan 2, 2010

i am creating a survey with say 7 questions.  each question has the same MovieClip symbol each with a different instance name, like q1, q2, ... q7.

the MovieClip symbol has 5 static texts and 5 SimpleButtons.  i have some code in that symbol to make sure that only a single button has the "on" or "checked" state to show that that one is chosen. this works great.

my question is, how do i communicate each user choice with the main timeline after the user hits the "submit" button?  or, how do i have code under the "submit" mousedown event that can iterate through the 7 symbols to query each one and see which of the 5 SimpleButtons is "checked" or "on".  this iteration will then create a list of responses for all 7 questions.

ultimately, i will have flash concatenate a GET POST string that will send the survey results to a web server.

View 4 Replies

ActionScript 3.0 :: Add Event Listener From External Swf File So That It Can Communicate With Main Swf?

Jan 3, 2011

i have a mp3 playlist which loads externally into my main timeline into an empty container movie clip...When user clicks play button on playlist i want some animation to happen in my main swf... So if i add an Eventlistener on my play_btn... how will Flash understand that button was clicked?

View 1 Replies

ActionScript 3.0 :: Read Main Var From Child SWF?

Apr 8, 2011

i have main.swf with var car:String = "my car";then i addchild a new swf; child.swfinside child, how can i trace my "car" var?MovieClip(root).car give me Undefined

View 3 Replies

ActionScript 3.0 :: Remove A Child From The Main Movie?

Nov 30, 2009

Code on main movie.

Code:
function loadPhx(event:MouseEvent){
var ldr:Loader = new Loader();
var url:String = "websites/phx.swf";

[Code]....

This is the code im using to try to remove a child from the main movie.

The error i get is undefinded property ldr.

View 1 Replies

ActionScript 3.0 :: Add Child To Main Stage From Within A Method?

May 11, 2010

I just began learning AS3. I'm simply trying to play an FLV video. How do you attach the video object to the main stage? I tried but it said that "stage" was undefined.

PHP Code:
package {
import flash.media.*;

[code].....

View 1 Replies

ActionScript 3.0 :: Adding Child And Stopping Main Timeline?

Sep 3, 2010

So I am loading in external swfs and once loaded in I want to stop the main timeline. so I do the following.

var swf : MovieClip = e.target.content ;
swf.stop();

which doesn't work, because I have trace statements in the external swf which fire off after that command is called. Which, here is another weird thing, When I trace through the loaded swf, it says it has two children, a shape, and a Loader. The shape is weird because what I have is another movieclip on stage so I should get instaceXX, and I dont know where that Loader class is coming from.

which also brings me to another question which is everytime I add the swf to the stage it duplicates the instance, and I run out of memory really fast after I keep removing and re-adding it. all I call is.

targetMC.addChild(swf);

then after the swf dispatches an event saying its done.

targetMC.removeChild(swf);

View 1 Replies

ActionScript 3.0 :: Controlling Movieclip From Main Timeline & Child?

Sep 26, 2010

This code is currently contained within my "mc_1" movieclip. I want to be able to have this code on my main timeline, however no matter what I try I constantly get errors, multiple different versions. I've tried adding mc_1 infront of everything, but that just gives an output error about a Sprite.Also, I'm currently using visible to control whether the back image to the textbox should show - What I'd really like to do is control it using a child, but they're movieclips not buttons, so when I try to addChild within the function it errors saying I'm trying to control a movieclip within a simplebutton function.

import flash.events.MouseEvent;
stop();
mc_textbox.visible = false;

[code].....

View 12 Replies

Flex :: Adding MXML Component As Child Of Main App Using AS

Apr 26, 2010

How can I add an MXML component as a child of the main application using ActionScript. It's not possible to instatiate it, is it? Assuming that behind every mxml file stands an actionscrpt3 class, I tried to import it but id didn't show up.

View 1 Replies

Flash - Closing Child NativeWindows When Main App Gets Closed (via OS)?

Mar 14, 2012

I have been going crazy over this! I have an Air (2.6) app which, when running opens up a pop up NativeWindow, to handle alerts.

public var _alertWindow:NativeWindow;
_alertWindow = new NativeWindow(windowOptions);
_alertWindow.stage.scaleMode = StageScaleMode.NO_SCALE;
_alertWindow.stage.align = StageAlign.TOP_LEFT;

[code]....

I have had no problems with this across all platforms. But in Windows7, when right click on the taskbar and selecting 'close-window' only closes the main app and not its child NativeWindow. ( This keeps the app running in the background - so when a user tries to access it again it does't run ) I have tried adding event listeners like Event.CLOSING, and various other methods but have failed.how to close windows from the 'close window' option in windows7.

View 1 Replies

ActionScript 3.0 :: Access Child Swf Function In Main Flash?

Sep 5, 2010

I have a very serious issue and need to be fix ASAP. Kindly check [url]... it is a flash based website, there on main flash file which have all the navigations (menu tab), when user click on any tab its load a external swf according to that tab, that swf has flv player which take videos dynamically, If user click on the trailers tab its load trailers.swf which have the player and the playlist when the user click on the video of the play list its player that video but the problem is that if the video is still in loading process and the user click on another tab so the main.swf load the swf according to that tab but the audio of the previous video is running...

thats i m trying to make a function in the child.swf(trailers.swf) which will pause the video so i will call that function the other tabs, so if the trailers.swf is loading and user click on comedy so that function will pause the video of trailers.swf and play the comedy.swf, So kindly tell me how i will access the function of [url]...

View 5 Replies

ActionScript 3.0 :: Overlapping Classes In Main Swf And Child Swfs

Dec 20, 2011

I have a project which has a main swf file that is compiled with a bunch of classes. The main swf also loads in other child swf objects, created in the flash IDE, that happen to reference some of the same classes.

It seems redundant to have the child swfs include the main swfs classes, especially if I update the classes which means I have to recompile all the child swfs, not just the main swf.

Im using FlashDevelop 4.0 RC3 with Flex 4.6/AIR 3.1 to code the main swf, and the child swfs are flas made in CS5.

I was thinking of using SWC's, but I'm not sure how to incorporate that into FlashDevelops workflow. I tried the SWC export plugin but that doesnt seem to work very well, it attempts to export everything in the project and doesnt seem to offer me an option to be specific...

Surely there is a way to compile flas from the IDE and allow for classes to be used for compile type checking etc, but not actually include them in the compiled swf? I know with the flex command line compiler you can generate a link-report xml from the main swf then use that xml file to exlude classes from the compile of the child swfs, but I cant see how to do something like that when exporting swfs from the flash IDE.

View 7 Replies

ActionScript 3.0 :: Remove A Child From The Main Timeline From Within A Movieclip

Feb 3, 2010

Someone the other day provided me with this code to a remove a child from the main timeline from within a movieclip.

parent.removeChild(MovieClip(parent).mc1);

This works fine, but how can I write an if statement to test if its in the display list before removing it?

As I'm getting an error if I try to remove it once its already been removed.

View 4 Replies

ActionScript 3.0 :: Event Handler - From Child To Main Button

Feb 26, 2010

How do I get a button event handler to refer back to the main timeline from within it's movie clip inside another movie clip?

View 1 Replies

ActionScript 3.0 :: How To Access Instance Property Through Child In Main Class

Jan 23, 2011

I have make 3 classes objecthandler, box and nav. Nav is child class of objecthandler, I have make an instance of box into objecthandler and now I wanna access property of box through nav.
See the code:
Objecthandler class
package code{
import flash.display.MovieClip
import code.box
import code.nav
[Code] .....

View 1 Replies

ActionScript 3.0 :: Shutting Down Activities Of Loaded CHILD SWF In Main PARENT?

Jul 15, 2011

Scenario: in MAIN file, i have a door, when door is open, we can see activities behind the door - LOADED SWF - when the door is shut i would like all the activities behind the door - LOADED SWF to stop
 
Problem: my first attempt was to REMOVECHILD when the door closed, however, still functions in child=loaded file are continuing Possible Solutions i had in mind: I assumed if PARENT, dispatches an event and CHILD listens, i can say, if the door is closed, dispatch event to the child to stop functions. but it doesnt work, because i assume i dont know how to listen for an event dispatched from parent

[Code]... 
 
I am also open to any alternative solution that helps me shut off the activities when the door closes down, dispatching event was the first thought that came to my mind, not necessarily the only answer i m looking for.

View 1 Replies

ActionScript 3.0 :: Can't Access Variables That I Declare In Main Timeline From A Child

Sep 14, 2009

I can't access the variables that I declare in the main timeline from a child.

I attach the child to the stage during runtime.

View 3 Replies

ActionScript 3.0 :: Flash Call Metode In Main From Child Class

Oct 7, 2010

I have a child/ Background class there must call a metode in the main class.But this fail coms: BackGround.as, Line 35.1061: Call to a possibly undefined method resizeHandler through a reference with static type flash.displayisplayObjectContainer.[code]

View 3 Replies

Actionscript 3 :: Load An External Swf To Main Stage From Instanced Child Class?

Apr 15, 2010

I am trying to get an instance of a class to the load an external swf and show it.So far I have the following:

1) I wrote a class that uses the Loader class to load an external swf "loadExtSWF".
2) I have a fla named "MainSWF.fla" that uses a document class "MainSWF.as".
3) I have the MainSWF.as file that instances "loadExtSWF" and calls loadExtSWF.startLoad to load the swf.

This almost works. The instance of loadExtSWF loads the external swf, but the swf is not displayed.If I replace the fla's document class with loadExtSWF (this has an empty constructor) instead of MainSWF, and run loadExtSWF.startLoad, then the external swf is loaded and displayed.[code]

View 1 Replies

ActionScript 3.0 :: Using Child Navigation To Load AddChild Main Time Line

Jan 23, 2009

Using Child Navigation to load main time line.I am new to AS3 and have done pretty well but have been caught up this area.I have been loading swfs into a loader (imageLoader) which has been added to the stage using addChild. Then with buttons and functions I load other swfs into the same loader which replace each other. I now have an swf "testProject3a.swf" loaded into (imageLoader) which has icons for navigation and when each icon is clicked I need it to load another swf into (imageLoader) and replace it's self "testProject3a.swf" with "portalB.swf".I've tried adding removeChild code to the loaded swf but it removes the original (imageLoader) and the other buttons have nothing to load into.[code]

View 3 Replies

ActionScript 3.0 :: Load Frame In Main Scene From A Button In Child Movieclip?

Sep 11, 2010

I wanted to create a portfolio in flash, so I designed the layout in photoshop, with different webpages in different groups. So groups i created: home, about, porfolio, contact, affiliates, topbar, menu.I use Creative Suite 3 or CS3I then imported the groups into flash as movieclips, using the import to stage function. here is the image of the main scene in the flash. (SEE IMAGE 1st thumbnail)I created a new layer on top of all the layers and used labels at equal intervals to differentiate between pages.here's the image depicting the same.(SEE IMAGE 2nd thumbnail)Now in the home movie clip, i made all the text layers as movie clips to make button animations and assigned sounds and actions to them i.e. rollver, rollout andclick events. here's the swf.(PM ME FOR SWF)I want to know the code or method to load the frame labelled ''about'' in the main scene when i click on the movieclip button 'about' which is in the movieclip 'home'. Here's the code i tried for the first 'about' button, but it returns error "1120: Access of undefined property event."

code:
ActionScript Code:
var OverSound:roll_over = new roll_over();

[code].....

View 0 Replies

ActionScript 3.0 :: Multiple Buttons To Open Child Swfs Then Be Able To Close The Child From Within The Child?

Mar 25, 2009

I have a picture on the stage that has multiple items that have hotspots/links over them that should open a child swf on top of the background and show details about the items. then have a button in the child swf itself that removes the child from over the background so the user can click on another item etc.I found this code in someone's post and I am trying to modify it so that works for multiple swf files...it currently works for a single swf.I wan to pass the name of the button in front of the .swf in the URLRequest to have the same name as the instance name of the referring button. But I can't figure it out. Here is the code I am using on the stage

View 2 Replies

Professional :: Run Project (main Container SWF And Child SWFs) Into Another Container File Which Place On A Website?

Jun 17, 2010

I am facing a issue in Flash container. I am having a project which has main container which call different SWFs into it. Now I call this main container file into another container, and their problem starts. Many option doesn't work properly which generally have _root, _parent etc...
 
If I want to run project (main container SWF and child SWFs) into another container file which place on a website. I want to show whole project from this container file so what I need to do?

View 1 Replies

ActionScript 2.0 :: Share Child Swf's Library With Main File's Library?

Mar 22, 2011

In my child swf I am using the sound from library with "attachSound". I also use the play/pause button controls of this sound alongwith the other animation.Now when I load this into my main swf file with "loadMovie", It plays fine but no sound. I found that this is due to no sound linkage in my main file library.I want to share my child swf's library with main file's library.

View 3 Replies

ActionScript 3.0 :: Communicate To C/C++ Dll Or Lib?

May 25, 2010

We are developing a Flash application based on Windows CE 6.0 R3 and the application is intended to work with Adobe flash plug in available in WinCE R3 Internet Explorer. Application need to communicate with middleware libraries written in C/C++. Flash screens uses Action Script 3.0. We would like to know how a Flash application (Action script program) can communicate with a native (C/C++) dll/lib?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved