ActionScript 2.0 :: Variable - Feed The Path Of A Target To A Function And It Needs To Rewrite To Set A Value To It

Apr 15, 2006

I need to feed the path of a target to a function and it needs to rewrite to set a value to it. example below

[Code].....

Basically it works if it's only one target name with no previous/subsequent targets like path1 works but not path1.box is there any way to fix this?

View 10 Replies


Similar Posts:


ActionScript 3.0 :: Extend A Function Or Override It Without Having To Rewrite The Whole Function?

Dec 17, 2010

is there a way to extend a function, or override it, without having to rewrite the whole function. e.g would it be possible to add a simple trace statement at the beginning/end of the addChild() function. im looking for something similar to super() in constructor. just as i dont have to rewrite the whole constructor of the class that i extend, but i can add my own code, then call super(). ive read something about prototypes and that they could be possible solutions.

View 1 Replies

Flash :: Use MovieClip Target Name To Pass Variable To Function

Feb 22, 2012

How can I combine the following functions and still pass a different string to the buildUI(); function?

I have two functions that do the same thing only at the end they both call a function and pass a String value to the function. This string value is the only thing different.

Below is are my eventlisteners and functions as they are now:

female_start.addEventListener(MouseEvent.MOUSE_DOWN, startFemale);
male_start.addEventListener(MouseEvent.MOUSE_DOWN, startMale);
//FUNCTIONS THAT DO THE SAME THING AND BOTH CALL buildUI BUT PASS A DIFFERENT STRING.

[Code].....

View 1 Replies

ActionScript 3.0 :: Twitter XML Path To Pull A Feed Via HASH TAG Instead Of Account?

Nov 2, 2010

I built out a Twitter Application that pulls in a feed. It works. Found out from the client today they want it to display the feed based on a specific HASH TAG .... not just their account.

ActionScript Code:
function loadXML():void {
xmlholder.load(new URLRequest("http://twitter.com/statuses/user_timeline.xml?

[code]....

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

Professional :: Using The Target Path Tool?

Feb 14, 2012

I realise that I need to keep all my code on the main timeline, so now I need some serious help with targeting movieclips and buttons, when I use the target path tool (the little gun sight in the action script panel) it lets me navigate to the thing I want, but when I use it's suggestion it very often doesn't work, and I am left using trial and error to work it out.  Ican get stuff to work, but I really have no idea why or how I am doing it, Sorry to be such a N00B, but I really think if I can work this out I am going to get

View 5 Replies

ActionScript 2.0 :: Specify Target Path Using 'tellTarget'?

May 20, 2004

how do you specify the target path using "tellTarget"?Ex. The target movie clip is on the main timeline but the "tellTarget" script is on another. How would I code this? (or should I just use the standard "gotoAndPlay"?)Is tellTarget really even relevant anymore? It seems to me that with the release of FMX 2004, Macromedia advocates using gotoAndPlay more than tellTarget. Why would you use tellTarget when gotoAndPlay does essentially the same thing (or does it?)?

View 4 Replies

ActionScript 3.0 :: Using Correct Path For (Event.Target)

Jan 8, 2010

Previously it was put as keepLevel1(event.target) at each seperate function. Now I would like to make it frun the functions after an object is successfully loaded. How should I change the (event.target) to?

ActionScript Code:
private function startSearch(event:MouseEvent):void {
var loadID:String;
loadID=searchArea.text;
myLoader2.load(new URLRequest("GetData.aspx?id="+loadID));
myLoader2.addEventListener(Event.COMPLETE,processXML2);
[Code] .....

View 0 Replies

ActionScript 2.0 :: LoadVariablesNum(url,target) Load From Another Path?

Mar 12, 2003

I've got a question about the path of the txt fileI can easily load a txt file in a movie if the txt is in the same folder as de .swf, but when i try to load a txt file from a different levelfor Example projects/com/1.txt i dīn't see any txtthe code is:loadVariablesNum(projects/com/1.txt,0) i know the code is wrong, but can somebody tell me what i have to do to get a txt form a different level.

View 1 Replies

ActionScript 2.0 :: FMX Target Path That Works Both Ways?

May 25, 2003

i have a main-movie with a movieclip called "area", into this movieclip is loaded an external movie.swf

a clip inside this movie.swf has the below script
onClipEvent (enterFrame) {
_level0.area.displayfield = "hello"

[code].....

View 3 Replies

ActionScript 3.0 :: MovieClip Target Path Are Soo Complicated?

Apr 26, 2010

I am wondering why the AS3 movieClip target path are soo complicated? I'm loading a simple external swf that contain a movieClip that I want to play with. But I can't find the proper syntaxe to call this movieClip..

var swfLoader:Loader = new Loader();
holderSWF.addChild(swfLoader);
var externalSWF:URLRequest=new URLRequest("externalFile.swf");
swfLoader.contentLoaderInfo.addEventListener(Event .COMPLETE, loadProdComplete);
swfLoader.load(externalSWF);

[Code]...

View 3 Replies

ActionScript 2.0 :: [mx2004] Target Path Woes?

Apr 13, 2005

im attempting to build my first site in flash, and it was all going ok till i decided to get clever!I did have snippets of a.s everywhere, but have been trying to move it all back to frame1 on the main timeline (issat best practice?)the problem im having is that a simple piece of code on a nav button just wont work.when the code was within the same movie as the button it was easy:

btnWelcome.onRelease = function(){
trace ("clicked")
}

[code]....

View 2 Replies

ActionScript 3.0 :: Book And Target Path Icon Wrong?

Feb 10, 2009

I've now found the code:MovieClip(root).square_mc. rotation= 45;Which has solved the problem fantastically.However my book suggests this format:root. square_ mc.rotation = 45; Also, using the 'insert target path' icon in the AS Window gives a similar syntax. eg for the above it gives this.parent.square_mc.orroot. square_ mc.Neither of which work, and generate the following message 1119:Access of possibly undefined property square_mc through a reference with static type flash display: DisplayObject.Am I doing something wrong, or does this style of controlling multiple time lines just not work?

View 2 Replies

ActionScript 3.0 :: Path Or Target Frame Inside Of MovieClip?

Mar 8, 2009

I'm trying to reference a specific frame inside a MC in my .swf file from an .as file. What I want is to capture the current frame of the movie clip for the .as file. It's for the purpose of points when you shoot each plane. It's an easy trick of frame 1's plane would be worth 100 points, frame 2's plane 200 points, etc. I thought I'd write a line like this in my collision detection section of my .as file.

Code:
planePoints = currentFrame * 100;

The only problem is, of course, it grabs the current frame of the main .swf timeline that my flash file uses, and not the movieclip that's being called to produce the planes. So I thought I'd be able to specify a path to the movie clip (in this case it's called Airplane in the MC's linkage properties).

Code:
planePoints = Airplane.currentFrame * 100;
Then, of course, it freaks out and says that 'access of possibly undefined property currentFrame through a reference with static type Class.'

I still get confused with AS3 and the way items are handled vs AS2. I've lost track of how many times I type _root. Am I getting something basic mucked up here or should I be importing something in the package to get it to recognize the class?

View 1 Replies

Actionscript 3.0 :: Setting A Target Path For A Library | Flash CS4

Jul 9, 2009

I am trying to create a class library in the documents folder on my mac to save reusable .as classes. I tried following the tutorial on gotoandlearn about this, but it doesn't seem to be working out. I set the path in the prefs in flash using the browse button, and then set up the import line in my .fla. When I test, I get errors that say that flash can't find the dir that I am trying to use. Here are some details...

This is the dir structure that I am trying to use to store my classes.

This is how I am trying to link up to the classes using import in flash.

Here is the preference settings that I am using to get flash to look in the dir structure above to find classes to import.

View 3 Replies

ActionScript 2.0 :: Target Path In External SWF Not Working Correctly

Jun 5, 2007

Alright, so I've tried quite a few things with no luck. I have a scrollbar that works in the swf fine, but when loaded into my mainmovie container I get this error...
Target not found: Target = "/scrolling text " Base = "_levelO.swf container"

Basically I understand this to mean that the externally loaded movie cannot find the instance name /scrolling text. The code is as follows that I have set to the scrollbar button in the externally loaded swf....

on (rollOver) {
tellTarget ("/scrollingtext") {
nextFrame();
} gotoAndStop("down1");
}

I tried changing the target to _root.scrollingtext with no luck. Also tried _parent.

View 1 Replies

ActionScript 1/2 :: Getting, Setting Contents Of A Field, Whose Name Is Parsed Out Of Target Path?

May 23, 2009

It seems that every scripting language I start using, it all goes back to this problem. How do I evaluate a string as a variable name or text field name, and get or set the contents of that variable or text field

var mySelf:Person = new Person ("Enter Your Name", "Enter Your Email", "Enter Your Phone");
//Person is an external class file.  The variables in it are named "_HomName, _HomEmail,

[code].....

View 4 Replies

ActionScript 2.0 :: Target Path To Movie Clip Element Of A Button?

Jul 16, 2004

I'm trying to figure out how to use AS to access frames of a movie clip within a button symbol (using Flash MX 2004), and I seem to be stuck. I drafted a small test version of the FLA I'm working on, and it is attached to this message.

Specifically, my intention is to have a two-state button that goes into "selected mode" after the first mouse click, and then goes back to normal after a 2nd click. I can already handle the functional aspect of this using a global boolean like the one in the attached file. The problem is that I want to represent the current status of the button with a visual change; in the attached example FLA, the intention was to change the color of the text label on this button from grey to red when the button is in its "selected" state.

In this forum I found a similar question where someone had provided a "menu.fla" that had a row of buttons that acted more or less like a radio set, which is somewhat similar to my need. I've been trying to use the same sort of method, having converted the "up" state of the button text into a movie clip symbol with two frames (one for each state), and then trying to use AS to do a "gotoAndStop()" on the desired frame of the up label animation. The problem is that I cannot figure out how to actually make this work ... no matter what sort of path I try to use to get to the movie clip animation within the button, I cannot seem to set the text animation to jump to the "selected" frame (2).

I think my problem is that I've been unable to glean any understanding from the Flash MX docs about the differences between an object name and a symbol name and an identifier and an instance name and a blah blah blah, or about which of them (if any) actually is an ID that can be accessed via ActionScript. Also, MX 2004 seems to provide almost no compile-time error checking on the validity of a target path either, so I've been reduced to just throwing every combination at it that I can think of. None have worked, so I'm at a loss.

If anyone can explain to me why the attached FLA doesn't cause the text to stay red after a mouse click, no matter which of the commented out lines I try, it would undoubtedly be a big help to me.

(Please note that the button in this FLA uses a basic flashing animation for mouseovers ... it was just something quick to implement to emulate the mouseover animation in my full file, so please don't be distracted by it. Also note that I haven't tried to implement any code to return the button to a non-selected status yet. One thing at a time.)

RESOLVED: It was apparently the nesting of a movieclip inside of a button that prevented the original target path from working (and one of the tutorials at this website seems to support that). Once I knew what the proper path syntax was and didn't have to worry about that part anymore, eventually the rest fell into place pretty easily once I started using a movieclip for the button rather than an actual button.

View 3 Replies

ActionScript 2.0 :: Getting, Setting Contents Of A Field, Whose Name Is Parsed Out Of Target Path

May 23, 2009

It seems that every scripting language I start using, it all goes back to this problem. How do I evaluate a string as a variable name or text field name, and get or set the contents of that variable or text field?

Code:

var mySelf:Person = new Person ("Enter Your Name", "Enter Your Email", "Enter Your Phone");
//Person is an external class file. The variables in it are named "_HomName, _HomEmail, _HomPhone."

[Code]....

View 1 Replies

ActionScript 3.0 :: Controlling MovieClip With Frame Label - Target Path

Oct 5, 2009

I'm trying to control a movie clip called "nosotrosmc" with a frame label inside called "historia" but does not work
Code:
menu.nosotros.addEventListener(MouseEvent.CLICK, subSeccion);
function subSeccion(e:MouseEvent){
trace(""+e.target.name+"boton clicked");
this.nosotrosmc.gotoAndStop("historia");
}

The output window show this:
nosotrosboton clicked
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at HomeSonny_fla::MainTimeline/subSeccion()
I need to made a simple navigation, I'm a designer, not a programmer.

View 6 Replies

ActionScript 2.0 :: Target Path To Movie Clip Element Of A Button

Jul 16, 2004

I'm trying to figure out how to use AS to access frames of a movie clip within a button symbol (using Flash MX 2004), and I seem to be stuck. I drafted a small test version of the FLA I'm working on, and it is attached to this message. Specifically, my intention is to have a two-state button that goes into "selected mode" after the first mouse click, and then goes back to normal after a 2nd click. I can already handle the functional aspect of this using a global boolean like the one in the attached file. The problem is that I want to represent the current status of the button with a visual change; in the attached example FLA, the intention was to change the color of the text label on this button from grey to red when the button is in its "selected" state.

In this forum I found a similar question where someone had provided a "menu.fla" that had a row of buttons that acted more or less like a radio set, which is somewhat similar to my need. I've been trying to use the same sort of method, having converted the "up" state of the button text into a movie clip symbol with two frames (one for each state), and then trying to use AS to do a "gotoAndStop()" on the desired frame of the up label animation. The problem is that I cannot figure out how to actually make this work ... no matter what sort of path I try to use to get to the movie clip animation within the button, I cannot seem to set the text animation to jump to the "selected" frame (2).

[Code]....

View 3 Replies

ActionScript 3.0 :: Combine Multiple Variable Names Together To Target New Variable?

Jan 31, 2012

I'm still learning flash and actionscript 3 and i am having trouble with variable and object names. I need to be able to combine variable names together (in the same way as php can combine by doing var1.var2).

My swf contains 4 loaders (image1_loader, image2_loader etc..) which are a child of (image1_content, image2_content etc.....)

I then have 4 buttons which load an image into the loader and while doing so they define the currently active loader.

Finally i have 4 control buttons - scale up/down and rotate clockwise/anticlockwise which should only control the currently active loader (as set by the buttons above)[code]...

View 2 Replies

Actionscript 3 :: Combine Multiple Variable Names Together To Target New Variable

Jan 31, 2012

I'm still learning flash and actionscript 3 and i am having trouble with variable and object names. I need to be able to combine variable names together (in the same way as php can combine by doing var1.var2).

My swf contains 4 loaders (image1_loader, image2_loader etc..) which are a child of (image1_content, image2_content etc.....)
I then have 4 buttons which load an image into the loader and while doing so they define the currently active loader.
Finally i have 4 control buttons - scale up/down and rotate clockwise/anticlockwise which should only control the currently active loader (as set by the buttons above)

So my buttons as well as loading the image have the event listener:

image1_btn.addEventListener(MouseEvent.CLICK, setCurrentSelection);
image2_btn.addEventListener(MouseEvent.CLICK, setCurrentSelection);
(and so on..)
function setCurrentSelection(e:MouseEvent):void {

[Code]...

So within the rotateClockwise and rotateAntiClockwise functions i need to be able to recognise which is the currently active loader and have that number instead of the X - so if it is image1_loader - it needs to be image1_content, if 4 - image4_content... I had tried to do it as this but it doesn't like it being a string:

rotateAroundCenter((activeLoader+'_content'), 10, ptR);

View 3 Replies

ActionScript 3.0 :: Combine Multiple Variable Names Together To Target New Variable

Jan 31, 2012

I'm still learning flash and actionscript 3 and i am having trouble with variable and object names. I need to be able to combine variable names together (in the same way as php can combine by doing var1.var2).My swf contains 4 loaders (image1_loader, image2_loader etc..) which are a child of (image1_content, image2_content etc.)I then have 4 buttons which load an image into the loader and while doing so they define the currently active loader.Finally i have 4 control buttons - scale up/down and rotate clockwise/anticlockwise which should only control the currently active loader (as set by the buttons above)So my buttons as well as loading the image have the event listener:[code]So within the rotateClockwise and rotate Anti Clockwise functions i need to be able to recognise which is the currently active loader and have that number instead of the X - so if it is image1_ loader - it needs to be image1_content, if 4 - image4_content.I had tried to do it as this but it doesn't like it being a string:[code]

View 3 Replies

Actionscript 3 :: Flash Cs5: Set A Variable Using A Function, Then Read That Variable From A Different Function

Jan 29, 2012

I have a public variable and I am trying to set it, then read it from a different function:

public var str:String;
public function DailyVerse()
{
function create() {

[Code]....

My trace results says null. Why does it not give me "hello"?

View 1 Replies

ActionScript 2.0 :: Target Path - Go To Frame 2 When Click On Button On 1st Frame

May 25, 2009

there is a button on 1st frame. there is a movie clip on frame 2. I named the movie clip as "ball_mc" I want to go to frame 2 when I click on button on 1st frame. I know that the code "gotoAndPlay(2);" on button will work. But for some reasons, i want to try another way.... i tried several codes:

1. this.ball_mc.gotoAndPlay();
2. _level.ball_mc.gotoAndPlay();
3. _global.ball_mc.gotoAndPlay();
4. _root.ball_mc.gotoandPlay();

However these codes dun work. Is there other way to resolve this besides this code "gotoAndPlay(2)"?

View 1 Replies

ActionScript 2.0 :: Specify The Target Path Using "tellTarget"?

May 20, 2004

how do you specify the target path using "tellTarget"?

Ex. The target movie clip is on the main timeline but the "tellTarget" script is on another. How would I code this? (or should I just use the standard "gotoAndPlay"?)

Second Question

Is tellTarget really even relevant anymore? It seems to me that with the release of FMX 2004, Macromedia advocates using gotoAndPlay more than tellTarget. Why would you use tellTarget when gotoAndPlay does essentially the same thing (or does it?)?

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







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