Tracing From Within A Class
I almost feel dumb posting this, but I am develpoing a project and seem unable to trace from within a class. It definatley helps to have this ability and I have yet to find a suitable work around. Does anyone have any good ideas?
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 12-09-2005, 02:59 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Error While Tracing Sprite In AS3 Class
i just don't understand why this is so. resides in my class
Code:
trace(sc_); // outputs: [object MainTimeline]
container = new Sprite();
trace(container); // outputs: [object Sprite]
sc_.addChild(container);
trace(sc_.container); // outputs: undefined !!!!! HOW IS THIS POSSIBLE?
just for info, container and sc_ are predefined, i just call them here.
Creating A TraceText Class To View Tracing While Hosted
Hey guys,
I don't know if this is the best way to do this (if you have a better suggestion, by all means provide it), but I'm trying to create a reusable class that is a movie clip that is added to the stage with 0 alpha (not the best use of resources, but not a real issue where I work right now), and on a keystroke is made viewable. I want the textfield that is added to the movieclip to update dynamically where I would normally put a trace statement. That way, after I publish, I can still view the trace statements.
If there is another way simpler way of doing this, by all means let me know!
Anyway, I've created some code to do it (if I can get it to work, feel free to use it!).
ActionScript Code:
package
{
import flash.display.*;
import flash.events.*;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.display.Shape;
/**
* ...
* Code created by S. Kyle Davis.
*/
public class TraceText extends MovieClip
{
private var viewable:Boolean = false;
private var format:TextFormat = new TextFormat();
public var content:TextField = new TextField();
public var rect:Shape = new Shape();
public function TraceText()
{
trace("trace text has been called");
//set text format
format.font = "Times New Roman";
format.color = 0x0000;
format.size = 9;
format.align = "right";
//set content text format
this.content.x = (stage.width - 245);
this.content.y = 55;
this.width = 190;
this.height = 190;
this.content.setTextFormat(format);
this.content.wordWrap = true;
//set rectangle
rect.graphics.lineStyle(1, 0x000000);
rect.graphics.beginFill(0xFFFFFF);
rect.graphics.drawRect(250, 50, 200, 200);
rect.graphics.endFill();
//add rectangle and content
addChild(rect);
addChild(content);
this.content.text = ("TraceText has begun");
this.alpha = 0;
}
public function addTrace(trace:String):void
{
content.appendText("/n" + trace);
}
public function view():void
{
if (viewable = true)
{
this.addTrace("already viewable");
trace("already viewable");
}
else
{
this.alpha = 100;
viewable = true;
addTrace("viewable = " + viewable);
}
}
public function hide():void
{
if (viewable = false)
{
addTrace("already hidden");
trace("already hidden");
}
else
{
this.alpha = 0;
viewable = false;
addTrace("viewable = " + viewable);
}
}
}
}
When I try to add it to the stage, I'm getting an error:
Quote:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at TraceText$iinit()
at Untitled_fla::MainTimeline/Untitled_fla::frame1()
I haven't done the code for the keypress, so I'm just adding it right now. When I'm adding to the stage, all I'm doing is setting the classpath in settings to the folder where my file is, then putting this in the first frame:
ActionScript Code:
import TraceText;
var tT:TraceText = new TraceText;
addChild(tT);
I'm getting the normal trace("trace text has been called") at the beginning of the code and everything's compiling ok. any ideas?
Tracing
I've been looking everywhere on how to do this effect and I can't find it. In my movie, I want to "trace" (that's the best word i can think of, the outline of an image, then once the outline is complete, fill in the space with the actual image.
I saw this on the Royal Tenenbaums website I would like to know how it's done.
Thanks
Tracing Vs. Tracing
Hiya, i'm preparing the artwork for my very first Flash animation and I was wondering what the views are on how to trace images that are drawn, scanned and imported. Is there any reason to trace the bitmap by hand using the brush or pencil tool or is using the "trace bitmap" command the way to go? Any other tips on how to get the best results with scanned artwork? Thanks in advance!
Tracing I Think?
Hi folks
Havent posted on here in ages!
I had a pitch at at client who runs a kitchen business in the UK today, and they were very interested in having some effects similar to http://www.smallbone.co.uk
There is a really smooth effect where the outline of the photos appear first, then slowly over the timeline more of the photographs are revealed.
From what I can gather this is to do with tracing the bitmap, but I am a bit lost after that!
Does anyone have a tutorial on this, or some simple steps as to what I should be doing to achieve these effects.
I appreciate this is a high quality site and from speaking to people about this style of effect it is quite time consuming.
I am prepared to give it a go as I think it looks brilliant.
Any tips would be really appreciated!!!
Ben
XML Var Not Tracing
If i trace (my_xml.firstChild.firstChild.nodeName); the trace function works and outputs "item"
If i trace (iLabel); I get undefined. Why doesn't my variable work correctly
Code:
stop();
// ----
var iLabel = my_xml.firstChild.firstChild.nodeName;
// ----
var my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success) {
if (success){
trace(iLabel);
} else {
trace ("XML Error - File not available or coruppted.");
}
};
// ----
my_xml.load("jeans.xml");
// ----
Tracing
Is there any way to create an excercise that requires a user to trace a letter or number on a screen in Flash 8? For example a Capital A on a screen.
Tracing
I am new to actionscript. How to trace 1 through 50 with button? Thanks.
Tracing Or Something
is there a easy way to trace line art in flash.. cuz i was screwin with some scanned stuff and im tryin to figure out how to trace the lines in black without actually just goin over the lines with the paint brush tool.. cuz my hand is kinda shakey cuz i twitch a lot.. or i just have a really unsteady hand.. any ideas?
Help Tracing
hi i want ot no how to trace a movie clip and place it into an empty movie clip i create at the begginning of the movie can you please help me . it would be appreciated
Tracing The Url In AS2.0
Greetings!
I have an Actionscript 2.0 question for anyone out there. I working on a Flash quiz that will trace the users coming from a particular page on a website. If the user comes from that page then a link will not be displayed in the quiz. If they don't come from that page then the link will be displayed, or the link will be turned on if you will.
The reason for the dynamic functionality, is to avoid creating two flash files that do the same thing, and then maintained on a regular basis.
Any thoughts?
Thanks!
Help Tracing
hi i want ot no how to trace a movie clip and place it into an empty movie clip i create at the begginning of the movie can you please help me . it would be appreciated
RGB Tracing
Is there a way to find the Red Green Blue value of a pixel on the screen, or is that only possible when in reference to objects?
Because I would like to be able to decipher and change a heat map using flash if possible.
Thanks
AS3 - Not Tracing Anything At All?
Hi guys,
I'm working with Flex 3 and I'm having some trouble. I'm trying to trace some things (array lengths, random string statements, etc) in my program however nothing comes out unless I'm tracing it in the constructor function.
What could be the cause of this?
I'm also working with Papervision, TweenMax and Flash CS4 as my compiler if that counts for anything.
Tracing _x
how do I take the _x of a movie clip and turn it into a variable.
Heres what I got and its not working.
myMovieClip._x= Myvaraible;
when I trace(Myvaraible)
I get undefined. I want to get a number;
please help:
thanks
Tracing A Var
brain fart...
i did
a = 5;
b = 2;
c = a + b;
trace("c");
I just get "C" and i am exporting on actionscript1...
i want it to trace and get 7
Tracing Help
Hey,
Im looking to make an etch-e-sketch kinda effect with masks... but its a pain when the shapes over lap themselves and create this wonky kinda effect when i shape tween them.
any suggestions upon achieving this?
thanks guys much appreciated
BitMap Tracing
Sorry this might be a dumb questions but....Bitmap tracing, how do u do it?
Tracing All Variables
Is there a simple command I can use to trace all the variables I am sending to an external file?
Tracing Bmp Images....
i have made an animation with lightwave, and i want to import it in flash (i have flash mx...) but i want to 'vectorize' it. now i started with tracing each frame, but i have 520 frames, and that is a lot! so do you have an idea how i can automate this? or is there some sort of program available for that? i know there is swift, but this just isn't what i'm looking for, so i'm not ready to pay for that...
please help!
thanks
stef
Tracing An Object?
I was wondering how to like trace an object with lines? example can be seen http://hostrocket.com/home/index.htm there. If you keep watching the header you will see the guy kinda get traced. How would I do this?
The Tracing Of Shape
Hi there,
Whether I make any kind of forms (oval, rectangles etc), I can't see the tracing to figure out what the shape will look like.
This is kinda annoying and I just can't find out the option to activate it.
Thanks for your help.
Tracing Bitmaps
hey
im new to MX and used to flash 4 (wicked old)
i was wondering the best way to trace bitmaps, should i copyu and paste them in or import then trace?
just .gif's and .jpg's
shawn
Tracing Images
Does anyone have a link to a tutorial that explains how to manually or automatically trace images.
Thank you.
P.S - Making them a vector image is a +, but not necessary.
Tracing A Bitmap
Using Adobe AfterEffects I created a sequence of shapes and exported it as a .swf. It exports each frame a .jpg which are antialiased. I'd like to vectorize these jpgs and I've played around with the trace bitmap tool, but it vectorizes the antialiased pixels as their own vectors, so I get lots of separate, tiny vectors.
For example, if you import a bitmap circle, and try to vectorize it, you don't get one smooth circle vector but rather a lot of smaller vectors.
Does anyone have any suggestions on how to go from an antialiased bitmap circle to one smooth circle vector? Thanks!
Tracing Bitmaps
When I try and trace a detailed bitmap Flash gets about 3/4 of the way through and then crashes.
Settings are:
Color Threshold = 1
Minimum Area = 1
Curve fit = Normal
Corner Threshold = Normal.
Tracing/vectorize
hi,
im trying to trace this image belowbut when i do it comes out all funky, i cant find the right settings to enter. does any one know what settings to use to get it to look the same way it does now except vectorized?
thanks
Justin
Tracing In Flash
I am a Flash user going on about two years on and off. I've read a couple of good books but they seem to leave out those cool effects that seem to make a difference between great Flash work and standard Flash work. My question is, how do I trace a photo of lets say a figure exactly (hair and all) and use that shape to hide the photo below and reveal it by fading the traced shape. This technique is used reqularly in most high end sites like the following:
1. http://www.seanjohn.com/
2. http://www2.foxsearchlight.com/benditlikebeckham/
I also wonder how designers get their Flash animations to run so smoothly without stuttering. I assume they just speed up the FPS to make everything move really fast and seamless. Any help would be great.
Tom
tom@esquire-design.com
Tracing Over Animation
Hi!
I'm trying to trace over a black font with a red colour pencil in a drawing software to teach some of my pupils the right way to write letters.
I tried to record it in avi format but the file is very big. Is there a way to do it in flash mx? If yes can someone give me a tip.
I can do some basic animation but I can't find out how to make flash do the tracing so that it appears that someone is actually writing over the font.
Thank you.
Pervinette
Tracing A Picture
I wanna trace a picture for animation.
What tools do you guyz recommand? pen? pencil? brush?
I cant seems to get it right... the curves are not nice when i used brush and pencil to "sticky"
Whats the ideal tool and setting to trace?
Thank You.
Tracing An Image
Hi,
would like to know how to create an image trace eg. to outline an image showing the outlining animation.
Thanks
Tracing Visibility
Is there a way to trace what is causing a movie clips visibility to change? I have a mc that I turn the vis off on load, then with a function I turn it back on. There is something that is turning it back off though and I can't figure out what it is. So, I'm looking for some method to determine what is turning it back off.
Thanks
Tracing Objects
Hello all. This may sound crazy but I would like to know how to trace an object using light or something similar. What I'm looking to do is have some text or picture have a trace of light go all the way around the text or pic periodically to highlight it. I've seen it done before but I cannot seem to get it done correctly. Can anyone help me?
Tracing Scope
hi.
i'm having some serious scope issues and want to know what the best way to troubleshoot this is.
i've traced as much as i can and couldn't figure it out, then i tried using targetPath() but that only works for finding movie clips and i'm looking for an array. any ideas?
thanks. fumeng.
Tracing The Label?
I have an actions layer where I have placed labels in certain frames. How can I trace the label for that frame. I can trace the frame number with _currentframe but I want the label in the actions layer.
Any thoughts anyone?
Thanks in advance,
nesnejnhoj
Tracing A AutoCad BMP
What would be the best/optimal setting when using the trace command on an (autocad) architectual bmp? I don't want to alter the picture much at all, but want to be able to break it down as much as possible with the trace command. Thanks.
Tracing Visible When Not
I build a video play. It has all the buttons that a typical video player would have. On each of the buttons I have their visibility = 0 on load. This works fine. Then once the video is loaded it calls a function that starts playing the movie and it also turns the appropriate buttons visibility = 1. Here is the problem. They are not coming on.
I've put a trace on the function that turns the buttons on so I know that I'm hitting the function. I put a trace after the point where it turns the button on and it thinks the visibility = 1. I put an onEnterFrame on the button and put a trace of the visibility on it and it thought that it turned visible at the right time.
The thing that is really blowing my mind is that it was working. I made a couple of changes, non of which should have had any impact this stuff, and then it stopped working. I undid the changes and it still isn't working.
Any ideas???
Tracing An Object?
Purely for bug-testing purposes, is it possible to trace an object and have it list all of it's properties? If so, what's the syntax?
Tracing Along A Path
Hey guys, I'm an extreme noob when it comes to flash, so please don't flame me or anything!
Not sure if the title above is the right term for it, but what I would like to do is create a flash animation that shows the process of a object being drawn out (like an apple being sketched out on an empty sheet of paper)...
is it similar to using moving an object along a motion guide? i'm completely clueless and lost amidst all the action scripts available..and i honestly have no idea how to make them out either
hopefully with some guidance here all that will change..thanks!
Image Tracing
I'm trying to develop a children's game so that the child can trace an image presented on screen. The tracing should be done either by drawing with a mouse or creating dots (application then joins the dots). The traced shape must then be filled with a color.
Any ideas of where to start will be appreciated.
Many thanks,
John
Mask Tracing
Hey,
Im completely stumped upon this problem.
I created an outline of a tree and wanted to create a outline kinda effect, so i was planning on masking it but i have no idea how... i mean i know how to mask but i have no idea how to give it a tracing kind of effect... any ideas?
thanks
Tracing Variables
A few months ago I built a relatively complex flash project that I'm working on again. When I press a button it sets a number of variables, but I can't remember what they are and the code is so complex it's hard to tell by looking at it. Is there a way to write a trace that will output all the variables that get set when I press a button? I don't know their names or values.
Tracing Sprites
Hi,
I´m trying to make some short sprite movies and have some quick questions.
When I select the desired sprites and start tracing them, which options should I pick?
Color threshold: 1
Minimum area: 1
Curve fit: Pixels
Coner threshold: Many Corners
or
Color threshold: 100
Minimum area: 1
Curve fit: Pixels
Coner threshold: Normal
I applied both ways to my NES Super Mario Bros sprite and the result was the same, however the 3-frames sprite is very basic.
How do those changes affect the more complex sprites with hundreds of colors?
Thanks.
[CS3] Tracing An Instance Name
Hello. Lets say I have a few movieclips. Inside the movieclips are buttons. When I press a button, it traces the movieclip's name that it is in. How do I do this?
Code:
my_btn.onPress = function() {
trace(_root._parent._name);
};
I can't figure out how to write the code O_O
Tracing A Variable At The End Of The URL
Ok, forgive me if this sounds like a stupid question. I'm new to dynamic programming in flash. I can't find the specific answer i am looking for on the net or on this message board.
If someone could provide an answer or point me into the right direction I'd very much appreciate it.
The Problem
All I am trying to do is simply trace this variable at the end of this URL:
http://www.theurl.com/sampler/Sampler.htm?vSamp_Id=VUBZ
Here is my attempt:
Code:
myVariables = new LoadVars();
myVariables.load("http://www.theurl.com/sampler/Sampler.htm");
myVariables.onLoad = function(success) {
if (success) {
var sample = myVariables.vSamp_Id;
var theSample = (sample);
trace ("this is the variable: " +theSample);
} else {
trace("there was a problem loading the variables");
}
};
It is coming up undefined and due to my weakness in actionscript syntax, I cannot see why.
Tracing Variable Name?
hello world...
how do we get the name of some variable:
ex:
ActionScript Code:
_level0.one.abc.pepe.ok="yes"
trace(_level0.one.abc.pepe.ok)///output yes
///but i want in the output the name or the path...
//like
trace(_level0.one.abc.pepe.ok._name)///undefined O_ô
I dont know the property to get this... :S
Thanks
Tracing Listeners?
Hello all,
Does anyone know if it is possible to trace out listeners. I have a class that is not responding to the listener i have setup for it and was wondering if there is a way to trace to make sure
1. the class is associated with the listener
2. the listener is broadcasting
etc...
thanks,
Derek
Tracing The XML Value Outside A Function
AS STRUCTURE :::::::::::::::::::::::::::::::::::::::::::::::::: ::::::
function loadXMLKey(loaded) {
if (loaded) {
xmlNodeKey = this.firstChild.firstChild;
VARDATA = xmlNodeKey.firstChild.firstChild;
}
/* ====Showing the value inside the function==== */
trace(VARDATA);
}
xmlKey = new XML();
xmlKey.ignoreWhite = true;
xmlKey.onLoad = loadXMLKey;
xmlKey.load("list.xml");
/* ====Not showing the value outside the function==== */
//*== Want to trace the value of VARDATA here == */
trace(VARDATA);
XML STRUCTURE :::::::::::::::::::::::::::::::::::::::::::::::::: ::::::
<?xml version="1.0"?>
<vlist>
<vset>
<valuev>TraceMe</valuev>
</vset>
</vlist>
Tracing Reserved Name...
OK, so poor planning in the (now non changeable XML file). Business owners have a distinction in there for a group of products called "class". I want to access the value of "class" but it's obviously a reserved name in Actionscript so I get a bunch of errors.
How do I access an attribute that's a reserved name?
Below is my failed code, if you needed to see it.
Code:
trace(item.@class);
|