ActionScript 3.0 :: Pass Vars From External Swf (as Child) To Parent ?
May 4, 2009
My problem is i had 2 swfs parent.swf and child .swf and i loaded the child.swf file in parent.swf using Loader class there is a textbox and a button in child.swf when we enter text in the textbox(say,notepanel_txt) and click on the button(say, mySubmit) the text present in textbox(notepanel_txt.text) is saved in the database using URLLoader and an variable called success(which is String type) must be available to parent. the code is as follows:
parent.fla
----------------
--------------blah... blah...
[code].....
View 4 Replies
Similar Posts:
May 4, 2009
I am new to flash."I am unable to access the variables of child swf in parent swf after an action(button is clicked) is performed in child swf".
My problem is i had 2 swfs parent.swf and child .swf and i loaded the child.swf file in parent.swf using Loader class there is a textbox and a button in child.swf when we enter text in the textbox(say,notepanel_txt) and click on the button(say, mySubmit) the text present in textbox(notepanel_txt.text) is saved in the database using URLLoader and an variable called success(which is String type) must be available to parent. the code is as follows[code]...
View 8 Replies
Aug 10, 2010
I cant access to var in parent movie from class in child.I have two swf's: parent.swf and child.swf. In parent.swf in frame 6 is:
Code:
stop();
var TestVar:String = "hello!";[code]....
I was trying use parent, parent.parent, parent.parent.parent etc. and any result - null object error.
View 2 Replies
Jul 15, 2009
In Move1.swf I am loading Movie2.swf like below:
ActionScript Code:
var myvalue:Number = 0;
var UploadLoad:Loader = new Loader();
UploadLoad.load(new URLRequest("Movie2.swf"));
UploadLoad.contentLoaderInfo.addEventListener(Event.COMPLETE, endNavListener);
function endNavListener(e:Event):void {
var UploadForm=MovieClip(UploadLoad.content);
stage.addChild(UploadForm);
UploadForm.x=0;
UploadForm.y=0;}
But I am having one variable in Movie1.swf which is called myvalue, I want to assign some value for myvalue from Movie2.swf. So I have coded like
ActionScript Code:
MovieClip(parent).myvalue = 100;
But the value is not passing ....
View 6 Replies
Mar 9, 2011
I am developing an air application where I have to drop an image and save the Image path, width, height to variables and pass those variables to external swf. I load the swf like this:
var myLoader:SWFLoader = new SWFLoader();
var url:URLRequest = new URLRequest("myExternalMovie.swf");
myLoader.load(url);
I am getting this error: the way I am passing the URL of the swf is incorrect and not supported in AIR.
View 1 Replies
Nov 11, 2009
I have a parent swf which loads many child swfs (though only one is displayed at a time). My intention was to use the loaded SWFs document class to retrieve an array of objects to be assigned a tab index, combine this with the parent's own array of objects and apply sequential tab indices to them all. But what happens is actually that the parent's objects are assigned an index, but the external swf is unaffected. In fact, the external swf retains its automatic tab indexing, when I would expect that having set a value for InteractiveObject.tabIndex, automatic tab indexing would be disabled.
I've seen similar tales elsewhere. Most posts I've read are wanting to load an external swf, give it focus and loop through those objects, then close the swf and return to looping through the parent. However I would like loop through all objects as one. including manipulating the focus manager(s), and basically fiddling with every tab-related property I know.
View 2 Replies
Sep 8, 2009
I have made a piece of flash that runs on an xml document and now I need to pass a flash variable (via the html swfobject) to the flash to dictate this xml location. The variable is successfully passed if I embed the main swf straight into the swfobject.The problem is I am using a preloader swf to load the main swf onto the page and I can't seem to work out how to pass the variable (from swfobject) from the preloader to the main swf.
View 3 Replies
Jul 10, 2009
Is it possible to pass a variable from child to parent movieclips. I can pass it from parent to child but not the other way around. I have a main movie which loads a child movie:
loadMovieNum("slides.swf",1);
I want to pass variable from slides.swf to the main movie. Is this possible?
View 2 Replies
Jul 22, 2011
I have two swf, A.swf and B.swf: B.swf is a child of A.swf. Each swf has its DocumentClass. Now: I must pass 4 arrays from A.swf to the DocumentClass of B.swf. Which could be the best way? Is a listener in B.swf a good idea? I noticed there's the possibility to send data over the querystring but I would like to avoid this solution, if possible.
View 2 Replies
Nov 10, 2011
Have two swf, A.swf and B.swf: B.swf is a child of A.swf.i want to access the variable of a.swf in b.swf.Is it Possible?
View 9 Replies
Apr 29, 2010
Parent loads Child, and wants to pass text string to Child. How can Parent pass a string
to Child swf?
PARENT.SWF
//LOAD CHILD 'has a symbol on stage called LDR that CHILD loads into'
var loadCHILD:Loader = new Loader();
LDR.addChild(loadCHILD);
var bgURLTxt:URLRequest = new URLRequest("CHILD.swf");
[Code] .....
CHILD.SWF
'has DynamicTextfield called txtBuddy'
View 1 Replies
Jun 19, 2009
I'm passing a number in my HTML through FlashVars to a swf, I load an external swf into that parent swf which needs the variable that I passed.
I can use the variable passed in the parent, but I just can't understand how to attain that value in the child swf.
I've been looking into dispatch event but it seems way overkill. Haven't seen any examples dealing with something so simple.
View 4 Replies
Jul 29, 2011
I got a Parent Sprite, let's name it SpriteP, which holds inside it two other Sprites. Sprite1 and Sprite2.[code]Sprite2 is a rectangle. When I rotate it, of course, the height of its parent, SpriteP, GROWS. But I would expect that height to go back to what it should be when I'm removing Sprite2!And it does! If I remove Sprite2 while NOT being rotated, the height of the parent drops back to normal, 200.
View 10 Replies
Jun 6, 2011
i am slightly confused about the parent and child relationship. lets assume we have several different instances, what would be difference of adding them all as children of the stage and creating a parent-child hierarchy between them(other than the access path).
View 5 Replies
Jul 29, 2011
I got a Parent Sprite, let's name it SpriteP, which holds inside it two other Sprites. Sprite1 and Sprite2.
When Sprite2 is NOT rotated:
Code:
trace(SpriteP.width + ' ' + SpriteP.height); //100 250.
SpriteP.removeChild(Sprite2)
trace(SpriteP.width + ' ' + SpriteP.height); //100 200. -> works, 200 is good.
When Sprite2 is rotated at 90:
[Code].....
And it does! If I remove Sprite2 while NOT being rotated, the height of the parent drops back to normal, 200. But if I rotate Sprite2, the Parent won't update its bounds.
View 1 Replies
Jun 19, 2011
If you haven't met me yet, that's because I'm pretty new around here. I picked up ActionScript just earlier this week, actually. Name's Kate. Nice to meet you. All righty. I'll start by saying that I've been referencing this thread:
actionscript.org/forums/showthread.php3?t=222486
(I'm not allowed to post URLs until I've got at least 50 posts in?! Gasp.)
View 2 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
Mar 11, 2010
I've seen some discussion on how to load a child swf using swfLoader and accessing it's variables but I am wondering if it is possible to do this without adding any code to the child swf.Either accessing public vars or listening for funciton calls would work fine
View 2 Replies
Apr 29, 2011
I've got this interactive poem I've been working on for a class. I've basically finished each "episode" seperately. I made a parent document which essentially loads one of the ten child documents onto the respective key frame. Here's a sample of the code for the first key frame of the parent document:
stop();
import flash.net.URLRequest;
import flash.display.MovieClip;
import flash.events.Event;
stage.addEventListener(Event.ENTER_FRAME, LoadSWF2);
[Code]....
Well Two things are messed up about it, well my "ChildTimeline2" variable will off and on assosciate itslef not with the main time line of a child document, but of a nested symbol inside said child document. Even worse, the "gotoAndStop();" command I will give sometimes applies to Parent document... yaay! but often it will apply to the child document. The end result being this horrible looping moment where you are stuck in one child document for all time.
I wish I could attach the documents but they exceed the 300KB. how I can get Actionscript to listen fro the last frame of the maintimeline of the child document, or tell flash to gotoandStop for the parent document
View 4 Replies
Jan 3, 2010
I got a "preloader" that creates an movieclip and loads an SWF. Now in the loaded SWF i want a close button to go back to the "preloader". The preloader isn't an actuall preloader but some sort of mainclip.Now i tried this:removeChild(MovieClip(e.currentTarget).parent.pare nt.parent)But i get error:ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.at flash.display::DisplayObjectContainer/removeChild()at MethodInfo-6()
View 1 Replies
Sep 11, 2010
if I add a clip to the stage as a child and remove the parent and set the parent equal to null, does the child get collected and removed from memory? What if the child has an image loaded into it as its child?
In my application I'm loading a series of png images as overlays that can be tinted for customizing in this app. When I trace my memory, the basic app idles at 64,000 k. The exact second I load those overlay images it goes up to 205,000k. If I remove those clips and "clear" the stage I should go back down to 64,000 k if everything is removed and collected correctly, right? It's not, it's hanging at 215,000 k. Are my images being cached and that is the reason for the memory staying up? If so, how do I prevent that. Or upon removing the parent of the image how can I un-cache the image.
If a user switches between models and loads several different items then the application actually crashes the Flash environment because of too much memory usage. It also does the same to browsers.
View 29 Replies
Sep 29, 2011
trying to on mouse over set the parent of the moused over text field to the highest depth child of its parent i tried both of these: [code] private function
[Code]...
View 3 Replies
Nov 7, 2011
i want to pass the variable from parent to child .How Can i pass the Variable.Here i paste my code.
My Parent Class
public class PlayerStrobe_domaincheck extends Sprite
{
private var myService:NetConnection = new NetConnection();
private var _loader:Loader;
[Code]....
View 3 Replies
Aug 21, 2010
I have an issue where removechild won't infact remove a child. I think its something to do with my dropTarget.parent issues. The concept of the code is that you drag a source onto a destination. When you drop the source onto the destination you will get a text field that says "Hello" or "Goodbye". The objective i want to achive is that once i drop a source onto the destination, removechild will remove any previouse textfields added. This is proving difficult.
[Code].....
View 3 Replies
Aug 24, 2010
I am trying to make a calculator where a user can select from a list of items. If a user clicks say "ITEM1", it should add the item to a "CONTAINER_MC". The problem i have is all my data is set inside an array containing names and prices like the code below.
[Code]...
View 1 Replies
Oct 6, 2010
Here is a working script to drag drop a ball from the stage into another target mc:
ball.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
stage.addEventListener(MouseEvent.MOUSE_UP, dropIt);
function pickUp(event:MouseEvent):void{ [code]...
It works well but I'm new to AS3 and I am having difficulty amending this script to drag the ball out of a parent mc (instead of the stage) and onto another mc (the target mc). To explain: imagine a ball, a box, a tri, + more shapes all within a scrolling mc (initial parent), the user scrolls to select a shape, then drag-drops onto a target mc on the stage.The scrolling is no problem, but how would you amend the script above so that the ball can start inside a parent mc rather than on the stage itself?
View 2 Replies
Jun 1, 2009
How do i pass "POST" variables to a php file, using "as3"?(all the tuts i found on google are for as2)
View 4 Replies
Dec 4, 2009
I would like to pass over 50 items of variables from php to flash. Actually I want to pass array with foreach statement, looping through the array and assigning loop index to the variables and flash again accept the php values through looping. Is this possible? If passing values through foreach or loop statement is impossible, I would like to break a new line in tag. how can I break a new line in FlashVars tag?
View 4 Replies
Nov 13, 2009
I want to read in the objID into flash. [code]...
View 2 Replies
Jun 23, 2009
I've read a variety of pages that describe how to pass a variable into a flash movie (AS3, player = v9) from the html in which it is embedded. This page describes AS3 but neglects to mention what to do with the object and embed tags in the noscript section. Furthermore, I'm not sure the javascript I see generated in my page looks like the example there (the js in my page doesn't check AC_FL_RunContenta against zero)This page is quite long and appears to deal mostly with AS1 and AS2 approaches which I have used before and neglects entirely the newish javascript approach which appears to be used to embed flash these days (i.e., the javascript function AC_FL_RunContent).I was wondering if someone could spell out the proper way to pass in a variable from HTML so that flash can see it in such a way that works even if javascript is disabled, in all browsers, etc., etc.
View 2 Replies