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


Similar Posts:


How To Prevent Wrong Event.target

Dec 1, 2010

Now, when I click on the button in the area where the movieclip is it will register this movieclip as event.target. I would like to make the button the event.target regardless where I click and prevent flash from registering the movieclip inside the button as the target.

View 3 Replies

ActionScript 3.0 :: E.target.name Traces Wrong Name?

Feb 7, 2009

I place several empty movieclips dynamically on the main stage and load a picture in there with a adress derived from a xml file and some text also from the xml file. Then I add a event listner to the movieclip. On stage the image + text is correctly shown, but when I click the image it traces the name of image and not the name of the movieclip in which it is placed, I need the name of the movieclip because i want to tween the movieclip after it is clicked.

Code:
function LoadXML(e:Event):void {
xmlData = new XML(e.target.data);

[code].....

View 2 Replies

ActionScript 2.0 :: LoadMovie Won't Work. Wrong Path?

Jun 4, 2005

I've got an empty MC called "picture". This MC has the following path:

Code:
_root.container.picture

So, it's an external SWF (photography.swf) loaded in thru the container MC.When I make button at the first frame of photography.swf everything works fine. BUT, when I place the same button inside a MC (called "allphotos") I cannot get this to work.I use he following code for the button:

Code:
tb1.onRelease = function() {
_root.container.picture.loadMovie(image[6],6);
gotoAndStop(1);
}

It seems to "semi-work", because it loads blank. So at least the current photos disapears.I've used _parent, _level0 etc. Nothing.

View 3 Replies

Flex - Don't Let The Drag Icon Get Out Of The Drop Target?

Feb 5, 2012

I have a list with itemrenderer with dragEnabled true and dropEnabled true. Now, I am trying to tell flex not to let the dragged item (even the icon indication) leave the drop panel. I don;t care if it stop the dragging or just freezes it as if it was the application border - and I cannot. I tried to stop the dragging on dragExit handler but it seems to ignore it. Does anyone know of a working mechanism to do such? (Flex 4)

View 1 Replies

ActionScript 3.0 :: Making A Drag And Drop Jukebox That Will Play An Xml Playlist When An Icon Is Dropped Onto It's Target?

Mar 8, 2011

i am making a drag and drop jukebox that will play an xml playlist when an icon is dropped onto it's target.i have one xml playlist working, but i need to make a button that will reset all the movie clips to their original position when a playlist has been played.

View 3 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 :: 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 :: Plug The Title On Each Icon, Showing Up On An Icon When Point On It

Jan 13, 2008

I adopted the tsunami effect that i've got from this link [URL] but the problem is how can i plug the title on each icon, showing up on an icon when i point on it (on rollOver)

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

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

Flash :: Mxmlc Compiler - Source-path Preferred Over Library-path?

Nov 9, 2011

the same class is passed to the mxmlc compiler in SWF library as a symbol linkage class and again in a source-path. But the compiler uses the definition from the source-path so creating new instance of that class won't create new instance of the library symbol. How do I tell the compiler to prefer the definition linked to the symbol (the one dfrom SWC)?

I have my design assets in an FLA file and they are linked to classes (e.g. [URL]. Then I export those assets to a SWC library and pass it to the compiler. Now when I create an instance of the class (new MyAsset();) it will be a new instance of the library object.

But there are other classes too in the source folder (e.g. "com.myproject.model.*" so I need to pass the source folder to the compiler too. And that is the problem, now the compiler will use the MyAsset.as definition from the source path, not from the SWC where it is assigned to the library object so if I create new instance of MyAsset now it won't duplicate the library object.

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







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