ActionScript 2.0 :: Storing A Movieclips Instance Name In A Variable?

Feb 21, 2010

I have a movie clip and inside that movie clip there is a button. I will be copying this movie clip 40+ times. When you click the button it must seek out the reference name of the movie clip it is nested in. The point of the script on the button is to make all other boxes but its self vanish. The script needs to know what box it is so it can make all boxes but it's self vanish. I know that _name returns the name of the object the code is on but what about the movie clip the object is in maybe _parent._name?

View 5 Replies


Similar Posts:


ActionScript 3.0 :: Use A Variable(text) To Reference A Movieclips Instance Name?

Nov 28, 2010

i want to use a variable(text) to refrence a movieclips instance name

Code:
function InventoryShow(event:Event):void
{
var SC:URLVariables = new URLVariables(event.target.data);

[Code].....

View 1 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

ActionScript 3.0 :: Storing Instance Names In An Array?

Feb 5, 2010

I have just started actionscript after a long break, I am creating a crossword and each box is an 'Input Text' field. Since there are a lot of text fields, I do not want to have to create variables for each text box,I wanted to do something like this:

ActionScript Code:
var inputs:Array = new Array( "_1a", "_1b", "_1c" .. );
for( var i:int = 0; i < inputs.length; i++ ) {

[code]....

View 3 Replies

ActionScript 2.0 :: Storing And Using Data From PHP In Movieclips?

May 5, 2007

I'm currently having abit of problem with splitting some data and inserting it correctly.On screen I am going to have 3 movieclips (with a dynTextfield already placed inside them).Using data imported from PHP I plan to put the project names of the returned results inside the movieclips. The problem with this is if the results are more than 3 then there aren't enough movieclips. To over come that I was thinking of using a 'more' button where the project names would get pushed out of the movieclips and the new set loaded in/along.

At the present moment I can split the data (received from PHP) and trace it accurately, although I'm not sure how to go about storing it now. I was going to use and Array and store to store the info and call it in the buttons, however I haven't used arrays before.

Code

Code:
function fetchInfo(){
//Query DB for existing projects:
fetchProjects = new LoadVars();
fetchProjects.userID = _global.UserID;

[code]....

At the moment in my test there are 2 results that are returned.

View 1 Replies

ActionScript 2.0 :: Storing Dynamic MovieClips In Array?

Jun 22, 2004

I am trying to create a menu which is 100% on the fly. the menu item names are stored in a multidimensional array with attatched sub menu items/names. I am trying to create a mc and a txt field for each item in the top menu. I am trying to also store the newly created mc's and txt fields in an array or their own so I can manage the menu motions/tweens better. However, I get several errors, why wont this work?

Stage.scaleMode = "noScale";
Stage.showMenu = false;
//Global TimeLine Reference
_global.gTml = this;
[Code] .....

View 5 Replies

ActionScript 2.0 :: Storing Variable To Use In Another Movieclip

Jan 5, 2011

This script from MC 1 loads an template from the library and then creates as many instances as the XML says.

It also creates a dynamic variable called ppp. This variable i want to store in each of the newly ceated instances and then use it in another movieclip to load the right path where i want to load another xml file in Flash....

This is what i want to accomplish:

xmlData.load("albums/album"+ppp+"/images.xml");

This code is in another movieclip (MC2) and gets loaded in frame 5 of MC1.

Another soltuions is if it is possible to read the value that is loaded in the dynamic textfield nummer_txt from the template:
Actionscript Code:

[Code].....

View 2 Replies

Data Integration :: Storing Value From XML Into A Variable?

May 17, 2006

There is a combo-box by the name "cbJobs" and it gets its value from the XML file named "data.xml".. I want to store the value transferred from this XML file into a variable.. so basically someone told me to use the code

on (change) {
_root.subject = this.getValue();
}

the only problem with this code is that it gets activated only after I "change" the value in combobox by pulling it down.. I want to use this value obtained from _root.subject as a subject in the script

getURL("mailto:abc@abc.com?subject="+_root.subject);

View 1 Replies

ActionScript 2.0 :: Storing A Number To A Variable?

Jul 28, 2009

I have made a variable and am trying to store it as a number that the user enters from an input text field. I am trying this, but it does not work:

var myNumber:Number = myTextField.text;

when i trace myNumber, it comes out blank. How do i get the variable to be the number that is typed in the myTextField?

View 9 Replies

ActionScript 3.0 :: Storing Movieclip Name In A Variable

Oct 14, 2009

I am trying to create a navigation where a button is highlighted with a glowfilter when clicked and then unhighlighted when another is clicked. I have this code that I think should be working, but for some reason the variable lastClicked is never assigned and always returns null.[code]

View 4 Replies

ActionScript 2.0 :: Array Storing An Increasing Variable?

Apr 2, 2011

i want to make the elements for an array, each one i++........so

ArrayOne = Array()
ArrayOne[i] = i
i++

make it work so the array would liik like....

ArrayOne = [0,1,2,3,4,5,6,7...]

View 2 Replies

ActionScript 2.0 :: Array Storing An Increasing Variable

Jun 10, 2011

i want to make the elements for an array, each one i++.[code]can somone make it work so the array would liik like.ArrayOne = [0,1,2,3,4,5,6,7...]

View 1 Replies

Data Integration :: Storing And Changing An External Variable?

May 4, 2007

I need to hold a couple of variables in an outside file that can be incremented by user activity -- not just during one interaction with the swf, but with every one.I have no problems with using loadVars and I get the loadandsend process; it is just that I have
no background in cgi or asp for holding the variable and being able to update it.I know I cannot write to a txt file -- that is what I have been using thus far with loadVars for importing values, but this will not help me here. I know it should be a fairly simple script -- I also know I ought to pick up php, but for the moment -- until a greater amount of time comes my way -- I turn to you.

View 3 Replies

ActionScript 3.0 :: Storing Number Inside A String Variable

Mar 16, 2012

For my calculator i am having trouble storing a number inside a string variable.

[Code]...

Calculator, Layer 'actionscript', Frame 1, Line 1441061: Call to a possibly undefined method append through a reference with static type String.

View 5 Replies

Actionscript 3 :: Storing Multiple Images In A Variable With In Flash Builder 4.5

Dec 6, 2011

I have a flash assignment that. The assignment is to create an application for playing a card game, I have to create an MXML component that has two variables, one variable stores the image of the back of a playing card, the other variable has t store all 52 options of a front facing card (the second variable will store over 50 images).

I've written the variable for the back of the card image like this:

[Code]...

View 1 Replies

ActionScript 3.0 :: Flash Storing Number Inside A String Variable?

Mar 16, 2012

For my calculator i am having trouble storing a number inside a string variable.

Calculator, Layer 'actionscript', Frame 1, Line 1441061: Call to a possibly undefined method append through a reference with static type String.

Code:
var currentNumber:String ="";
function pressNumber(e:MouseEvent):void{
display_txt.appendText(e.target.num);
currentNumber.append(e.target.num);//error here
}

View 7 Replies

ActionScript 3.0 :: Controlling Variable Movieclips (within Variable Movieclips?

Nov 3, 2009

on my main timeline there is a movieclip ("sampleMc") which contains a number of labeled frames containing movieclips of gallery images (for example "dyerBikiniMc"). in turn, each of THESE movieclips contain a number of frames of detail shots of the main image (for example "dyerBikini00Mc, dyerBikini01Mc, dyerBikini02Mc, etc.").on the main timeline i have a gallery navigation bar with thumbnail buttons determining which image will be displayed. there's also a right arrow shaped button "detailsBtn" that i'd like to allow the user to click frame-by-frame through the detail shots of the image. i also have a before/after toggle button on the main timeline that needs to control the movieclip one level below that, where the before/after images of that particular detail shot are stored!

View 9 Replies

ActionScript 3.0 :: Create New Instance() When Instance Is A Variable?

Feb 12, 2012

I have a base class I've used on 6 different MC's. Then when I use these MC's my function runs an if statement to check which one to add.

if(id=design) var obj = new design();
if(id=team) var obj = new team();

I want to make it a bit more dynamic and use the id:String to evaluate which new instance to create.

ActionScript Code:
public function loadChapter(id:String):void {
var obj = new instance_of( id )();
}

View 5 Replies

ActionScript 3.0 :: Variable Storing Whether The Player Is Selected To Be Passed Back To The Actual Grid Class

Feb 16, 2009

I'm trying to make a game that is turn-based and allows players to first be selected, then click on a grid square to move there. However, I can't get a way for a variable storing whether the player is selected to be passed back to the actual grid class. I want the grid class to have an event listener that when the grid is clicked on, it will move the player there only if the player is selected. But whenever I try to declare a global variable either inside the grid class or even a document class or even access properties of the character class I'm trying to move I get errors.

View 5 Replies

ActionScript 3.0 :: Variable Of Null Value Assignment To A Variable Or Instance Flash?

Jan 7, 2010

As we know whent here is no such variable of null value assignment to a variable or instance flash throws this kind of Error.In one of my Application i need to get more flashVariables, They may or maynot come as FLASHVARS. But when i miss any variable flash thows this error as an alert box. is there any simple solution to avoid this kind of issue
 
when i use try,Catch statement the issue will not come, But i don't like to write Bunch of try,catch statement for all this kind of variables.

View 4 Replies

Actionscript 3 :: SWC Instance Name On Movieclips?

Feb 18, 2010

Is it possible to compile movieclips to swc with the instance name as property name? This happends when I add a dynamic text field, but i would like this also on some UI elements.

View 1 Replies

Flash :: 2 MovieClips With The Same Instance Name

Jan 27, 2012

I have 2 copys of the same Movieclip on the timeline and I need them both to do the exact same thing, so I figured I'd give them the same instance name.

I have an event listener on the stage that listens for a mouse click and then checks what has been clicked usiing a switch statment, but the switch statment only picks up one instance of the movieclip, the other one comes up as the default.

Mainly what i'm asking is, is it possible to have to movieclips on the timeline with the same instance name?

public function Main() {
stage.addEventListener(MouseEvent.CLICK, doStuff);
}
public function doStuff(e:MouseEvent):void {

[Code]....

View 2 Replies

ActionScript 3.0 :: Same Instance Name In Different MovieClips?

Aug 28, 2010

I've been working on a game recently. I wanted to know if I can have two movieclips (Tabl1_ON & Table2_ON) have the same instance name, as long as they are in different movieclips. Will it cause an error? or will AS3 be kind to me.

View 1 Replies

ActionScript 2.0 :: MovieClips On Stage - Get Instance Name (Box)

Feb 3, 2009

I have one MC on stage with instance name "box". That MC duplicates by using this script:
Code:
duplicateMovieClip (box, newname="box2", this.getNextHighestDepth());
box2._x = xPoz;
box2._y = yPoz;
So the new MC is now called "box2".

Inside original MC "box", I have one button. After click on that button, I need to know on which MC I clicked. box, or box2. I tried to use:
Code:
trace (this._name);
But, that get me only instance name of the button.

View 4 Replies

ActionScript 3.0 :: Different Movieclips Same Instance Name - HitTest

Jan 3, 2011

I'm creating a platform game, and I have those boxes which needs hitTests on all sides - including the bottom.I want my hit areas to have the same instance names. With that I mean, that I want only one instance name for all the bottom hits, one instance name for alle right hits - and so on. If it's possible. 'Cause else there will be so much actionScript code to write.I've been trying to simply make a normal hitTest on for example hitGround, and then place two movieclips with the instance name hitGround, but the hitTest function only works on the last added movieclip with that instance name.I have also been trying to look up some for each in-arrays, but I don't really get the meaning of how to use them.

View 2 Replies

ActionScript 3.0 :: Multiple MovieClips With Same Instance Name?

Apr 27, 2011

I'm following a tower defence tutorial and part of the code is set up so I can build towers on the "grass" movie clip. I wanted to add more patches of "grass" and gave them all the same instance name so I can be able to place towers on them, but I have the problem that I can only place towers on the first item I placed and has the instance name of "grass". I can't seem to place towers on the other patches of grass.I removed the instance name of the first patch of grass and it let me build towers on the second patch, but the second patch only.

[Code]...

View 1 Replies

ActionScript 3.0 :: Generate Movieclips / Instance Name And Position

Nov 1, 2010

I've got a movieclip in my library called primaryCommMC.I'm loading these 5 times onto the stage and naming them commMC0-4 using the following:[code]Right now they're all obviously loading on top of each other. I want to stack these movieclips on top of each other so the first movieclip will be at y=0 and the following at y=(the height of the proceeding MC + 5 (a little gap)).

View 1 Replies

Flash :: Same Varible In An Instance Of Multiple Movieclips

Feb 4, 2010

It might sound confusing so let me explain the situation. I made a movieClip. And in that movieClip I have a dynamic textfield set. I called this textfield "AmmoCount".I dragged this movieClip onto the stage several times and each time I called on the AmmoCount varible in each movieclip and gave it a different value. I get the following error TypeError: Error #1009: Cannot access a property or method of a null object reference.[code]

When I trace these objects, weapon1.AmmoCount works, but weapon2.AmmoCount shows as empty. Yet they both contain a value in them. Ive used the weapon1 property and weapon2 property countless times and there is no doubt that it works. so why doesnt it work for weapon2. but for weapon1. Below is some code that I called on earlier that shows they work.[code]these worked! but when I called on the AmmoCount text box within them, I get the error. The following image you can find within the weapon1 movieClip

View 1 Replies

ActionScript 2.0 :: Using SetInterval With MovieClips - Instance Not Been Scoped

Dec 18, 2009

I have created a number of Movieclips as part of my Navbar such as About Us, Contact etc. I'm using setInterval to send them to a function that springs them open one after another using the tween class. The they are dynamically generated and positioned using the following code, however when I want to use them as buttons by using onRollOver or onRelease they act like I'm not scoping them correctly. In other words the cursor does not change into a hand when over them. This is a setInterval issue as if I have them open just using attachMovie, the scoping works just fine.

The actual code is as follows:
function aboutUs () {
var mcAboutUs:MovieClip = this.attachMovie("mcAboutUs", "aboutUs_mc", 20, {_x:197, _y:520});
var x_elasticTween:Tween = new Tween (aboutUs_mc,"_xscale",Elastic.easeOut,0,100,1,true );
var y_elasticTween:Tween = new Tween (aboutUs_mc,"_yscale",Elastic.easeOut,0,100,1,true );
clearInterval(_global.intervalID1);
} function setIntervals() {
_global.intervalID1 = setInterval(this, "aboutUs", 1000);

There are more in here, each going to its own function to attachMovie and Tween them. This all works fine.

setIntervals();
this.aboutUs_mc.onRelease = function() {
OnRelease is suppose to activate another function that generates the "About Us" page but nothing happens as if the instance is not been scoped.
page_aboutUs();
}

View 2 Replies

ActionScript 2.0 :: Cat 1 And Cat2 Are Instance Names Of Movieclips

Oct 28, 2010

cat 1 and cat2 are the instance names of the movieclips when using the trace command to find out the values of the array this returns both movieclips undefined.Is that correct output window (undefined; undefined)how can trace name of movieclips in the array.[code]

View 5 Replies







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