Passing Variable Value To Child Movieclip?
Oct 26, 2009
I have a movieclip that will load an external picture from a given path, it works fine if I hardcode the picture path. In the scene I added this moveclip at runtime, but now I have problem to pass in the a string path value to the movieclip so that in can load a correct picture.
View 2 Replies
Similar Posts:
Apr 7, 2011
I have a simple BOOK script where I have 10 pages (for example purposes). Each page has a vocabulary word on it. Currently, I simply created a vocabulary MC separately for each page and it works fine. Problem is, that leaves me with 10 Vocabulary pages and I would rather have 1 that loads info based on a var on the main page.
WORKING SCRIPT
var loaderZ:URLLoader = new URLLoader();
loaderZ.dataFormat = URLLoaderDataFormat.VARIABLES;
loaderZ.addEventListener(Event.COMPLETE, loading);
[Code].....
I am getting the word "depressed" from page 1 (verified by trace) Unfortuntely this does not work.
If I change the last line of code to:
VocText.htmlText = loaderZ.data = word;
Then it outputs the word DEPRESSED to the text field VocText but does not return the value from the txt file.
View 2 Replies
Jul 30, 2009
I am trying to send a value from one of my xml nodes (<marker>) by declaring it in a function 'showData' as a variable 'XMLMarker'. If I trace this value (XMLmarker) it returns the right data found in the node <marker> (which is 'myMarker_mc'). However, I need to tell the stage that myMarker_mc is a MovieClip...please see the 'PROBLEM' stated in the code below.
Code:
stop();
var placesXML:XML =
<places>
<place name= "Yogyakarta">
[code]....
why do you want a variable to hold the value in the node <marker>, when that value is identical for each node, ie. it is always 'myMarker_mc', so why not just directly declare the variable 'xmlMark' as myMarker_mc. The reason is; the value in some of the <marker> nodes will soon be changing to 'myMarker_mc2' - a slightly different movieClip which I may need to call depending upon which place @name is chosen.This is the new output thrown up by the variable XMLmarkers
Code:
<marker>
myMarker_mc
<myText>
[code]....
View 16 Replies
Jul 30, 2009
I am trying to send a value from one of my xml nodes (<marker>) by declaring it in a function 'showData' as a variable 'XMLMarker'. If I trace this value (XMLmarker) it returns the right data found in the node <marker> (which is 'myMarker_mc'). However, I need to tell the stage that myMarker_mc is a MovieClip. 'PROBLEM' stated in the code below.
[Code]...
View 6 Replies
Sep 20, 2010
I'm relatively new to Flash and ActionScript and have a problem with the following code I'm putting together:
Code:
// creating a new testmclip object
var testmclip = new testmclip(); // creating a new testmclip object
/* create a new pop up menu
- sending the testmclip as var and "test" as label */
popupmenu = new Menu ([path: testmclip, label: "test"]);
I'm trying to send a movieclip object created in one class, to a different class - for the latter class to add as it's child. The code was originally Kevin Hoyts Android Component for Menu and MenuItem [URL] ... but in that the path for the menuitem was a path which loaded from url or relative path --> this I can't do with flash...I think.
View 2 Replies
Dec 23, 2009
I have list that is generated from a database that when click it calls a seperate movieclip in the library called comments and loads data from the database in it. I the movieclip i have buttons that I am trying to pass the data to but it doesnt seem to be working.
here is my actionscript:
getReleaseInfo_Result = function (releasesID,track1url,track2url,track3url,track4ur l) {
_root.container.attachMovie("comments", "comments", 100);
_root.container.comments._x = 325;
[code]....
View 4 Replies
Jul 11, 2010
im trying this every which way.creating global variables etc.I have a movie clip with a text area (lets call it txttest)there is text inside it which i want to send from this movieclip on the main frame to a text area (lets call that one txttestB) on the main frame. Whatever i try i get undefined in the text area on the main frame.I have tried this...
_global.selectedcompany = txttest.text;
_root.txttestB.text = _global.selectedcompany;
View 1 Replies
Aug 19, 2009
I have a main movie (main.swf). I load child1.swf and child2.swf into it with URLLoader. Is there any way to make a button to child1.swf which would take a user to some frame in timeline of child2.swf?
Something like
parent.child2.goToFrame(5);
I have tried different combinations without luck...
View 8 Replies
Jul 8, 2009
I am a bit of a noob, and I'm having a problem. I had posted about this before but I think I was explaining what I need to do in way to much of a complicated manner so I'm going to try and simplify this a bit. I have 5 swf's.
- main.swf (parent)
- child01.swf
- child02.swf
[code]......
View 2 Replies
Sep 8, 2009
i have a parent movieclip mcA and i want to add another movieclip mcB (child movieclip) inside mcA such that the extra part of mcB is hidden. The size of movieclip remains same as of mcA
For ex:-
mcA = 300x300
mcB = 400x400
then only 300x300 of mcB movieclip is visible and rest of the part is hidden.
View 5 Replies
Jul 23, 2009
I've been using Flash for years but only recently started doing anything with AS3. I am using SlideShowPro and SlideShowPro Thumbgrid which are both AS3 components, hence the move. I am finding the move incredibly frustrating.Anyway, on to my problem. My parent movie is loading a child SWF. The child SWF needs to read a variable from the parent but I can't work out how as the old syntax is not working.My loading AS looks like this:
ActionScript Code:
var loadit = new Loader();
addChild(loadit);
[code].....
View 9 Replies
Oct 14, 2011
I'm trying to access some variables from my parent in my child MC.
Parent code:
var data_history:String;
function finish_checkUp(event:Event):void{
var checkUp_stat:String;
[Code]....
Now as you can see, i have tried the trace method, but with no luck. Flash doesn't report any errors regarding the trace method, but does report the two undefined vars (data_history). Ive tried to use the trace method above all the functions, at the top of the script, still the same errors though.
View 2 Replies
Sep 30, 2009
I am not sure if I'm being completely stupid here, so my apologies in advance. If I have an object on the stage for example:
ball:Ball = new Ball();
addChild(ball);
it already has .x and .y values as it is placed on the stage.Then I have some value inputs, such as force, angle etc.Now when I click an event listener I want it to activate a function in Ball that will move it from the values I have just set.My question is how do I carry those values across after the ball has already been place on the stage?
View 4 Replies
Oct 29, 2010
I need to pass information from a child component (Flashbuilder 4) up to its parent.
The information comes from an event object. Do I need to use a custom event?
View 0 Replies
Dec 8, 2002
I'm populating a Dynamic Text field with content from an external flat text file.To load the text file I have a frame action: loadVariables Num("flash.txt", 0);This works fine when viewed by itself.The problem is when I load that Movie into the Parent (container) SWF file using loadMovieNum - it will no longer work.
View 5 Replies
Jan 7, 2007
how to pass variables from a parent swf to a child swf loaded into a movieclip container within the parent swf.
View 6 Replies
Apr 17, 2009
I have a Parent.swf which loads a child.swf.this is a desktop application and the problem is
while loading the child.swf i have to pass a variable from parent.swf to child swf. how can i do it.can anyone give me an implemented code.
View 9 Replies
Apr 16, 2011
I have a Spark ButtonBar that has a custom skin, which defines a custom skin for the "middleButton" requirement. My CustomButtonBarSkin has a custom state, minimized, which I want to pass into my middleButton skin so it can modify its design.
Is it possible to do this? I can see that my button skin could use parentDocument.currentState to get the minimized state, but that's really ugly. Any way to pass a skin from the bar to the child button(s)?
View 4 Replies
Nov 10, 2011
I 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?How Can i do this?
[Code]....
View 3 Replies
Jul 26, 2010
how can I pass a variable from a parent flash file to a child flash file which it calls?We have a parent flash file which imports various child flash files based on instructions in an XML file. It's probably easier to see an example - opg2DOTcoDOTuk/flash/yay.html (replace the DOTs, couldn't post an url due to restrictions) - the text above each page, and the 'enlarge page' lightbox links are all in seperate flash files (one per double page) which are brought in, depending on the pages you are looking at, based on the instructions in an XML file which looks like this...
<page ani_swf="pages/text1.swf">pages/white.jpg</page>
<page ani_swf="pages/text1.swf">pages/0001.jpg</page>
<page ani_swf="pages/text2.swf">pages/0002.jpg</page>
<page ani_swf="pages/text2.swf">pages/0003.jpg</page>
etc, where the swf is the header flash file containing the text and one or two lightbox links, and the jpg files are the page images that appear.We had to repeat the imported child flash file because of a glitch when you go backwards through the book otherwise.
This system has been fine for us up until now but recently we've had to look at making it a dynamic system, so the content of the book can be varied depending on a variable being passed into the parent file via FlashVars...
<param name="FlashVars" value="zone=1" />
<embed src="newbook3.swf" FlashVars="zone=1" ....etc
This makes the book load an xml file called "1"). This is fine, except we also need to vary the 'enlarge page' target images to match.The 'enlarge page' links are currently hard coded into each child flash file, like this...
on (release){
getURL("javascript:SWFDelegate('imagename.jpg','Ex ample');");
}
- What we've tried so far:
1. Trying to pass the variables in querystrings from the XML
eg.
<page ani_swf="pages/text2.swf?var1=image1&var2=image2">pages/0002.jpg</page>
<page ani_swf="pages/text2.swf?var1=image1&var2=image2">pages/0003.jpg</page>
with the child flash setting it's action like this...
on (release){
var image1 = var1 + ".jpg"
getURL("javascript:SWFDelegate(image1,'Example');" );
}
I'm not sure if the syntax here is correct. We have to add the ".jpg" in here because, as far as I understand it, you can't pass "." in a querystring.
2. Passing the variables for the child into the parent
I read somewhere that variables passed to a parent are automatically available to a child. Not sure if this is true, but it didn't work for me when I tried it like...
<param name="FlashVars" value="zone=1?var1=image1&var2=image2" />
<embed src="newbook3.swf" FlashVars="zone=1?var1=image1&var2=image2" ....etc
Combined with...
on (release){
var image1 = var1 + ".jpg"
getURL("javascript:SWFDelegate(image1,'Example');" );
}
...in the child button action.
View 2 Replies
Mar 24, 2011
I have a parent swf that loads a child swf and attempts to pass some data into the child.
The process works fine if parent and child are located in the same domain (lets say domainA.com).
As soon as I place the child swf into domainB.com and try to load it, it will load in the parent, but it is not loading the values.
Crossdomain policies are in place (the child does load!), but the params are not sent.[code]...
View 0 Replies
Aug 19, 2009
how to remove all child of a movieclip if no of child are not known
View 2 Replies
Aug 22, 2009
I have a flash file that has an XML driven menuing system to select and play various FLVs. I want to be able to craft different URLs to open the swf and start playing different FLVs. (The others will be accessible from the menu once the sfw is opened, but I am looking to control what plays on opening, dependent on what link a user click.) Not really sure about the best way to get the selection into the swf.
View 4 Replies
Aug 17, 2009
I have a site that uses an user id that needs to be passed from links with a flash banner. I have it working, but not the way I need it and could use a little assistance.
[Code]...
View 4 Replies
Aug 26, 2011
I'm trying to pass the file name of an image upload PHP script into Flash's UILoader component. So when a user uploads their image, the file name of the file is passed to flash so that the image displays within the Flash UILoader application. Here's the PHP variable I'm trying to pass: $filename= ''; And here's where Flash's UILoader gets it's source (ActionScript 3.0): uiLoader.source = "freshly uploaded file.jpg ($filename)?";
View 1 Replies
Aug 13, 2009
i have the php file transfering the correct data but it is not registering as the variable in swfi have already tested the php file and do Know that it is working correctly
I have tested the swf file - no user works but the variable sent for balance is not setting
$select = "SELECT * FROM `auth` WHERE `username` = '$username'";
$result = mysql_query($select) or die(mysql_error());
//how many rows
[code].....
View 0 Replies
Dec 7, 2009
I am using SWFObject2 and passing in a flashvar to the movie it is loading (preloader.swf). I can retrieve the flashvar in preloader.swf no problem at all.The issue is that I am loading another swf from the preloader.swf (lets call it loaded.swf) and I want to get the variable from preloader.swf into loaded.swf - but for the life of me I just can't work out how to do it.If I try and access the variable from the preloader.swf via loaded.swf I just get compiler errors because the variable I want in preloader.swf doesn't exist in loaded.swf
View 0 Replies
Oct 19, 2011
I've got a question regarding passing a variable from PHP webpage to .swf file placed on that webpage.
Example:
Button on a webpage1.php is loading a frame.swf file.
Frame.swf is loading test.swf into itself using
ActionScript Code:
loadMovie("min est.swf", mc);
Button on second webpage2.php is again loading frame.swf file but this time I would like that frame.swf would load test2.swf into itself using ActionScript Code:
[Code]...
View 2 Replies
Nov 1, 2005
I have integrated a swf into another swf. (Actually it is a menu that I have incorporated in my 'main swf'.) When clicking a button in swf no.1 (the menu) I set:
_global.new_value="1" ;
_root.Application.newfunction();
-and then in swf no.2:
[Code].....
View 5 Replies
Apr 5, 2006
I'm trying to pass a variable from my main swf to another one that's being loaded in a container in the main swf. What I usually do is create that variable in the main swf and have the loaded swf fetch it but in this instance I need the loaded swf to have it's own root.
Code:
container._lockroot = true;
container.loadMovie("main.swf");
[code].....
View 7 Replies