ActionScript 2.0 :: Calling Moive From Array For AttachMovie Property?
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
Similar Posts:
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
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
Apr 6, 2010
srry dekete post
View 0 Replies
Sep 13, 2004
I would like to make it so that the viewer can change the color of a movie using a button which is placed in another movie.
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
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
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 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
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
Feb 17, 2012
Here's the bare bones of what's causing me a problem:
var txt:Array = [mtxt];[code]........
View 2 Replies
Dec 14, 2011
I am creating movieclips into which I want to load thumbnails which are to be loaded dynamically. I'm not sure if the solution I am trying to build is the more effective way to do this; I'm still quite a noobie.
Each movieclip container which I will use hold the thumbnails is of a size to hold 16 thumbs, so the number of holder movieclips required is calculated at the time the xml loads; with the movieclips then being created, named and stored in an array. (The idea is to then move between these movieclips (and so the thumbs) using previous and next buttons) - however, I'm not at that stage yet!
However, when I call each movieclip to place the loaded thumbs in, the code throws the "#1010: A term is undefined and has no properties" Error. I think this is a problem with the array; and possibly the mc not being defined properly. However, I am not sure where my problem is.
[Code]...
View 7 Replies
Feb 17, 2009
I'm learning AS3. I would like to call an Array which contains five mc. Although when I check for errors on the script it says that it doesn't have errors, when I test the movie I have a
couple of errors.
1046 Type was not found or wan not a compile...
1180 Call to a possibly undefined method
placeRandomPicture();
Here is my script.
var listLoader:Array = new Array(back_1, back_2, back_3,back_4, back_5);
bt_1.addEventListener(MouseEvent.CLICK,
function (evt:MouseEvent): void {
function placeRamdomPicture (): void {
var iRandomImage = Math.round (Math.random() *
listLoader.length-1);
iRandomImage = (iRandomImage > -1) ? iRandomImage : 0;
picHolder.addChild(new listLoader [iRandomImage]);
} placeRandomPicture();
});
View 15 Replies
Feb 15, 2011
I am writing this post because i have not found an answer to this. I wrote a class that will get several function names and then proceed to call them. Thing is, i want this code on a base class, which is on a separate swc.
[Code]...
If i override the createThing function, and add the exact same code, there is no problem. Is there a way around this? I think this is a bug on AS3 not distinguishing its real context, but i am not sure.
View 1 Replies
Jun 20, 2010
How would one go about calling a function of an object that is stored within a multidimensional array? I keep getting TypeError: Error #1006.
Code calling the function:
ActionScript Code:
_board[i][j].drawPiece(xPos, yPos);
Code of the function:
ActionScript Code:
public function drawPiece(xPos:Number, yPos:Number):void{
_piece_mc.graphics.lineStyle(1,0x000000);
[Code]....
The object is there. When tracing out the array for specific index it provides:
[object Piece].
Or would it just be best to use a single dimensional array? End goal is to have a board class to be able to use for checkers and then potentially chess.
View 1 Replies
Feb 2, 2010
I've seen similar threads on here but nothing quite works for me, so sorry if this has been previously answered.I'm creating buttons dynamically in functions, and I want to load them ALL in randomly as you enter the frame.Let's say I've made an array, and it looks like this:
ActionScript Code:
var ButtonsArray:Array = new Array (6);
ButtonsArray[0] = ZeroButton;
[code]......
View 2 Replies
Mar 5, 2009
An array of different pictures that I call in from a local folder. I have a method to mix up the array to make it random. I then want to display the first picture in the array and then when I press a next button I want it to go to the next item in the array and stop when there is no more items left in the array.
View 1 Replies
Mar 7, 2010
i'm attempting to instantiate a bunch of sounds by creating a string array containing each sound's filepath (or name).
var soundByName:Object = {};
var channelByName:Object = {};
var soundName:String;
[code]....
View 1 Replies
Nov 12, 2010
Is it possible to refference a movieclip in an array and then calling a methodfor ex.The movieclip i want to refference: main.box.mymovieclip
var current:array = new array();
push(main.box.mymovieclip);
and then like calling a method on it:
[code].....
View 1 Replies
Aug 3, 2010
so I'm trying to create this array property inside an object. here's my class:
[Code].....
what's been frustrating me, is that when I trace city1.adjacentNodes[0], what I get is 200 (the value of what's supposed to be in city2.adjacentNodes[0]). It's as if the last value that was entered to the last object's property overwrites all adjacentNodes property in all Node object..
View 2 Replies
Nov 1, 2010
How to set or get the property of any object in an array. For Example:
ActionScript Code:
import flash.display.MovieClip;
import box;
import flash.events.Event;
import flash.events.MouseEvent;
public class temp extends MovieClip {
[Code] .....
How can we set or get the value of any object in an Array
View 5 Replies