ActionScript 3.0 :: Assigned Versus Dynamic Instance Names?

Jul 12, 2010

When I use a Mouse Event listener with the trace function trace (e.target.name), why don't I get the instance name I assigned in the property panel? Instead I get something like "instance 12". How can I target Mouse Events using the names I assgn?

View 2 Replies


Similar Posts:


ActionScript 3.0 :: Dynamic Hit Testing Against Dynamic Instance Names?

Jun 22, 2010

Ok, Background. I have two objects both of which im spawining in though code. We will call them bullets and wolves. They have their own .AS files which tells them everything they need to know about themselves. I figured i would do most of the hit testing on the bullet.AS file, hit testing against the wolves as there were going to be a set number of wolves but not a set number of bullets.o, I named them by running a loop and putting the linenewWolf.name = i.toString();Yes, new wolf is a declared variable, and i is the name of the variable that makes the loop run. I also have a test in it, and it works fine.

However, The hit testing is where i come into an issue. Remember, its on a seperate .AS file. The wolf maker and namer is on the main flash page.The hit testing function isif(this.hitTestObject(a)){i changed up my variable name to run a second loop. first variable name is "i" and the second variable name is "a"And for some reason i get a type error 1034, which from what i understand is an error that you get when two instance names are the same. Also, If possible, i would like to add letters to the name of the object, but im not sure if flash will let me as i belive the code would look something like this

View 1 Replies

ActionScript 3.0 :: Dynamic Array Instance Names

May 28, 2009

This should be simple but I can't come up with or find the answer anywhere. All I want to do is create a series of Arrays with instance names generated on the fly. I then want to reference these later. I have a "for" loop with a variable "count" that I want to add to a base name of rowArray and use the result to create an Array. I would think that it would look something like this:

[Code]...

View 2 Replies

ActionScript 2.0 :: Dynamic Text And Instance Names?

Jan 7, 2011

I have a series of instances with a dynamic textbox in them....The instances are simply named p1, p2, p3 etc...

I want the dynamic textbox to show the instance name if possible..

View 3 Replies

Actionscript 3 :: Dynamic Instance Names - Create X Instances Of A Movieclip

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

ActionScript 3.0 :: Instance Names And Variable Names: It Goes Deeper

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

ActionScript 2.0 :: Delegate Versus Instance?

Aug 14, 2007

when i'm coding directly on the timeline, i usually create a var like this:

Code:
var home:MovieClip = this;

so i always have something to reference the main timeline's scope. how could i do this in a class? delegate.create gets a little confusing.

i tried a few things like the following:

Code:
class com.myClass
{
public var className:String = "myClass";
public static var version:String = "0.0.1";

[code]...

of course this is redundant because it'll scope just fine as parseNews();, but i'm just wondering why it's letting me scope it like this here and not in the onLoad declaration?

View 6 Replies

Actionscript :: Static Versus Instance Methods

Dec 23, 2009

I'm working on a video player and I initially developed the player with everything in the .FLA file with no classes. Then I started modularizing my player into classes and realised that my classes are static methods rather than instance methods which doesn't seem to be needed in my player. My question is - is this a bad design to have all of your classes methods to be static rather than instance methods ? As I dont see the need (yet) so that's why i geared more towards static methods, is this a bad design?

View 1 Replies

ActionScript 3.0 :: Loading Dynamic XML And Images Into Assigned MovieClip

Jan 8, 2012

I have written the following to send variables to PHP which searches a MySQL database and returns the results in XML. However I cannot get the XML data loaded into the assigned Movie Clips. I think the problem might be somewhere in the URLLoader.
var imageDir:String = "Images/";
var getImage:XML;
var imageList = new Array();
var newPic:MovieClip = new MovieClip();
var thumbnailGroup:MovieClip = new MovieClip();
var loadGallery:String = "getImage.php";
[Code] .....
The remaining script (not included) handles the loaded data but is there an obvious problem I have overlooked in the above?

View 2 Replies

ActionScript 3.0 :: Creating A New Instance Fails When Base Class Is Assigned To An External Class File?

Jul 22, 2009

I'm trying to create a new instance of a MovieClip when the original one has been used. Would sound easy enough. Just use: var

instanceName:ClassName = new ClassName();

the class name/mc in the library im trying to duplicate is MCg1 so

var instanceName:MCg1 = new MCg1(); right?

However, the particular object in the library i'm trying to duplicate has a base class that is an external class file (just to control it's drag drop functionality)... i.e baseclass is not set to the standard flash.display.MovieClip, or whatever the case maybe. So i end out with a: TypeError: Error #1009: Cannot access a property or method of a null object reference.

View 6 Replies

ActionScript 3.0 :: Php Versus Textfile Dynamic Text?

Sep 27, 2011

i am at the last part of my project. it worked all well and reads all text fields from a text file as seen on :[URL]now i am trying to get the same thing working from MYSQL.Notice that the text file i used for index2.html is called [URL]and it was a direct copy/paste from the php page that gave the results from the MYSQL query. [URL] The problem is i am getting an error in [URL] which uses the php to get the text for the dynamic fields.
 
I get the following error:

TypeError: Error #2007: Parameter text must be non-null.
at flash.text::TextField/set text()
at final_fla::MainTimeline/onDataLoad()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
 
my flash movie has 113 buttons called button_1 --> button_113 and 113 dynamic text fields tcname_1-->tcname_113
my AC3 code is the following:
 
// button links: to all buttons to open in iframe 'tdes'
// link corrosponds to button number
// i have 113 buttons.

[code]....

View 5 Replies

ActionScript 2.0 :: Use Instance Names Such As '1-1'

Mar 17, 2010

I have a grid 8 columns, 3 rows.I used instance names such as 1-1, 1-2, 2-1, 2-2, ect to easily identify each cell. I can call the movieclips within them without a problem by doing this["1-1"].gotoAndPlay(1); but how do I go about calling them when I can't use "this"? "1-1".gotoAndPlay(1); does not work.

View 2 Replies

IDE :: How To Replace Instance Names

Jan 26, 2009

In the first frame I have 60 buttons with each having a actionscript in it using the instance name "A1". What I need to know is how can I REPLACE the instance name from A1 to B1 in 60 buttons in my NEXT FREAME?

Is there an easy way to do it rather than typing one by one?? I used the "FIND AND REPLACE" option but it replaces A1 to B1 in both the frames. I need to alter the instance name only in the second frame. How can I do it?

View 3 Replies

IDE :: Instance Names Given In The Editor?

Apr 26, 2009

I have two buttons, they're both movie clips, and have identical code except for their names. When I place one of each on the stage and give them instance names, they come up output:

[Code]...

View 1 Replies

ActionScript 1/2 :: VAR Instead Of Instance Names?

Sep 14, 2010

How to write the following AS codes using VAR instead of instance names?

my_Input_Txt.onChanged = function() {  _root.my_Dyn_Txt5.text = my_Input_Txt.text;_root.my_Dyn_Txt6.text = my_Input_Txt.text;}; 
_root.my_Dyn_Txt5._visible = false_root.my_Dyn_Txt6._visible = false_root.MDT1._visible =

[code]....

View 7 Replies

ActionScript 2.0 :: Dynamic Versus Static Font Rendering

Aug 7, 2007

Anyone ever notice that Flash renders the same font totally differently depending on whether its a static or a dynamic textfield? It's really frustrating when you're trying to make everything look consistent, and it looks like you are using two different weights of the same font.

View 2 Replies

New AS File Won't Recognize Instance Names

Jul 15, 2009

I get the error "Access of undefined property menu_bar" when menu_bar is an instance name directly on the main timeline. I'm not sure how I would call it in the other class. It also isn't exported for actionscript is that the problem?

I have it imported to my document class as:

var mouseClicks:MouseClicks = new MouseClicks();
addChild(mouseClicks);

Then the class looks like this:

Code:
package{
import flash.display.MovieClip;
import flash.events.*;

[Code]....

View 2 Replies

ActionScript 3.0 :: Instance Names Getting Changed

Mar 4, 2010

I know I've read something about this here before but I can't find it, so for Mr. Thicky here, I have dragged some buttons on my stage - each one is actually an instance of the same movieclip. In the IDE, I have given them instance names like 'myButton1', 'myButton2' etc. I've then grouped all these buttons together into a single container movieclip called 'buttonHolder'. Now, in my code, I am trying to retrieve the instance name of the button I have clicked on:

[Code].....

View 3 Replies

CS3 Give Instance Names Quickly?

Jun 3, 2010

I have 100+ of the same movieclips on the stage at the same time, all positioned differently.i'm getting really tired of clicking on one of them, then clicking in the instance name box then typing "i65", then clicking on one of them, then clicking in the instance name box then typing "i66"...

is there anyway flash can fill this information in for you? or a plugin anyone's heard of? this isn't really an actionscript question, I'm not so fussed about selecting the different movieclips based on getChildAt or any of that stuff, I'd just really like a faster way of assigning instance names.

View 1 Replies

Shortcut To Assigning Instance Names?

Oct 22, 2010

I have a 4x4 set of square buttons that I need to give instance names to. They will be named 'btn_1' thru 'btn_16'. Is there any shortcut to assigning the names or do I have to go through 16 times clicking on the button and clicking down to the 'instance name' text box?

View 2 Replies

Find And Replace Instance Names?

Oct 4, 2011

I am working on making a photo flip animation between 5-7 photos but i have to duplicate this 70 different times. So what i have done is made a scene for each set of 5-7 photos, they are externally being pulled in through an AS3 script to prevent a large .swf file from happening with all those photos. The problem i am running into so that i cant seem to run a find and replace search to replace the instance name values.

View 1 Replies

ActionScript 3.0 :: Tween And Getting Instance Names?

Feb 3, 2009

iv got these buttons animated using the inbuilt tween function and am coding them like this:

function navOver(e:MouseEvent):void {
var page = MovieClip(e.currentTarget).buttonThumb;
var myTween16:Tween = new Tween(page, "y", Regular.easeOut,
0, -25, 0.35, true);

[code]....

MovieClip(e.currentTarget).instanceName returns undefined neather of which are the instance name.i cant hardcode the function because its used on lots of different mcs throughtout the flash file

View 4 Replies

ActionScript 3.0 :: Getting Movieclip Instance Names?

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

ActionScript 3.0 :: Hit Testing Without Instance Names?

Jun 18, 2010

I know its possible to hit test From something without an instance name if you have it in a seperate .as file. All you have to do is type in this.hitTest(InstanceName);

But, Is it possible to do a hit test from something without an instance name against something else that doesn't have an instance name?[code]...

View 16 Replies

ActionScript 3.0 :: Using And Storing Instance Names?

May 30, 2011

I know you can store instance names in an array and call on the array values to reference the instance names in it.I was wondering if there is any way I can take an instance name, feed it directly into a function and use the name of the function variable/array/whatever to affect the object instance of whatever I name.

if it's an array of instance names, what is it actually an array of? Also, is there any way to hold and reference an instance name in a single value? sidenote: this doesnt have much to do with my question, but can arrays be fed directly into the header of a function?

View 6 Replies

Flash :: Complaining About Instance Names?

Nov 13, 2009

I have a Flash CS4 FLA throwing the following error when I hit Ctrl+Enter to test the movie: WARNING: Multiple 3D objects on the same frame have the same instance name. 3D instance names must be unique. All but one of the instances will be renamed during export. On my layers, I can't see any duplicate instance names, and Flash doesn't give me ANY indication as to which names are causing the problem. I know it's to do with two layers making use of 3D Tween. When I hide them, the problem goes. I've even tried removing and replacing the Symbols. First of all, I have to have the objects on those layers Tween in 3D, and I have to give them instance names as I refer to them from ActionScript code.

View 2 Replies

ActionScript 2.0 :: Indexing Instance Names?

Jan 13, 2011

I have a series of movieclips which I want to use as buttons.The instance names of the clips are as follows: "ms1", "ms2", "ms3" and so on...I want to put frame actions on these buttons, so that when the mouse rolls over on them, the button movie clip changes frame. I created an array to store instance names and then referred to it for actions, but the problem is that although my buttons do work, but when I roll over them, the button doesn't move to its next frame.

Here is my code:
ActionScript Code:
var men:Array=new Array();

[code]......

View 1 Replies

ActionScript 2.0 :: Duplicate Instance Names?

Apr 19, 2005

I haven't seen much to explanation of this in any Flash documentation,but maybe someone knows more about this. Initially I was trying tofix a buggy application. The app is fixed now, but I'm still curious.I have an app that defines some object instances (buttons and movie clips)in various frames and on various levels of a timeline. For any object thatneeds to be manipulated by AS, I give it an instance name. However, there's no safeguard against giving several instances the samename. So, I experimented with giving two buttons, on differentlayers and different frames, the same instance name ("playbtn"). Then I defined an event handler:

playbtn.onRelease = function () {
gotoAndPlay(1);
}

[code]....

View 1 Replies

ActionScript 2.0 :: Instance Names And Functions

Oct 19, 2005

im trying to use a function in a timeline to identify a symbol and do some stuff with it.

on the movie clip
onClipEvent (load) {
_root.test(_name);
}

[Code]....

i've tried some different things, such as eval, but can't get anything to work.

View 1 Replies

ActionScript 2.0 :: How To Assign Instance Names

Dec 1, 2005

I am working with a number of movieclips and I was wondering if there was an easy method using actionscript to assign them instance names instead of doing it manually for each movieclip.

View 8 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved