ActionScript 1/2 :: Referencing A Movie Clip By Using A Variable?

Jun 2, 2009

I have been using this line of code to fade in a movie clip:

new Tween(background_mc, "_alpha", None.easeNone, 0, 100, .5, true);

Now, I want to accomplish the same thing, only this time by using an element from an array (bg_array[currentSlideNumber]) that stores the instance name "background_mc"
 
I've tried the following, but it doesn't work:

new Tween(bg_array[currentSlideNumber], "_alpha", None.easeNone, 0, 100, .5, true);

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Reference Instances From Movie Clips If The Movie Clip Referencing From Is Nested?

Mar 23, 2010

It's me again and I'm running into a problem. So, I have this movie clip that is nested inside multiple movie clips. I want to tell Flash to perform an action when that movie clip hits another movie clip in the main timeline. It's just collision detection for a game using the hitTestObject code. I was thinking of using MovieClip(root), but that won't work since it's nested so much.

View 15 Replies

ActionScript 2.0 :: Referencing Movie Clip On Different Level?

Jan 8, 2009

If I writing actionscript on the _root level, but I want to reference a movieclip that is on a different level, how would I go about doing this?I know that if it was reversed I would something like this:_root.home_btn.onRelease = function () {Would I just do the name of the level, "_level2.home_btn.onRelease = function() { ?

View 7 Replies

ActionScript 2.0 :: Referencing A Movie Clip Within A Movieclip?

Jul 17, 2009

Maybe someone can shed some light on this issue for me. I have a main movie clip, call it Main, that loads external swf files during run time. One of these loaded swfs, or movie clip is called FOB. Inside FOB is another movie clip with a variable name of contentText. What I want to do is to adjust the x location of contentText from the Main movie clip.

Inside the Main movie clip I have this (entire code):

ActionScript Code:
//CREATE MOVIE CLIP CONTAINER
this.createEmptyMovieClip("FOB", _root.getNextHighestDepth());
this.createEmptyMovieClip("PirateClub", _root.getNextHighestDepth());

[Code]....

View 0 Replies

ActionScript 3.0 :: Movie Clip Referencing HTML Page?

Jan 16, 2011

[URL]I am using a flash movie I crated as a menu, outside of the website the movie works exactly as I want and the push pin follows and stays on the last "button" clicked. However when using this movie on my html site since the flash menu gets refreshed the push pin goes back to where I have it starting by default.Is there any way to reference which html page I am currently on instead of the current button in AS3?Code looks something like this...

var currentPage:SimpleButton = home_btn;
tack_mc.x = home_btn.x;
tack_mc.y = home_btn.y;

[code]...

View 1 Replies

ActionScript 1/2 :: Referencing HTML Page From Within A Movie Clip

Mar 18, 2009

I have a simple horizontal scrolling gallery of 24 thumbnails in Flash, the thumbnail images are loaded into the boxes using actionscript. I would like each thumbnail to link to a html page of my choice. There is a movie clip instance called panel with the 24 buttons inside it and on the first button as a test I've placed the following action script:

on (release) {
getURL("team.html","_self");
}

When testing this movie from within Flash (CTRL, ENT) the button links to the html file (which is in the same folder as the SWF) with no problem. The problem is when I preview the page in a browser and try to click on the first button nothing is happening. I've tried it in both IE7 and Firefox with the same result.

The flash thumbnail clip is placed as a flash object into a html page using dreamweaver.

I'm sure this is something simple such as navigating the timeline but I've tried a few things like _root. but still no joy.

View 2 Replies

ActionScript 3.0 :: Referencing Objects In The Level Above The Movie Clip?

Sep 10, 2011

i want to referance objects in the level above the movie clip that i have the AS in.  what i mean is that i have a movie clip on the stage, and that movie clip has some actionscript in it, and that AS needs to refer to an object on the main stage, how would i do that?  i have tried parent and stage 1, but neither seem to work

View 4 Replies

ActionScript 1/2 :: Referencing : Duplicated Movie Clip With A Dynamic Text Field?

Jun 23, 2011

I have created a movie clip with the following path to a dynamic text field:
 
_root.i_lotteryball1.i_ballstrip.i_text.d_text1.text = _global.text1;
 
I have then duplicated the 'i_lotteryball1' movie clip, and called it 'i_lotteryball2'.When I try:
 
_root.i_lotteryball2.i_ballstrip.i_text.d_text1.text = _global.text2;
 
It changes the text in  'i_lotteryball1' text field aswell as  'i_lotteryball2' text field with the value of '_global.text2' How can I update each text field with different values.When I try to change the instance name of the text field inside 'i_lotteryball2'  to 'd_text2', it changes the 'i_lotteryball1' text field instance name aswell to 'd_text2'!
 
My objective:
  
_root.i_lotteryball1.i_ballstrip.i_text.d_text1.text = _global.text1;
_root.i_lotteryball2.i_ballstrip.i_text.d_text2.text = _global.text1;

View 7 Replies

ActionScript 3.0 :: Delete A Variable Containing A Movie Clip Class And Recreate It With A Different Movie Clip Class?

Jul 1, 2009

In my project are pages of text with each word having a button that when pressed will display a movieclip presentation about that word (its pronounciation and spelling etc..). In the project I am working on now I have over 450 unique presentations of words to deal with. I don't want to have all of these hundreds of movie clips on the stage and tell them one at a time to stop and rewind and then have one play each time a word button is pressed. That seems to be very inefficient to me.

add movieclips to the stage using addChild(movieclipname) and remove them using removeChild(movieclipname) but there is a problem. I have hundreds of unique movieclips and I don't want to have to manage hundreds of variables containing the indivudual movieclip instancess. It is a real pain having to figure out what instance is still on the stage before i delete it.In Adobe Director all I have to do is this:

View 5 Replies

ActionScript 2.0 :: Set Variable Within Movie Clip?

Oct 30, 2010

On frame 1 of the main timeline I have a movieclip. The 1st frame of the movieclip stops, and requests a password. When the password is correct, the movie clip plays and stops again on frame 2 - where the user enters their name. I've named this variable 'name_txt', and the submit button will only continue if the variable is defined.

The problem comes when I try to get a dynamic text box in the main timeline to show the user's name - it just stays blank even through i've experimented setting the var / instance names to 'name_txt'. I think I have to set the variable to global or something, but cant seem to get it to work.

View 7 Replies

ActionScript 2.0 :: Use A Variable To Name A Movie Clip?

Mar 19, 2004

I am trying to duplicate a move clip and then set some of it's properties with actionscript. What's the notation to do this?

Here is my guess:

Code:
duplicateMovieClip(_root.event, ("event"+i), i);
[event+i]._y = ([event-i]._y)+([event+i].height);
[_root.event+i].eDate = ("4/2"+i);

[Code].....

View 4 Replies

ActionScript 2.0 :: Accessing Variable From A Movie Clip

Aug 30, 2009

I've got a simple ActionScript 1 FLA. The SWF will take incoming variables from SWFObject. e.g. txtVar01, txtVar02, txtVar03 On the first keyframe on the main stage, I have a dynamic textfield, whose 'Variable' name is 'txtVar01'. When I view the SWF in a web page, via SWFObject, the value in the textfield matches that taken from the SWFObject variable. BUT - I have a MoveClip in the FLA, which has 2 other dynamic textfields, called txtVar02 and txtVar03.

When I view the SWF in the web page, these are empty, even though variables are being passed via SWFObject. I guess because the dynamic textfields are within an MC and not on the main stage, they can't access the variable names. I tried adding this to the first frame on the stage:

[Code]....

View 2 Replies

ActionScript 2.0 :: Using A Variable To Target A Movie Clip?

Jul 29, 2010

I found this tutorial which seems to do exactly what I'm trying to do (the only one I've found to date), except his technique doesn't seem to work for me at all. It doesn't really seem to say anywhere which version of Actionscript he uses, but at least it seems to show that what I'm trying to do is possible for someone, which is a start.I'm trying to do exactly what he describes--I have several squares on a grid that are numbered, eg.grid_0101, grid_0102, grid_0103, and so on, for about 100 squares altogether, and I want to be able to target a given square dynamically.This is the basis of the code I started with:

Code:
var digsquare_x:String = "01";
var digsquare_y:String = "03";

[code]......

View 2 Replies

ActionScript 3.0 :: Displaying A Variable In A Movie Clip?

Jan 21, 2010

I've been animating with flash for a while but I've recently wanted to get into game programing. I've learned a lot in the past month and I'm trying to create a fairly simple point and click adventure game with some basic stats and scoring. I'm facing a somewhat simple problem and I'm not sure how to get it to work in AS 3.0.

At the beginning of the flash I've established my variables to keep score while exploring the game.

var Health:Number = 1000;
var Day:Number = 1;
var EXP:Number = 0;
var Money:Number = 1000;

What I'm trying to do though is set up a movie clip with menu options that, when clicked, brings up a screen that displays those stats as well as a couple extra menu options. What I can't figure out to do is how do I display those variable inside the movie clip.

When I create a dynamic text field and place "info_day.text = String(Day);" i get an error unless I create a variable within that movie clip. And when I do that the variables in the movie clip are not affected by the chances of the variables in the main flash.

how do I have the variable in the movie clip to accurately display the variables established in the main part of the flash?

View 4 Replies

ActionScript 2.0 :: Movie Clip Not Getting Initial Value For Variable?

Sep 21, 2010

i am doing a photo album type site where all photos (which are movie clips) appear small and when clicked they enlarge. when the enlarged photos are clicked the movie clip continues and they go small again.

as you'll see from the code below i am doing this by basically saying if the photo is small, play the movie clip from frame 2 which enlarges it until a stop value at 30, and then change the variable value. if the photo is large and then it is clicked play the movie clip from 31 to a stop action at the end and then change the variable value.

everything is working fine except i am not receiving the initial value of the variable "picbtn_position" which is set on the main timeline to value "mainscreen". can anyone help me as to what is going wrong here? maybe i have to do something else to get a variable value from the main timeline to the mc.

here is the code on my movie clip:

on (release) {
if (picbtn_position == "mainscreen") {
trace(picbtn_position);
gotoAndPlay(2);

[Code]....

and here is the code on my main timeline for the initial variable value:

var picbtn_position:String = "mainscreen";

View 3 Replies

ActionScript 2.0 :: Using A Variable In Movie Clip Call?

Aug 4, 2011

I want to use a variable in my movie clip code. Right now I generate a random U.S. state name and assign it to "correctAnswer". Then I want to assign that to myMovieClip.correctAnswer.gotoAndStop("down"); The problem is that the variable is not recognized and is seen as correctAnswer instead of the U.S. state that was assigned to it. My code is below.

ActionScript Code:
// Correct answer is randomly generated and can be any U.S. state name
correctAnswer = "utah";
// Using the variable correctAnswer this should come out as myMovieClip.utah.gotoAndStop("down");
myMovieClip.correctAnswer.gotoAndStop("down");

View 2 Replies

ActionScript 2.0 :: [Flash5]Using Variable As Movie Clip Name?

Dec 3, 2002

I want to cycle through several movie clips for a training application. I plan to use an array to hold the clip names, and a variable (CurrentClip) to set visibility and allow me to use a single pause/ play button throughout. For the visibility, I've found that...
CurrentClip._visible = false; does NOT work. But... setProperty (CurrentClip, _visible, false); does work.

View 2 Replies

ActionScript 2.0 :: Using A Variable Name To Address A Movie Clip?

Dec 17, 2005

how to refer to a movieclip's name through a variable.If I set root variable "currentMovie = bigRed_mc;", how can I use that variable name to instruct the movie to address the movie clip name stored in said variable?

for instance "_root.currentMovie.gotoAndPlay("destroy");" wouldn't work because it would simply look for that movie clip name and come up empty.I thought "_root[currentMovie]gotoAndPlay("destroy"); would work, with or without parenthesis, but it comes up with syntax errors either way. Can you use a variable to store and refer to a movie clip name and it's properties?

View 3 Replies

ActionScript 3.0 :: Using Variable To Reference Movie Clip?

Jul 24, 2008

In AS2 I used to be able to reference a movie clip using a variable like this: Code: var target = nameofmovieclip; I've been looking for an answer on how to do the same thing AS3 but with no luck. I'm trying to create a dynamic homing missle, but unfortunately everything I've tried just generates errors.

View 6 Replies

ActionScript 2.0 :: [MX04] Using A Variable In A Movie Clip?

Nov 7, 2008

I couldn't find anything with Google on how to do this, so I'm posting it.I have a code on the first frame of a movie clip that goes to and stops at a different frame in the movie clip depending on a variable that was set outside of the movie clip. It doesn't work, and the movie clip just plays through like normal

View 2 Replies

ActionScript 3.0 :: Change A Stage Variable From Within A Movie Clip?

Jun 21, 2011

I have a movie clip that is executing some code. When this code is complete, I want it to change a variable that is defined on the stage (root?). I know how to get the condition part of it, but quite literally: what do I put to change a variable located on the stage from within a movie clip?

View 1 Replies

ActionScript 3.0 :: Call A Variable Or Function From A Movie Clip?

Apr 2, 2009

I just need to call a variable or function from a movie clip to main timeline. In AS2 I would use something like:

_root.myvar = "Hola";
or
_parent.myfunc(4,2);

But this doesn't works on AC3. I tried to remove the "_" but its the same.

View 2 Replies

ActionScript 3.0 :: How To Access Variable Within Child Movie Clip

Sep 9, 2009

I have a flash file which uses php to manipulate a database and returns a variable (data_xml) of xml formated data from the database. This happens, along with other things, within the parent. Now I have a child movieclip that displays the parsed data but I am having trouble accessing the variable from within the child movieclip. The code related to this is:

var myXML:XML = new XML();var myXML = XML(event.currentTarget.root.data_xml);

and I get the following two errors which point to the second line as the problem:

1151: A conflict exists with definition myXML in namespace internal.

Warning: 3596: Duplicate variable definition.

I have unchecked "Automatically declare stage instances" because I've seen that suggested for the 1151: error, but I still get the same two errors.

View 10 Replies

ActionScript 3.0 :: Use A Variable Made Inside A Movie Clip From Outside?

May 8, 2010

I have been searching for ages and just cant find out how to do this. i have set a boolean variable inside a movieclip and would like something to change outside the movieclip, using an if statement, depending on whether the variable is true or false, but cant find out how to do it anywhere.

View 2 Replies

Professional :: Statements And Variable Movie Clip Names?

Feb 29, 2012

(problem 1 is that I cannot call buttonmoce this way!)I am really trying to imporve my code writing and using arrays and for will save me writing this code over and over again Cheers sub

[Code]...

View 11 Replies

Flash :: AS3 Add Movie Clip To Stage Using Variable Which Holds The MC Name

Dec 1, 2010

how to add a movie clip to the stage from the library but i'm strugling to do it when the I need to load a movie clip from the library when the name of the movie clip is held in a variable.

for(var i:Number = 0; i < 64; i++)
{
var blueIconS:blueIcon = new blueIcon();
addChild(blueIconS);

[Code]....

The above code works for adding the blueIcon but I have a variable in that loop which tells which icon to load.

sectorsMCs[jewelsIDs[i]]

The above will tell me what MC name to load but how do I load a MC from library by that variable value?

View 1 Replies

AS3 :: Flash :: Access Variable Of Parent Movie Clip?

May 24, 2011

How to access variable of parent movie clip in child movie clip in Action script 3.0

View 1 Replies

Flash :: Access Variable In Added Movie Clip?

Sep 30, 2011

I'm in class file right now and made a new movie clip using the linkage name

var mc = new ExampleLinkageName();
addChild(mc);

all good, I can see mc on the stage. In the ExampleLinkageName movieclip, I have a variable defined in it (on the physical timeline) called test.

In my class, I try trace(mc.test) and I get null. how I can read that variable?

View 1 Replies

ActionScript 3.0 :: Using A Variable To Reference An Already Existing Movie Clip?

Jan 28, 2009

I have been struggling with what I suppose is a very simple issue: I am importing content into my application via a text file, this all works fine. I have about 10 different movie clips on the parent timeline that I have hidden (dc_mc.visible = false.So what I need to do is take one of the variable names that I've got from my text file and use its value to "turn on" one of these hidden movie clips.So I'm trying stuff like:

var directory = e.target.data.directory; // Grabs the data, sets var
var raceNameButton:String = directory+"_mc"; // Set data into new var
raceNamesButton.visible = true; // display movie clip with var name

[code]........

View 1 Replies

ActionScript 3.0 :: Dynamically Name A Variable Or Created Movie Clip?

Dec 10, 2009

Is there any way to dynamically name a varaiable or created movie clip? I know that I could make an array of movie clips, but what I really want to do is make a new movie clipe name based on another name. The reason I want to do so is that I want to pass a movie clip to a function and have it make a new movie clip (to contain the first) with a slight variation of the test such as "frame" or "handle" which I can then use to center the source movie clip.

View 1 Replies







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