AS3 :: Use One Variable To Load All Movieclip?
Apr 11, 2012
is there a way to make all the movieclip that I want to load on stage into an array?
if (selectDiffText.text == "Collection 1 Easy")
{
var c1_easy:cartoonEasy = new cartoonEasy();
addChild(c1_easy);
[Code]....
now I have 3 movieclip in library which is cartoonEasy, cartoonMedium and cartoonHard. I'll add one of them into stage but with different variable. is it a way I can make them just using ONE variable only? is it using array?
because if just using 1 variable then i can easily control object inside 1 of the movieclip that I called from library.
what I'm thinking is like this:
var c1_all:cartoonAll = new cartoonEasy() = new cartoonMedium() = new cartoonHard()
View 2 Replies
Similar Posts:
Apr 18, 2004
I have a movie clip that needs to load an outside Variable and I know how to do it if the Variable is in the main time line.
Main TimeLine:
timedelay = 5;
MovieClip
timedelay = _root.timedelay
What I can not figure out is how to load a variable in a movie clip that is on the Instance of itself (not in the movie clip).
I am fine if I only use one instance of the movie clip at a time on the stage since I can set the Variable on the Main TimeLine into the movieclip (using .root), but this would not work correctly if I want two instances of a movieclip with differenct variables.
Right now I am having to make duplicate copies of a movie clip with different Variable names. I was hoping there would be some way where I could only use one movie clip and give it different variables.
View 1 Replies
Oct 9, 2010
im trying to load a movieclip by a name passed threw a variable
Code:var loader2:URLLoader = URLLoader(event.target);
var sc:URLVariables = new URLVariables(loader2.data);
boxes[0].text = sc["Type1"];
temp = this.addChild(new sc["Type1"]);
sc["Type1"] is equal to Archer
TypeError: Error #1007: Instantiation attempted on a non-constructor.
View 2 Replies
Sep 15, 2009
var loader:Loader = new Loader();
loader.load(new URLRequest("panghat spa.swf"));
addChild(loader);
want to load panghat spa.swf as a variable by pasing variable from html page in to flash
View 1 Replies
Jul 28, 2007
I'm trying to combine PHP/SQL and Flash. I've got a problem now. I want to load a variable that contains an url to an image. so the variable is like this: [URL] Now I want flash to load the image, not the text. The variable is called 'img1' but the loadmovie function doesn't work when I put it in.
View 2 Replies
Aug 21, 2009
I want to declare a variable on the main timeline that can be called from anywhere in my movie. So, _global var should be the right approach. I want to declare a movie clip 'MC1' "open", or "closed" so that when it is revisited, my flash file knows the user has been there before and performs a different task from the one it does when 'MC1' was first encountered. So, i need a 'if' statement to run from the variable, when the playhead encounters the movieClip.
[Code]..
View 2 Replies
Jun 7, 2005
Is there a way of making a normal loadVars.load load a url depending on a variable you set in the swf?
var reciever = new LoadVars();
loadurl = "test_onload_3.cfm?propertyID="+MY_VARIABLE_GOES_HERE;
reciever.load(loadurl);
so that I can set my variable and then load the variables with the propertyID that I choose in the swf??
View 4 Replies
Oct 10, 2008
I have been banging my head against a brick wall regarding the following problem which must be very simple to fix, just can't see the answer.I have a class assigned to a movieclip called canvas. The class is called drawClass. I have called the instance of canvas on the stage 'drawingCanvas'.When I trace "drawingCanvas" I get object drawClass] which is fine. Tracing drawingCanvas.name gets me the instance name 'drawingCanvas'.This is a String variable.Basically what I am trying to do is pass the MovieClip name to another class. In my example the class 'toolBar', which can then interact with the MovieClip.
The problem is passing 'drawingCanvas.name' results in a String, so I get an error saying :TypeError: Error #1034: Type Coercion failed: cannot convert "canvasArea" to flash.display.MovieClip.I can't for love or money find a way to convert a String variable to a MovieClip variable! I have the name of the MovieClip, I just need to tell the toolbar class. But I can't find a way of doing this as the instance on stage is an object of drawingClass, not a MovieClip (unless MovieClips with attached classes are not treated as standard MovieClips?).
View 9 Replies
Jan 7, 2008
Im trying to make a SWF that sends some variables (query string) to ASP. Then the ASPfile is responding with "response.write". Everything works great except i dont know how to get the asp-answer back into flash again.I got a few variables that's added in a movieclip called form, then use this command on the button.in the flash button, (on release)
Code:
success = 0;
form.loadVariables ("http://xxxx/Code.asp", "GET")
in Code.asp
[code]....
View 2 Replies
May 17, 2011
I am brand new to AS3 and just about muddled through with AS2. I have a problem which should have a simple solution but everything I try gives errors.I had a load of buttons on the main timline which worked fine. I have moved a load of them into another movieclip called flyoutMenu. Now none work and I get the error:Error #1065: Variable about is not defined.This is the code stripped down to one button:[code]
View 2 Replies
Dec 8, 2010
I am trying to access the variable myParentVariable within the function myParentFunction() from the MovieClip's myMovieClip_mc function myMovieClipFunction().
I know that It works if I declare the variable myParentVariable outside of the myParentFunction() but I don't really want to do that
main timeline
//-------------------------------------------------------------------- ---
myParentFunction();
function myParentFunction():void
[Code]....
View 1 Replies
Mar 30, 2009
This is something I'm experimenting with, but haven't seemed to figure out... I have several MovieClips, basically the same, only different colors. As each one plays, I'd like it to "overlap" whichever one is already there. Right now I have each button linked to a gotoAndPlay function, but I don't think that will ever get me what I want. You can see how I have it now here: [URL]
Instead of having the content MovieClip go back to all white when a button is clicked, I'd like the preivious one to remain, and get "covered up" by the new one. You continue to see the old color, and the new color overlaps it. I have a feeling I need to use a variable and then addChild, with a removeChild for the old MovieClip after the new MovieClip has loaded, but I'm not getting any good results yet.
View 1 Replies
Aug 1, 2005
I have a loop that creates movie clips where the movie clips are named mc_+ x for say x = 1 to 10 so the movieclips are called mc_1, mc_2.....mc_10.
What I need to do is the know which one of the movieclips is clicked on but more importantly the number i.e if movieclip mc_2 is clicked on then I need to use the value 2.
At the moment I am sending the value of x to be displayed in a text box within each movieclip:
_root.search.textfield.text = x;
Then I have a piece of actionscript that uses the value of x but I don't seem to be able to "re-read" the value of x back with:
var t = _root.search.textfield.text;
what I want is t = x is it to do with strings and number variables?is it possible to send the variable x to each movieclip so that it can be called from within each movieclip instead?
View 1 Replies
Feb 17, 2009
If you click topic1 I want topic1.swf to load, click topic2 to load topic2.swf etc. What I am doing wrong with var url:String = "topic"[i]+".swf";?
[Code]...
View 12 Replies
Feb 8, 2006
how to load a movieclip into a blank movie clip all in the same movie?!
View 4 Replies
Dec 29, 2002
I've got 12 MovieClips, which all have specific functions in the movie. Those MC's will appear and dissappear after a few seconds. But what I want is, that those MC's have to appear at random .If all 12 MC's have appeared, the appearance has to be stopped. So for example MovieClip number 4 has to appear just once. So 12 MC's will appear, but everytime when the movie starts, the appearance has an other sequence.What is written above I want to place in an other MC. So there is one MC which 'load' 12 MC's within it
View 2 Replies
Dec 28, 2010
I'd like to load text into my Flash movie to allow a simple 'Noticeboard' inside the flash movie. I've got it working with loadVariablesNum no probs. The trouble is I load the noticeboard into another movieclip. When this happens the text doesnt load even if I declare the variables, do _root etc.
View 5 Replies
Apr 7, 2011
I want to load xml based on what button is pushed by changing the name of a variable.
For instance, there will be a string: var whatscreens:String = "screens";
On clicking a button, I will change the string to whatever, and then I want to use that string to load the xml like: loadXML(MovieClip(parent.parent).feedXML.feed.whatscreens);
Unfortunately this doesn't work. How do I put a working variable into this line?
[Code]...
View 1 Replies
Nov 10, 2010
I have a problem, i don't understand the URLLoader.I have this simple php code and i want to load it in flash.[code]...
View 1 Replies
Feb 18, 2011
i am trying to load xml with a variable, like this:[code]if the path is normal, like ("pathtoxml.xml") it works, but not this way.
View 3 Replies
Apr 8, 2005
on (release) {
_parent._parent.setmenu(name,value);
}
what I also want to do is, launch the URL (or swf) from that variable.FYI, this is a XML menu, I want to have this as some sort of link list.
View 2 Replies
May 1, 2009
The desired affect is simple: I have a single button... with each click I want it to load text into a dynamic text field and load a corresponding picture or movieclip.There are only three unique text/image combinations- after its displayed the third, with the next click I want it to just start over. All the text functions perfectly with each click.
The problem is:I use "createEmptyMovieClip" then use the resulting clip as a loader clip.. With the first click I want a movieclip from the library to load, so I use the "attachMovie" method- it displays the first library fine.With the next click I want to load an external swf- so I call the "loadMovie" method of the loaderclip... The external swf loads just fine replacing the first library clip.The third clip is where I have problems... now I want to load another library item into the loaderclip... so I tried using the attachMovie method again but the external swf remains static... then with the next click, I discover the first library item no longer loads and the external swf remains still playing- it's like once it's been loaded into the loaderclip it cant be moved...
So I tried adding the "unloadMovie" method in the code for the third click.. it successfully removed the swf... but the next line of code immediately after the unload statement, doesn't work. The line calls the attachMovie method for the loaderclip... but the library item doesnt load... Oddly enough, with the next click, the first library item now does load as if everything's fine... It seems like you cant use the unloadMovie and attachMovie on the same executing code? if that makes any sense... the basic idea was that if I couldnt get the attachmovie method to replace the loaded external swf, then I would use the unload method to remove it, then have code immediately after, to then execute the attachMovie method... but it still doesnt load the library clip. and I know it's not a type-o, because when I comment out the loadMovie and unloadMovie statements, it loads both the library items perfectly ? The code is below
var increment:Number = 1;
var verbiage1:String = "Hello World1";
var verbiage2:String = "Hello World2";[code].............
View 2 Replies
Aug 11, 2009
Depending on which button a user clicks, my project will generate a different variable "b" in the URL
If a user navigates to my page titled "default.asp?b=1", and I have the swf embedded on my page how do I send the URL variable to my flash movie through HTML. If someone could also explain how I retrieve this variable in my actionscript code
View 2 Replies
Sep 16, 2010
I am getting all data from the database through asp using loadVariableNum("get.asp",0,"GET") in a text box named xx.now i want to split it into further variables for manipulations. but i can't get the value from the textbox xx.i tried
question1.text = xx.text and var data1 = xx.text
how to get the text from xx?
View 3 Replies
Jul 19, 2011
what want to make is let people submit a URL and then show the image on the stage ..
so i went an wrote my code but it doesn't work as i expected .. here is the code
var myurl:String ; // a var to load the text in it
var reques:URLRequest = new URLRequest (myurl) ; // the urlrequest (i know that this only accept strings but what to do !!)
var loader:Loader = new Loader(); // the loader
[Code]....
View 2 Replies
Nov 2, 2009
I have this code:
ActionScript Code:
onLoad = function()
{
trace(_root.sliderPosition)
[Code].....
It monitors the sliders position, however, it doesnt track it. It only tracks it if i change it from onLoad to onEnterFrame.
View 3 Replies
Feb 12, 2007
i am creating a variable MCount which will increment each time the button is pressed... in turn it will then load the next movie in the folder.[code]
View 4 Replies
Apr 5, 2007
I think i am screwing up the syntax. let's say I have a global variable, like. _global.something = mymovie
And then, the code to load in the external swf.... loadMovie((something)+ ".swf", _root.ec); Well, it doesn't work, and I'm just not sure where to put the quotes, and how many parenthesis are needed. How do I use a global variable and access it for this loadmovie code?
View 1 Replies
May 17, 2002
I load a variable from a txt file.The dynamic text box has html turned ON.All characters are embeded.Here's the problem:In the txt file I have a text that contains an html link:
myVariable=Hello! This is my text! Click <a href=http://www.uachq.cjb.net>here</a> to visit my site!
However the swf displays everything up to "Click" ie before the link:
Hello! This is my text! Click
And that's it. I heard that Flash can recognize a simple html command like <a href> but this seems odd to me... Why isn't this working?
View 10 Replies
Feb 2, 2004
in java you can load a variable that is in the HTML for example
[Code]...
I would like to know if there's a way to load a variable in that way with flash.
View 3 Replies