ActionScript 2.0 :: Calls ToSolid, The Movieclip Names (this[pontos[i]]) Are Undefined?
Jan 14, 2009
i'm having a problem with a for loop.i have this code:
ActionScript Code:
var pontos = new Array("boca_mc","esofago_mc","estomago_mc","delgado_mc","grosso_mc");
toAlpha();[code]....
when i call the function toAlpha, everything goes fine, but when it calls toSolid, the movieclip names (this[pontos[i]]) are undefined... i traced i, and i is ok.
View 3 Replies
Similar Posts:
Dec 5, 2006
I'm working on a photogallery and I'm using xml to load names, images.the problem is: I want a button to open a new browser window but something is wrong with the variable, I think it is because of the function, but still don't know how to solve it.
this.onEnterFrame = function() {
var bytes_loaded = holder.boton.getBytesLoaded();
var bytes_total = holder.boton.getBytesTotal();[code]....
View 14 Replies
Feb 4, 2011
I followed the tutorial on isometric transformations [URL], which I had no issue understanding. However, I thought I would explore putting that tutorial into multiple files / external classes as a bit of an exercise. Now I am just getting an error stating that "Calls to a possibly undefined method drawIsoRefBars". I've messed about for 2 days now, but just can't seem to nail the problem. where I'm going wrong in the following code? The intention is to create a drawingBoard sprite to plot/draw iso reference lines onto.
[Code]...
View 3 Replies
Oct 12, 2010
im having problems getting some as3 generated (not drawn on stage) movie clips moving across the screen.
Code:
package {
import flash.geom.ColorTransform;
import flash.display.MovieClip;
import fl.motion.Color;
import flash.display.*;
[code]....
View 7 Replies
Feb 1, 2010
I have a main movieclip which calls another swf.THAT swf is a file that calls 4 other swf files to be displayed at the same time. I simply had 'loader' movie clips with it's instance name and then used the loadmovie script to bring them in.well - the final swf now requires AS3 and I can't figure out how to code the files to load those up.
View 3 Replies
Apr 12, 2010
I'd like to simply scale down a movieclip (that I'm treating as a button) when the user presses their mouse button. When users release the mouse button, I want my button to scale back to it's normal (.scaleX = .scaleY = 1) size. My button also has listereners for a ROLL_OUT event to turn off (.alpha = 0) a highlight movieclip that rests atop movieclips showing the different states the button can be in.
When I roll over the button, the higlight comes, but there is an annoying flicker problem. For some odd reason, when I press the mouse button the ROLL_OUT event handler function is called, yet I didn't scale the movie down enough for the cursor to be off of the actual button itself. I do not want that flicker. I'm not sure why ROLL_OUT is being called even though the event is clearly a mouse down, and within the mouse down event handler I am scaling the button movie clip, but not enough to remove out from under the cursor. In other words, if I click the button at its registration point, a flicker appears.
Here's my code.
//this add all the appropriate listeners to the button private function addMouseListeners() { this.addEventListener(MouseEvent.MOUSE_OVER, mouseOver); this.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown); this.addEventListener(MouseEvent.ROLL_OUT, rollOut); this.addEventListener(MouseEvent.MOUSE_UP, mouseUp); }
[code]....
why my rollOut function is being called when the mouse button is pressed, and called once more when the mouse button is released.
View 8 Replies
Feb 19, 2010
In AS2 you could parse together movieclip names so that you could do things like this - Let's say you have a movieclip (clip1) inside a clip (clip2). You could do:
name1 ="clip" + 1;
name2 = "clip"+ 2;
and then when referencing the lower clip you could do: _root[name2][name1]._alpha = 50;
That doesn't seem to work in AS3, even if do something like
clip2[name1].alpha=.25;
I'm probably referencing the objects wrong, but can anybody shed any light on this? I'm having trouble parsing together paths and object names and it's driving me nuts.
View 3 Replies
May 18, 2009
I have an array that houses the names of six movieclips. I randomly select three of them. I am trying to get my randomly chosen movieClips to do what I want them to do. I have tried the following code to get the first to fade in:
[Code]...
But it does not work. The trace comes back with the full movie clip name ex: mcTom, but even though that value comes up in the trace, the AS doesn't see it as a movie clip. Any thoughts on how I can correct this?
View 4 Replies
Feb 23, 2010
I am trying to get the instance name that i gave to a dynamically created movieclip the movieclip was created using var zebra_mc:Zebra = new Zebra(); //creating a new instance of the zebra class The movieclip was then added to the stage using a for loop, as it was contained in an array. Each time a movieclip is added to the stage it is then added to another array (existingObjects) I then need to iterate through this array and pull out each objects names. I have tried using existingObjects[i].name, which returns "instance140" and existingObjects[i].toString, which returns functionFunction(){}, very useful. and existingObjects[i] which just returns the object.
View 2 Replies
Aug 1, 2005
I've got this code but apparently the reference to the button doesn't work since i get an AS error upon execution.
PHP Code: [code].....
I've already tried without the brackets but that yields the same result.
View 3 Replies
Apr 16, 2011
In the second line of code below, I'm attempting to add the string "banner" to a variable called "btn_2". When I do this, I receive a "type coercion failed".
Code:
var btn:MovieClip = MovieClip(e.currentTarget);
var btn_2:MovieClip = MovieClip(e.currentTarget + "banner");
View 14 Replies
Jun 13, 2009
I need to write a function that retrieves the instance names of movie clips without knowing what those instance names are.
Here's the scenario:
The timeline reaches a frame which has a movieclip with an instance name of "bigClip"
bigClip itself holds a number of movieclips, each with its own unique instance name. On the enterFrame of bigClip, I want to retrieve all the instance names that are on bigClip and put them in an array.
View 2 Replies
Jul 8, 2009
I have an array of data that I'm using to create thumbnails and labels I'm using "Loader" to load the thumbnails (sample code below) but what I'm wondering is how I can make the name of the loader dynamic so that each child gets named "image1, image2, ...". I tried adding "[i]" after the "image" for each item in the code but it complained about missing semicolon before left bracket.
var image:Loader = new Loader();var target_image:URLRequest = new URLRequest("images/" + xmlData.Product[i].id + ".png");image.name = "image_"+[i];
image.load(target_image);
[code].....
View 3 Replies
Jan 31, 2011
I am trying to create a function, wherein depending on the numeric value of a certain variable, a particular movieclip is loaded into a holder movie clip.This is how I would want the code to work...excuse the syntax as I am not very familiar with Actionscript 3.
if(count1 == 1){
if(count2 == 2){
holder.addChild("nameofclip"+count1+"secondpartofname"+count2);[code]...
Also, can I create classes dynamically in a similar manner?
View 2 Replies
Dec 3, 2007
When I want to loop through instance names like: "tile1", "tile2" etc. I use a code like this:
PHP Code:
for(var i=0;i<=10;i++){
this["tile"+i]._x=300;}
But when I put these MC's inside an MC (which I've named: "ground") for some reason this code:
PHP Code:
for(var i=0;i<=10;i++){
_root.ground.this["tile"+i]._x=300;}
doesn't work. Is there a way to loop through all the objects inside a movieclip without giving each one an instance name?
View 4 Replies
Jun 29, 2008
var c = mainSubThumbs.SubThumbsHolder[materialType].subthumb_mc[id] what i have obviously doesnt work. materialType and id are my variables that I want to be added onto these mc instances..
View 9 Replies
Oct 17, 2011
I'm looking to get some information on something I've been wondering about for a while now. Is it possible to call a dynamic movieclip? Here's an example: I have 30 movieclips all named sequentially: A001, A002, A003, etc. I want to make a listener to dynamically know if I've clicked any one of the 30, but also know which of the 30 I've clicked.
You know, to avoid writing 30 variations of a listener. (not to mention that I have 5 categories to do this for, meaning there are 150 in total) Perhaps what I would need out of it would be the number value, as well. To perhaps place that in a variable after it has been recognized, so I can use it in the function.
View 13 Replies
Nov 8, 2010
Is there a way to obtain a reference name of each item on the stage. A reference name that can be then used to manipulate the object? (and how would one do that if successful in obtaining the name?)
As an example that is not working for me, if I drag to stage two movie clips and dynamically include 5 additional movie clips at runtime, this [code]...
View 2 Replies
Apr 30, 2009
In the AS2 days you could create an array and add a bunch of Mc names to it like so
Code: Select allarray("clipA","clipB","clipC", etc..)
Then you could use this array to reference clips dynamicly or on stage to do stuff.I was trying to do the same with AS3 but came across a problem I've not found an answer to yet. I created the following code:
Code: Select allvar letterArray:Array=new Array("A","B");
var buttonArray:Array = new Array();
//
[code]....
Now with the line:
Code: Select allvar currentButton:MovieClip = buttonArray[i];
I get: Type Coercion failed: cannot convert []@369e8581 to flash.display.MovieClip.but if I remove that line, it works. My problem is that I need to make it a "var" of type movieclip before I can assign a listener to it. Why can't I build an array of movieclip names using:
Code: Select allbuttonArray.push(["button"+letterArray[i]]);
I have seen arrays in the past that contain:
Code: Select allarray(mc1,mc2,cm3, etc...)
but notice that it's just using the name of the clip and not array("mc1","mc2","mc3", etc..)
View 6 Replies
May 1, 2011
I am writing a program where I have used multiple movieclips (boxes) that are put into a grid using a nested for loop.
Each movieclip is in an array and I want to give them names (box1, box2, e.t.c) but when I try to trace() them i get this in the output: "[object gridBox]".
[Code]...
View 4 Replies
Jul 31, 2009
I have this movieclip that i made in flash. How would I go about duplicating it and giving its parts instance names using AS3?
View 3 Replies
Apr 18, 2011
i made a custom class where i would like to create x instances of a movieclip. But the following doesn't work:
[Code]...
I keep getting the error: Scene 1, Layer 'Layer 1', Frame 1, Line 5 1119: Access of possibly undefined property Collector through a reference with static type CustomClass.
View 3 Replies
Sep 12, 2009
The movie I'm creating will have many movie clips on each frame and each will have a mouseover tooltip.I have the code set so that I can mouseover a defined movie clip and I properly get the tooltip.[code]This works, where n1 is the instanced name of the movie clip.What I want is to be able to define a variable "whichNav" that will dynamically change to a movie clip instanced name when I mouse over that movie clip, then I can replace "n1" in the above code with "whichNav" and not have to remake the above code for every movie clip in the frame.For example, I could have movie clips instanced as n1, n2, n3, n4... ect. I want a variable that will track which movie clip I have my mouse over, and input that variable into the above code to create the tool tip for each movie clip.
View 3 Replies
Feb 16, 2011
Is it possible to create one or several instances of a movieclip from the library with variable names
my1_mc
my2 _mc
.........
my5_mc
so that I can make a function that will use the name of any of these movieclips.
View 4 Replies
Aug 26, 2010
We've got an Illustrator file with something over 1,000 layers. We're trying to import this into Flash and keep the layer names intact, such that they become the names of the movie clips that are imported for each layer and can be used programmatically. (It is a diagram and arrows, boxes, etc all have callout names that will eventually allow them to link to a database.)As near as I can tell, the Import dialog will NOT pass this info across between the two parts of the dialog.
View 1 Replies
Aug 16, 2011
I have a virtual on screen keyboard for a touch screen interface. I get the name of the key (Q, W, E, etc) by calling event.currentTarget.name Now each button is a movie clip with a small animation and I need to know which key is pressed so it can call the relevent movieclip..Below is the code:
[Code]....
View 1 Replies
Mar 10, 2012
I have an Arrays that contains the names of MovieClips:
Code:
var MyMCs:Array = ["A","B","C","D","E"];
The actual MovieClips names are "MC_A", "MC_B", etc..., I use this method so I reuse the same Array for multiple tasks, I simply add what ever it's needed to the name to match the task at hand. On this case I add "MC_".
Then I have multiple Arrays, with the same names of the values of MyMCs. The values of each these Arrays are the names of buttons that are inside the movieclips of MyMCs:
Code:
var A:Array = ["RR","TT"];
var B:Array = ["YY","UU"];
etc...
I could add a listener to a button this way:
Code:
MC_A.YY.addEventListener(MouseEvent.CLICK, DoSomething)
My problem is that i want it to be done dynamically, using the Arrays values in a loop to add Listeners to the all buttons. The loop system is not a problem for me... my real problem is in the dynamic attribution itself.
Here is what I have:
Code:
//'i' and 'j' have previously been created
for(i=0; i<MyMCs.length; i++){
for(j=0; j<this[MyMCs[i]].length; j++){
[Code]....
I know that this is correct since I tried them separately and I can trace the proper values.
I know that my problem is in the "this" since I get an error message stating:
1084: Syntax error: expecting identifier before this.
I suppose it should state something else... I tryed with "root", "parent", "child", "MovieClip"... with no luck...
View 2 Replies
Mar 20, 2011
I started a thread about a reference to a symbol House, in the output window, which was: House_1. A lot of people said some useful things about that. All day I've been thinking about it, and I came to the conclusion that I don't understand things, at a very basic level.
Consider:I make a movieclip which I give the Symbol name Drawer. (I don't export it for AcitonScript.)On the stage I manually place two instances of this Symbol. The first one I give the Instance Name drawer (in the properties panel). The second one I leave nameless.Now if I trace the names of both these clips, by
trace(this.getChildAt(0).name);
trace(this.getChildAt(1).name);
the output window gives me
drawer
instance2
Now I know that the so-called "instance name" which I gave in the Properties Panel (drawer) is, in reality, a variable name which Flash gives my first instance behind the scenes. And instance2 is a name that Flash gives my second instance. What exactly the nature of that name is, I do not know.My point is: both names (drawer and instance2) are the .name property of these movieclips. Otherwise I could not have traced them through asking for the .name property, in the above. Yet only the first of these two can be manipulated:
drawer.x can be set;
instance2.x can (as we know) not be set.
But...why? What is the real difference between these two kinds of names? How can they both be the .name property of their underlying movieclip, yet be of such a different nature? What IS the nature of the instance2 name? If it's a String, how come the .name property of one movieclip can be a variable name, while the .name property of another (but identical) movieclip is a String?
I've searched every bit of web page on the net I could find. But it looks as if nobody addresses this issue. We all just work with it - but it makes no bloody sense. A name property = a name property, you'd think. Whether Flash set it or I set it should not make a difference. The x property of a clip, for example, does not change in nature according to who set it - me or Flash.So, again, just to emphasize the problem: how can a property (the name property) of a movieclip change in NATURE depending on who set it? After it's been set, shouldn't the name property of a clip be of exactly the same nature as the name property of another clip?
View 8 Replies
Jul 25, 2010
My XML code is this
[Code]...
Now I try to load text from one movieclip, which I call the array test[i] from this movieclip, I call the array but my output says undefined Here is the simply code that I have create inside the movieclip, the instance name of dynamic text is txt txt.text = test[i];
View 14 Replies
Sep 12, 2007
I have a named movieclip instance coming up undefined in AS2/CS3. the movieclip is on the stage, and I am having trouble accessing it from actionscript. does anyone have any ideas what might be causing the problem?
View 1 Replies