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


Similar Posts:


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 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 :: 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

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 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 :: 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

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

IDE :: Drop Down Menu Woes?

Oct 10, 2009

ve got a main menu on my website with buttons. one of the buttons plays a movieclip instance where a dropdown menu appears with more buttons. The dropdown stops on a frame containing a new movieclip with this bit of script on it:

Code:
onClipEvent (enterFrame)
{

[code].....

View 1 Replies

ActionScript 3.0 :: Target Path - Control A Movie Clip Called "nosotrosmc" With A Frame Label Inside Called "historia"?

Oct 5, 2009

i'm trying to control a movie clip called "nosotrosmc" with a frame label inside called "historia" but does not work this is the code:

[Code]...

View 2 Replies

ActionScript 3.0 :: Count Down Startime Woes?

Jul 9, 2010

The following sets the start time in minutes for a countdown clock to tick from......this works fine with the clock the problem is if i press a reset button and put all the values to zero and stop the clock when i press start again the getTimer() value get increaseingly bigger when it reaches a certain point it breaks the count down timer .......all i simply need to do is everytime the getTimer hits the maximum value to start count over....

PHP Code:

theTime=59;
startTime = getTimer()+theTime*60000;

View 1 Replies

ActionScript 2.0 :: Drag And Drop Woes?

Oct 20, 2005

Whats up with the problems when you let a different MC control the drag of an MC. (ie. press this mc, this other mc drags).Take this FLA for example. Notice the trace will pop up sometimes, if you get the box at a very certain position on the temp MC.

View 2 Replies

ActionScript 2.0 :: Sending Data Via PHP To XML Woes?

Nov 24, 2005

bascially all I am making is a console where someone can edit XML data. I've been working off the great tutorial for a flash XML news service but i've got a bit lost with it and I can't get my program to save the data. It reads it from the XML fine but there's some link lost between the Flash and it saving the data. Here's my code and i've attached my working files. all my main code:

Code:
function loadXML(loaded) {
if (loaded) {

[code].....

View 5 Replies

ActionScript 3.0 :: Collision Detection Woes?

Apr 20, 2010

Im trying desperately to learn figure out how to get the collisons working with the blocks.it works on some blocks some times. Ive tried everything I can think of!testBlocksCollisions() is the function that wont work. I have a clip called ball on the stage a clip called bat and block1-9 on the stageu could also explain where I was going wrong that would be immense.this is my code

Code:
package {
import flash.display.MovieClip;

[code]...

View 10 Replies

ActionScript 2.0 :: Flash8 Drag And Drop Woes?

May 2, 2010

I have recently created a game where your drag and drop planet movieclips into individual planet movieclip targets. I had this going fine untill i decided to make it so that the user would have a custom cursor (a claw grabber is anyone is wondering).

Now, when i grab a planet with the cursor and drop it into it's intended target. Nothing happens.

View 5 Replies

ActionScript 2.0 :: Cross Domain LoadSound Woes?

Jul 24, 2009

I'm trying to load an MP3 file from a different domain using loadSound while publishing from flash?

View 1 Replies

ActionScript 3.0 :: Runtime Shared Library Woes?

Jan 12, 2009

I am facing an error using shared libraries. The error pops up during compile and only happen when I give an instance name to my imported asset. Let me describe further:

I have an asset library where all movie clips in this file are exported for runtime sharing - LibraryA.swf

Next is the file that uses the assets - ShirtA.swf

What I did is to import an asset from LibraryA.swf (e.g. collar) into ShirtA.swf. Now I have collar movieclip in my ShirtA library. I drag an instance of it to the stage and compile. No problems.

I then gave this instance a name, "myCollar". I tried to compile again, and I get an error from Flash IDE - 1046: Type was not found or was not a compile-time constant: collar

View 9 Replies







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