ActionScript 3.0 :: Insert A Variable In A Path To A MovieClip?

Apr 20, 2010

I'd like some help on using a variable in a path to a  MovieClip. I have a menu with 4 tabs. When I click on one I want  it to open and the previous one to close.
 
I'm storing the  previous tab as a variable (_previousTab) but am having trouble adding  the variable to the path to the MovieClip of the previous tab. The error  Flash gives me is:

[Code]...

If  I replace the variable _previousTab with the name of the MovieClip it  works fine. I'm thinking it's something to do with the variable being a  String perhaps?? Also, the trace statements return the desired MovieClip names. 

View 5 Replies


Similar Posts:


ActionScript 3.0 :: Insert Variable Value Into A Path?

Nov 4, 2009

The bold below is what I would like to work, however it does not.  It might not be able to happen like this at all.

basically on mouse down I take the event.target.name and perform a string manipulation to get the number out of the target and add some string to front and end to get the name of the movieclip I would like to effect.  Is it possible to insert the value of dotName into the path?
 
eventName = event.target.name;
stringManip1 = eventName.substring(13, eventName.indexOf("_")); //get the Number before the _
dotName = "dot" + stringManip1 +"_mc"

[Code].....

View 3 Replies

ActionScript 3.0 :: Use A Movieclip Path From A Variable?

Oct 6, 2011

I have a variable that will change,

and i want to make it my movieclip path, example[code]...

View 7 Replies

ActionScript 3.0 :: Use A Variable In A Path To A MovieClip?

Apr 20, 2010

using a variable in a path to a MovieClip.

I have a menu with 4 tabs. When I click on one I want it to open and the previous one to close.

I'm storing the previous tab as a variable (_previousTab) but am having trouble adding the variable to the path to the MovieClip of the previous tab. The error Flash gives me is:

TypeError: Error #1010: A term is undefined and has no properties.
at MenuRun/menuOpen()

[Code]....

If I replace mainframe[_previousTab] with the name of the MovieClip it works fine. I'm thinking it's something to do with the variable being a String perhaps?

View 8 Replies

ActionScript 2.0 :: Targeting Attached Movieclip - Variable It Doesn't Recognize Its Path

May 6, 2004

i have a problem adressing or targetting a attached mc when i target de mc directly it works fine but when i try it trough a variable it doesnt recognise its path anymore??? hopefully a part of the code is gonna explain the situation a litle better... this piece works fine:

[Code]...

View 3 Replies

ActionScript 2.0 :: Targeting Attached Movieclip - Variable Doesn't Recognise Its Path Anymore

May 6, 2004

i have a problem adressing or targetting a attached mc when i target de mc directly it works fine but when i try it trough a variable it doesnt recognise its path anymore???

[Code]...

View 3 Replies

ActionScript 2.0 :: String To _level (path) - Hide A MC Depending On The Path Variable?

Nov 24, 2004

Here's what i'm trying to do: Hide a MC depending on the path variable as:

[Code]...

Well that doesn't work, for some reason, i can't use a string as a multiple level path..

View 5 Replies

ActionScript 3.0 :: Insert A Variable Into A Variable Name

Mar 30, 2009

I'm looking for a way to insert a variable into a variable name. I have this bit of as3 code: I'd like to replace #### with a variable myNumber but don't know the syntax.

[Code]...

View 3 Replies

Flash :: Insert A Variable In MXML (builder 4)?

Jul 3, 2010

I have a text box that receives data from XML. Has activated the service. Everything works fine if i use "taurus" instead myVar in {}. Now I want to change the field and depending on the button is pressed to receive different data. But nothing comes out.

[Code]...

View 2 Replies

Actionscript 3 :: Insert A Variable Into SQLite Database?

Feb 2, 2012

I have a function that inserts data into a SQLite database. I can manually add data using

sqlStatement.text = "INSERT INTO users (First_Name, Last_Name) VALUES ('John', 'Doe')";

This works perfectly. Now I am trying to insert the data from a variable instead. I can trace my variable from this function- trace(Main._firstName); //returns John, but when I insert it using this:

sqlStatement.text = "INSERT INTO users (First_Name, Last_Name) VALUES (" + Main._firstName + ", 'Doe')";

it inserts it as "null Doe".

View 1 Replies

ActionScript 2.0 :: "_root" Is The Only Thing Showing Up In The "insert Target Path" Window

Aug 26, 2003

I've got a button in a movieclip that, when pressed, I want to control the timeline of another movieclip (instance name: video).

I enter the following code on the button and it does nothing:

on(release) {
video.gotoAndPlay(2);
}

Now I suppose the path is wrong but, when I click on the "Insert Target Path" icon in the actions panel, the only thing that shows up in the window is "_root". It doesn't matter which movie clip I am in, when I click the "Insert Target Path" icon, all that shows up is "_root".

There is a heck of alot more to my movie than that, where are all the movieclips? The "video" instance is nested 3 movieclips deep. I've tried entering the path manually too, but it don't work.

View 10 Replies

ActionScript 3.0 :: Can Use A Variable In UI Path

Jul 25, 2010

I have several UIs and wish to automatically load images into the containers. I have repeated the actionscript line, which has created a lot of code.As the lines are similar all but the image number, I am thinking to use a loop and variable to insert the image number into the code. Here is the code:[code]a variable to replace the number between I am not sure how to do the same for the Movie Clip path.Is it possible to use a variable to define the number (2) in this statement?

View 2 Replies

ActionScript 2.0 :: Cannot Use A Variable In A Path

Jan 5, 2005

why I cannot use a variable in a path?

Code:
function buttonControl(buttonNumber){
var buttonClip = eval ("bu"+buttonNumber+"_mc");
this.target_mc.buttonClip.gotoAndStop("active");
}

I can work my way around it, but why doesn't it work?

View 3 Replies

ActionScript 2.0 :: Using A Variable In A Path

Mar 25, 2005

I'm curious why this doesn't work.

[Code]...

View 7 Replies

ActionScript 2.0 :: Xml Path As Variable?

Jul 24, 2008

I am trying to create an xml based site navigation that will drill down to an infinite number of xml levels. I have tried to send an xml path as a variable with the currently selected menu item but I doesn't seem to work. Here is my code, it seems as though it should work, but it does not.

View 2 Replies

ActionScript 2.0 :: Using A Variable In A Path?

Mar 25, 2005

how to use the variable in a path

[Code]...

View 7 Replies

Professional :: How To Insert Button To MovieClip

May 11, 2010

I made a little movieclip animation, it can be seen on [URL]. I have written the code for it but then have realised that I need to insert a link to the images, each image is supposed to have its own link. When I go to insert a button flash somehow decides to ignore part of the code I wrote and not function properly therefore I cannot have a link and a working animation going on at the same time. The worst thing is that I need to put two separate links in the same movie clip. Is there any way of doing it so it wont disturb the code? or maybe is there a way to insert a link to the images?

View 6 Replies

ActionScript 2.0 :: Insert Button Into Movieclip?

Apr 14, 2010

The problem is,i dont know how to insert button into movieclip (draggable map) i've tried by inserting the button straight away into the movieclip,but when i play the map, the button cant function.

View 6 Replies

ActionScript 2.0 :: Updating Variable In A Path?

Jul 20, 2010

Having trouble changing a variable for an object path:Set-up initial path:

Code:
displaySlide="slide1";
Change the path/variable through user action:

[code].....

View 2 Replies

ActionScript 2.0 :: Variable In Loadmovie Path?

May 15, 2005

I have a variable that is refers to the names of folders, and I need to insert the variable into the pathname when I loadMovie. I cannot seem to get the variable to become part of the pathname

loadMovie('VARIABLE/image.jpg', _root.loadhere);

I've tried parenthesis, [], (), do not know the correct way to call the variable.

View 2 Replies

ActionScript 2.0 :: Call Variable In Path?

Feb 27, 2007

I want to create a variable that I can call in a path. For instance:

Code:
var myVar = "varHome";

Then, to use in code:

Code:
_root.mcContent.varHome.gotoAndPlay(1);

Can you do that? This way obviously doesn't work (because I've tried it). Is it possible at all?

View 7 Replies

ActionScript 2.0 :: [FMX2004] Cannot Use A Variable In A Path?

Jan 5, 2005

why I cannot use a variable in a path?

[Code]...

I can work my way around it, but why doesn't it work?

View 3 Replies

ActionScript 2.0 :: Insert Animated MovieClip Into Button?

Nov 3, 2005

I am trying to make a button, when you rollOver it, animation start to play. I try to insert animated movieClip into button, but in Flash 8 you can't do that.

I have try with ActionScript to call the animation to play when mouse is over, but also nothing.

Can somebody give me code or where can I found some button, when you go over it with mouse, that animation start to play.

View 14 Replies

ActionScript 3.0 :: Alternatives To _global Variable Path?

Jun 8, 2009

through out a very old complicated fla there are buttons which set variables using _global paths
 
such as:
 
function menu1_2(Event:MouseEvent) {
global.mode = "hide_hotbox";
MovieClip(this).gotoAndStop("stage_1_b");
}
 
How can I make the variable "hide_hotbox" and others like it accessible and changeable from any movie clip -- whether they be nested in other movie clips or on the main timeline, etc?

View 6 Replies

ActionScript 3.0 :: Loadinf Swf With URL Path As A Variable From A Class?

Oct 18, 2009

I need to load an external SWF into a movieclip, and get the name of the SWF from a variable from a class. The variable is called getSWF and is defined as the following in the class
 
public var getSWF = "movie.swf";
 
When I trace(getSWF); on the first frame of the main time line it outputs fine. However when I use the following code on the movieclip:

var imageRequest:URLRequest = new URLRequest (getSWF);
var imageLoader:Loader = new Loader();
imageLoader.load(imageRequest);
addChild(imageLoader);

I get the error:
 
1120: Access of undefined property getSWF.

View 1 Replies

ActionScript 2.0 :: Have A Object Path Changed Due To The Value Of A Variable?

Sep 21, 2005

Is it possible to have a object path changed due to the value of a variable?

eg.?

Code:
ClipNumber = 10
_root.ClipMC.[ClipNumber].Stuff = "This is stuff"

What Im asking is, can a value in a path be equal to that of a variable?

View 4 Replies

ActionScript 2.0 :: Navigating An Object Path, Using A Variable

Mar 11, 2008

lets say I have a variable like this:

Code:
var pathName = "section2";

Then I have an object called "book". "book" is the parent of other objects named:
section1, section2, section3 and section4.

I want to apply a gotoAndStop() to section2 inside the book object. But instead of typing it the normal way:

[Code].....

View 1 Replies

Actionscript 3 :: Insert String Info Into Addressing A Movieclip?

Oct 18, 2010

I am trying to dynamically address different instances of the same movieclip by passing a string into the movieclip address, but apparently I don't know what I'm doing. I'm trying something like below:

var vsTargetName:String;
vsTargetName = "instance50";
vsTargetName + vsThumb.thumbHighlight.visible = true;

Is something like this possible? What am I doing wrong/what do I need to do to make that work?

View 3 Replies

ActionScript 2.0 :: LoadMovie Fails When Path Is Passed In Variable

Mar 14, 2009

Oddly if I use a quoted string, like

loadMovie( "http://www.miniclip.com/games/cube-buster/en/cubebuster.swf" , 1);

it works fine

But if I pass in a variable:

var fullpath:String = "http://www.miniclip.com/games/cube-buster/en/cubebuster.swf"
loadMovie( fullpath , 1);

it fails ???

Can't find anyone else's comments on such an issue.

Using flash 8, as2 on Mac osx

The example above remote domain example works fine within flash IDE

My actual application using a relative path to a sub directory, for a little obfuscation.

View 1 Replies

ActionScript 3.0 :: Path Movement - Mc To Follow The Path Drawn Out By The Player's Mouse And When The Player Clicks Again, It Erases All Of The Path?

Jul 18, 2010

So I've created a script where a mc is clicked on and the player can draw a path using the mouse. I'm trying to figure out how I can get the mc to follow the path drawn out by the player's mouse and when the player clicks again, it erases all of the path.my code is below

Code:
import flash.display.Sprite;
import flash.events.MouseEvent;[code].....

View 14 Replies







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