ActionScript 2.0 :: Can't Trace Mc Instance Name In Function
Mar 2, 2010
So this is my code:
ActionScript Code:
onClipEvent(enterFrame) {
if (!this.already) {
setTimeout(win, 2000);
[Code]....
The problem is that I can't do trace(this); How to get it work? I have tried to do this.setTimeout etc..
View 9 Replies
Similar Posts:
May 29, 2009
I am having issues with a global array. I have an actionscript file called MyGlobal.as at the same level as my main FLA:
[Code]....
I am able to trace that first element while trace is called within the function... but if I try to trace that first element outside of the function it is "undefined". Do I need to return the array at the end of the function? I tried that but I cant seem to get it working correctly.
View 4 Replies
Nov 9, 2011
I've been playing with prototype a bit and I've noticed that either it isn't as static as it should be or that some functions are protected from altering, or that in some cases the prototype actually extends a function. For example, I was trying to modifiy the global trace function to output the current time of a trace action, something like this :
Code:trace("lulu"); // output 12:48:17.286 lulu I DID achieve something close to it, but it seems that I haven't actually modified the global trace function, but rather it's "_root" counterpart,
[Code]...
View 3 Replies
Mar 4, 2009
I've been trying in as3 to create a trace function which traces / outputs which instance in my movie i have clicked, but with no luck.
I have 10 MC's on my stage, and I would like to trace which of these I clicked, outputting ie. "_level0.myButton09".
View 1 Replies
Sep 30, 2009
I can successfully trace out the movieclip instance name..Code: Select alltrace(regions[i].name);but if I try to use it in the following code to hide a movieclip Code: Select alluk.regions[i].name.turtleMc.visible = false;[code]
View 2 Replies
Jan 26, 2009
I have a general / somewhat newbie question. Is it better practice to call a function from another class like so:
[Code]...
Does one way free up more memory or enhance performance?
View 5 Replies
Nov 8, 2009
how to trace value within ActionScript function.
Problem solved moderators can close this thread.
View 0 Replies
Nov 16, 2010
how would you trace the name of a function, without writing it yourself, is it possible?
So if I have:
private function destroy():void{
trace();
}
how would the trace look like to trace out some kind of refecence-name to destroy? (without typing in destroy into the trace ofc....)
View 8 Replies
Jul 1, 2004
hive just started actionscripting instead of tweening so be gentle. i use mx 2004 but i cant get the trace function to work.., here is the code form a kirupa tutorial...
_global.myvar=5;
trace (_global.myvar);
why does this not work?i thought it shud display 5.
View 2 Replies
Apr 25, 2010
I want to modify the trace function to add it to a log, then display it in the trace output window.
View 3 Replies
Nov 7, 2009
have two of the same MovieClip on the stage, both with different instance names.However, when I trace evt.target.name it comes up as a default name such as "instance 1".Has anyone every expreienced anything like this before?
View 4 Replies
Mar 9, 2010
I have 20 players in a game and cutting and pasting lots of code except for a few numbers. I have future features that would require over 400 lines of mostly repeated code. So I learned how to use "for", and practiced with a trace command. Traced the results exactly as I thought. However when I apply it to the guts of my function, the movie breaks down. I suspect it's because the function is being called on an EnterFrame command and the for loop I wrote is being executed over and over.
This works when I hand code:
Actionscript Code:
function drill(){GUESS0 = ((guess0min * 60)*1000) + ((guess0seconds * 1000))
GUESS1 = ((guess1min * 60)*1000) + ((guess1seconds * 1000))
GUESS2 = ((guess2min * 60)*1000) + ((guess2seconds * 1000))
GUESS3 = ((guess3min * 60)*1000) + ((guess3seconds * 1000))
GUESS20 = ((guess20min * 60)*1000) + ((guess20seconds * 1000))
//and then 300 more lines of other code}
And then a button later calls this when pressing:
Actionscript Code:
my_MC.onEnterFrame = function(){_root.drill ();
//so _root.drill is continually being called, which is good, because it has all sorts of data that needs to be refreshed, but I think it's screwing with my "for" loop.}
And the following is NOT working.
Actionscript Code:
function drill(){for (i=0;i<20;i++){
"GUESS"+i+" = ((guess"+i+"min * 60)*1000) + ((guess"+i+"seconds * 1000));";}
But when I trace it in a separate test movie, it outputs exactly what I would hope it placed in the code:
Actionscript Code:
for (i=0;i<5;i++){trace("GUESS"+i+" = ((guess"+i+"min * 60)*1000) + ((guess"+i+"seconds * 1000));");}
So at the end of the day, I guess I can trace these results in a test movie and use it to generate what I need, and cut and paste it into the project... but I thought 'for' loops were for saving time AND space. Am I using this code right? Maybe my use of "", or +, or i is misguided?
View 4 Replies
Oct 12, 2011
I'm working through some tutorials from my instructor to eventually build a simple e-com website for a state park. Basically, I'm using the two as3 files shown below and trying to get "bob" in my output with an array function and trace. Load store function is intentionally coded out. When I test project, nothing comes up in output, and I have no errors.
Main012.as:
package {
import flash.display.MovieClip;
public class Main012 extends MovieClip {
public function Main012() {
[Code] .....
View 3 Replies
Jan 10, 2010
I don't have any practical need for this but just for learning purposes, is it possible and how to trace the name of the function to the Output panel?
View 6 Replies
Dec 22, 2011
I have an enter frame event and a function running that event, I have place a tracestatement within the function and the stage is running at 25fps.My problem is how do you make the trace statement run just once only? Since it get really annoying when the output panel keep tracing the same thing and slow down my swf....
View 3 Replies
Mar 3, 2011
I have a situation where, upon loading my swf, I add an event listener to the stage to listen for keyboard commands. One of them is to listen for the spacebar, and if it is pressed, it should play a movie. The problem is, that movie is not loaded until later on, depending other user interactions, therefore, until it is loaded, the reference to it would be undefined.
But if I wait and add the listener for key commands only when the movie is loaded, then I can't utilize the listener for other keyboard commands, like RIGHT or LEFT, which are the buttons which get you to the movie in the first place. Is there a way to add a conditional or something to prevent that code from being executed if the video is not defined yet? Here's my code:
[code]...
View 2 Replies
Feb 26, 2007
How do you send the output of a function to a dynamic text field on the stage instead of the output panel?I have used trace(); but that just sends the value to the output panel.
View 3 Replies
Oct 16, 2008
The trace function in this file doesn't output all of the keycodes on my keyboard. Some letters generate a keycode and others don't. For instance, "u" outputs 85 but "i" outputs nothing.
Here's the trace function trace(event.keyCode);
[Code]...
View 4 Replies
Aug 16, 2011
I have a simple code that seems to be giving strange results.
var startPoint:Point = new Point(x, y); // a point
var r:Number = path[i].row + (-Math.floor((length * 2 + 2) / 2)); // just some math
trace(r); // the math checks out and gives a 3
var tey = startPoint.y + r; //this gives a really strange return....
[Code].....
View 2 Replies
Oct 23, 2009
I am having a problem with the if statement in my timer function, the trace statement within in it is not working, eventually I wanted to use this if statement further but need to make sure it is working first.
Code:
timerFunction();
} function call in function above
function timerFunction() {
trace("hey");//this trace works
var myTimer:Timer=new Timer(1000,15);
[Code] ......
View 8 Replies
May 3, 2010
I follow some sample code which uses trace("Hello World"); to print out something in ActionScript 3.0, in Flash Professional CS5.
But nothing seems to get printed out (in a browser). Is the trace() function deprecated / removed?
View 3 Replies
Mar 27, 2011
I'm starting to learn Objective C and I wonder if there is any similar function toactionscript trace to show messages in a console.
View 1 Replies
Jul 3, 2009
I got this weird problem, when i run this code:
Code:
package {
import flash.display.MovieClip;
[Code]....
In Flash Cs3 it acts exactly as i want, the ENTER_FRAME runs and the addObject places numerous sprites on the stage. In the window output i'll see the trace. But when i run this code in Eclipse which is set up to use the Flash Player as output i get the first trace from EDHV_ImageSlider but the traces inside addObject won't show up, the sprites however are generated perfect.
The difference between the eclipse setup and the cs3 setup is the fact that the cs3 setup has a *.fla which calls the *.as package.
View 1 Replies
Nov 14, 2009
ive got a loaded xml list for an mp3 player. from playing track1, when i select track 2, it traces "track1" but then after a second click it traces "track2" and stays on that. the actually music for track2 does load on the first click though, but not the trace. anyone know why on the first click it would still trace the previous track? here is the code for that function...
[Code]...
View 9 Replies
Dec 21, 2004
take a look at the results of these traces:
trace(imgGal); //traces "1"
trace(itemClip1._y); //traces "32"
trace(itemClip[imgGal]._y); //traces "undefined"
why does the last trace not trace "32" like the second trace? I want to insert the variable "imgGal" onto the end of the mc "itemClip", how can I do this?
[Code]...
View 11 Replies
Aug 8, 2006
var dane:Array = new Array();
dane_xml = new XML();
dane_xml.ignoreWhite = true;[code]....
and this last trace gives me undefined while trace(temp) gives me what I want
View 7 Replies
Mar 20, 2009
Does creating a new instance of an Object that uses an identical name to an older instance, delete the previous instance? Or should the original instance be deleted first? The code uses a ridiculous amount of XML vars. Isn't it less memory intensive to parse the XML and save the properties to an Object, and then delete the XML Object, rather than keep the XML Object around and reference it's child nodes directly? Is it better form to break up a huge XML file (>600lines/3200vars) into smaller chunks?
View 1 Replies
Apr 8, 2011
I'm making the transition from AS2 to AS3 and have some rollover and rollout code below. I'm looking to place an if statement into the onClipOver function that can trace what specific button is being pressed. In AS2 I would use the "this" command to see which movieclip was being used. how to properly write the IF statements using AS3 in the code below.
[Code]...
View 2 Replies
May 17, 2009
I have 4 instances of the same button on a single layer in a timeline of the mc 'coverflow_mc' named 'ThatsMe_btn_a' to 'ThatsMe_btn_d' ie same button, same position.. it just changes instance name on 4 keyframes. Why does it call the function fine for button a but not for b,c, or d? There is a stop on each of these frames and I can see from the swf that it is stopping at the correct frames.
function thatsMe() {
right = new Sound();
right.attachSound("right");
[Code]....
View 3 Replies
Jun 4, 2003
I've got this function, in which I declare a variable. according to that variable I want to adress an instancename...
[Code]...
View 5 Replies