ActionScript 2.0 :: Calling Movie From Array For AttachMovie Property?
Apr 17, 2010
I am trying to attachMovie from array.
Here it goes like this:
----------------------
var __reg3 = new Array ("1", "2", "3", "4");
_root.p1.attachMovie(__reg3[0] + 1, "run1", 1); -- Not working
Then I tried using string:
test1:String = __reg3[0] + 1
_root.p1.attachMovie('"+'test1+'"', "run1", 1); -- Not working
Then I tried this
_root.p1.attachMovie(" "" +test1+" "", "run1", 1); -- Not working
Then used this:
qt:String = '"';
_root.p1.attachMovie(qt+test1+qt, "run1", 1); -- Not working
But when I use like this, its working:
_root.p1.attachMovie("3", "run1", 1); -- working.
View 1 Replies
Similar Posts:
Apr 18, 2010
I am trying to attachMovie from array.
Here it goes like this:
var __reg3 = new Array ("1", "2", "3", "4");
_root.p1.attachMovie(__reg3[0] + 1, "run1", 1); -- Not working
Then I tried using string:
[Code]...
View 3 Replies
Aug 4, 2005
I have a button and when you press it it attaches a MC and calls a other function called showProductInfo().
Code:
_root["pod"+i].sub.pinfo.onRelease = function(){
_root.attachMovie("popup", "popuper", i);
_root.popuper.showInfo(i);
}
And in the popop/popuper MC I have the function showInfo(id) in the first frame. But I can't get it to work.
Code:
function showInfo(id){
this.txt.text = id;
}
View 8 Replies
Apr 10, 2010
I have 2 nested move clips in this order.
mc_a (grand parent)
mc_b (parent)
[Code]....
Now, I have a button on the stage. I am trying to load mc_a on stage using the linkage, and trying to load an image that replaces c_inst.
I am using:
on(release)
{
_root.attachMovie("a_call", "a_called", 1)
_root.loadMovie("image1.jpg", _root.a_called.b_inst.c_inst)
}
But so far it only attaches the movie, doesn't load the image.
View 1 Replies
Sep 24, 2006
Code:
var numOfChars = 0;
setCharacters = new Array();
if (empty1.hitTest(_xmouse,_ymouse,false))
[Code]....
View 1 Replies
May 9, 2010
I'm creating some mc's on the stage with the attachMovie function in a loop. I have no problem naming them like that:
foo.attachMovie("myClip", "myClip"+i, 200+i);
But I need to name them with part of an array like that:
foo.attachMovie("myClip", "myClip"+array[i]+"_mc", 200+i);
I thought that would work but I guess my synthax is wrong. How do you mix strings and arrays elements inside the () of the attachMovie?I need to get something like: myClipArrayElement1_mc for the name of the attached movies...
View 2 Replies
Jul 8, 2010
I'm trying to reduce repetition in my code by using a for loop with an attachMovie call. [code]So I have a bunch of clips in array that I want to attach, and I just want to use the name of the clip as the instance name, but it doesnt seem to work.
View 3 Replies
Nov 28, 2002
ok, that's some basic question but it's 4 am, I can't find the answer in the tutz and I'm starting to get a headache...I'm creating some mc's on the stage with the attachMovie function in a loop. I have no problem naming them like that:foo.attachMovie("myClip", "myClip"+i, 200+i);But I need to name them with part of an array like that:foo.attachMovie("myClip", "myClip"+array[i]+"_mc", 200+i);I thought that would work but I guess my synthax is wrong... How do you mix strings and arrays elements inside the () of the attachMovie?
View 6 Replies
Oct 12, 2006
I'm going to post the full code of the two functions, disregard the "fluff" unrelated to the two functions as it is all working flawless, I've tested this HEAVILY and cannot understand why it keeps setting the entire array to undefined!
Code:
// processReplace Function
function processReplace(transferFiles) {
var processArray:Array = transferFiles.slice();
[Code]....
Basically it's supposed to check to see if the file exists and return as true if it does and add it to a replace array, then the replace array is processed into a single string and put into a dialog box through the flash wrapper prompting them to "replace the files or not".
It makes the replace array just fine, it actually even has the right "count" in it but it's setting all the "filenames" to undefined because of the exists = processSearch function.
I even tried to make a new array and run the search just from that one and set the values from the old one and it's still failing.
Is it because of the "break" or can anyone figure it out? Iknow it's hard because you can't use the code
View 1 Replies
Apr 21, 2010
Fla is attached (small file, simple function)I am going thrue an array and create instances of 'inputter'.It all works fine for the last one in the array but not the first ones.Shortening the array-count still creates only the last one and not the first ones.
My function:
ActionScript Code:
doinit = function()
[code].....
View 1 Replies
Jun 7, 2007
is there anyway to put all movies that are attached with attachMovie in an array?
ex.
attachMovie ('ball','ball1',this.getNextHighestDepth())
then it will allso run a code that push the array with 'ball1' ? ?
View 2 Replies
Feb 17, 2006
I'm developing a game and the objective is to drag some objects to a container. Some objects add points, and some other subtract points. So, all the objects are in the library and have a linkage name to be called by attachMovie. I want to create an Array with all the objects that belong to container, like for example filename1 = ["obj1", "obj2", "obj3"]; etc... I have a var called count1 that defines the number of objects to appear on the Scene
[Code]....
View 4 Replies
Jun 15, 2009
I've loaded a swf into my project by using loadClip, and now need to put some movieclips over the top of it using attachMovie. All the new movieclips appear behind the loaded movieclip. Is this normal?The movie I have loaded is inside an empty movieclip I've created called "container". Eg:[code]The "sparkle" movie clips are attached much later, on a keypress.
View 1 Replies
Aug 4, 2005
I have a main listbox, which the content is in form of dynamic arrays. Upon click on some of the item in the listbox, some other arrays are suppose to appear in another listbox, by checking that both of them have the same "title". I was thinking of using listener to listen to the main listbox, but it does not seem logical to me. Can anyone suggest a better way to solve this? btw, i saw one tutorial atits something like the dependable combobox tutorial, but in this case, the arrays are 2 different arrays that has the same content for checking purpose, unlike the one in the tutorial.
View 6 Replies
Nov 1, 2009
I want to add 5 movie clips to the stage. The movie clip at this point is just a red box and called testMovie. Ultimately i want to have 5 red boxes displayed on screen tiled vertically one under the other. Here's the code i have so far:
[Code]...
View 7 Replies
Mar 30, 2002
Still plugging away, but I've run up against a problem that seems like it should be easy to fix, if I only knew how. Made a hairline for use in drawing lines with attachMovie(). Wanted to test it by making a "crosshair" at (100,100). You'd think:
[Code]...
View 6 Replies
Feb 1, 2004
How to get the _y position of a movie instance generated by the AttachMovie method? I'm trying to do something like this.
_root . mc full of attachedMovie instances . one of those clips . _y
The path I'm really using looks like:
_root . text . infoblock4 . _y
View 3 Replies
Sep 9, 2005
What I have is a news blogger that is loaded via xml which uses php to write to the xml file. I have my "blogger" movie clip that loads all of the different blogger info into it. It is loaded into a blank container movie clip via attachMovie and when the user adds a new blog it creates new instance of it and moves the rest down. All works great with that.
Now the problem is after the client creates more then 3 blogs, it begins to run off the site. So what I need to do is put it into a scroller. Now I have gotten it into the scroller but it seems that the scroller is not seeing the actual size of the container clip that is holding all of these instances of the "blog" movie that is loaded from attachMovie. The size will change depending on how many blogs there are and I need to figure out how to add script to calculate that. Here is the code I have to load the "blogitem" movie into the blank container movie.
Code:
var i = 0;
if (gateXML.hasChildNodes())
{
child = gateXML.firstChild;
[code]....
View 4 Replies
Sep 14, 2006
basically i am attaching a movie dynamically with the attachmovie method like so:
Code:
for(var y = 0; y < rowSize; y++) {
for(var x = 0; x < colSize; x++) {
attachMovie("box", "box" + count, count);
[code]....
now for each attachmovie they have a Event handler, rollover,rollout, but, on the release event holder I want it to load in some XML like so:
Code:
path.onRelease = path.onReleaseOutside = function(){
//alot of my nifty code that will be skipped for elongated post purposes
//but here is where im getting a error
[code]....
I thought at first having the XML declared in the loop does make it just loop through 15 times ( length of my nodes) and just display the last XML item, but when i declare it before it, it does NOTHING !!!!!!!!!! it doesnt even display a damn thing, soon as i put it within my loop it displayed atleast something?
View 2 Replies
Jun 10, 2002
how to put Movie Clips on my stage using the attachMovie command, but they always appear in the upper left corner of the screen. How can I get them to appear in a predetermined area of the stage, without having to edit the Movie Clip itself?
View 1 Replies
Jul 29, 2011
I have called this flash code in Flex using SWF loader . I got the following Error. Here I have attached flash coding for header_text_fla Kindly do the needful.
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at header_text_fla::MainTimeline/loaderComplete()
var myEvent:Event;
var myParams:LoaderInfo;
[code]....
View 3 Replies
Jul 27, 2003
Now that I'm on the verge of madness I must consult the forum. I'm simply trying to take one movie clip I made, make it behave like a button, and attach multiple instances of it on my stage, each of which will load a different image to the page. Therefore each movie clip instance contains one crucial bit of unique info -> a number.
That way when I click on the upper left movie clip button it will load ["poster"+this.num] where this.num = 1 and so on. Im having a heck of a time talking to the variables stored in my movie clips... tried to do an onLoad since I only want to set it once but to no avail. any ideas? i'm confused myself just trying to explain it so i'll attach the fla, it's not too big.
View 2 Replies
Mar 19, 2010
I am working on doing a hitTest using one attachMovie and one repeating movieClip. I am running into trouble because the movie clip is changing it's name every time it's created (panda1, panda2, panda3, etc...) and the attachMovie, fire, is not recognizing the created MC's. here is the code to create the movieClips:
[Code]...
View 3 Replies
Aug 30, 2011
We're making a viral video which is going to be distributed as FLV movie file free for download and redistribution.
I don't know much about flash yet but I can imagine FLV is just some sort of special flash application which can also include arbitrary code.
Is it possible to track how many times that movie file has been played by letting the FLV file perform a server-callback when playback begins?
View 1 Replies
Mar 27, 2006
Both files are running on the same domain.I am simply calling a another movie within a movie using the global variable feature.Howver even hardcoding the variable _global.directionsText the import-html.swf movie returns a undefined error
Code:
//Frame 1 - Actionscript from Calling Movie
_global.directionsText="http://www.mysite.com/access_db/viki...ive/myHTML.txt";[code].....
View 1 Replies
Jun 16, 2003
I'm working on a Flash MX application which involves a Parent movie and a Child movie.
I've loaded the Child movie into the Parent movie using LoadMovie. The instance name of the Child movie is Child1.
In the Child movie I have a user-defined function called getChildXML (we don't need to get into more details about the function).
The point here is that I want to call the getChildXML function from the Parent movie. I've tried something like Child1.getChildXML(); but with no luck.
View 4 Replies
Jul 1, 2010
I would like to be able to create and call an Array dynamically. So to pass a name through a function and create an array based on that name.Then to store values into sections in the array. I got the creating the array dynamically working, but I can't seem to store into it.
Code:
Sort = function (numOfVars,Name,toSort){
This works
_global[Name] = New Array(New Array (),New Array());
This does not work
_global[Name][i][c]= 3
This does not work
_global[Name + "[i][c]"]= 3
This does not work
_global[[Name][i][c]]= 3
}
View 1 Replies
Aug 5, 2009
I'm trying to improve the way in which i write my code for example:
Code:
var equations:Array=["one","two","three"];
var activeEquation:String;[code]....
I know thats completely wrong but it kind of shows the direction I want to head in. Basically what I'm trying to achieve is some way of calling on functions stored in an array.
View 2 Replies
Nov 11, 2003
I can't make Flash do a gosh darn thing 'flashy', no matter how many tutorials I read, and how many demo's I see, it never seems to do what would make sense. This worked fine until I tried to plop the dynamic text box into its own movie object in the library... I've opened flash, drawn a simple dynamic text box. Set the dynamic text box's data variable to szTextBoxData (why don't text boxes just have a value property? anyways..).
Then selecting it, I convert it to a symbol (as a movie) call it DynamicTextMovie, and stuff it away into the library. Now I delete it from the layer, as I want to add it dynamically at run time. Next, on frame one of the main movie, I insert this code. (sorry for the bad formatting, limit of the forum here..)
[Code]....
View 4 Replies
Jul 28, 2010
I would like to repeat a block of code within a function in Flex, which is the best way to do this, I would like to do this without making a new function?
The code currently is:
Code:
for each (var rawPhoto:Object in event.data)
{
logger.info("Photos.getPhotos: Photo[{0}] downloaded", rawPhoto.pid);
[Code].....
View 1 Replies