PDA

View Full Version : This is driving me CRAZY


funkpucker
10-28-2003, 04:42 AM
anger.....
I would greatly like it if someone could tell me why this is happening...
I copy/pasted the following line of code into two different flash documents.

_root.onLoad = function() {
trace(com.robertpenner.easing.Quad.easeOut(1, 30, 30, 30));
};

The one empty flash document (that I created to make sure I wasn't insane) traces correctly...
The flash document I was working in that is giving me hell traces undefined.
Neither document has a onLoad event (besides this one) and both documents are saved in the exact same folder.

btw... I ran into this problem because I am trying to make my Flash MX document work with 2004 in order to take advantage of 2004's ability to display images (and other xml content) in dynamic textboxes

also, not 10 minutes ago I copy/pasted the exact line of code into the same frame, in the same position in the AS and it traced correctly... why is it that 10 minutes later it doesn't trace correctly...? I changed nothing about the file besides using trace in a few places to make sure the functions were being called correctly.
Also, a very similar thing happened in a different way.
I'm using array's to keep track of menu buttons. When I attached an onRelease action to the targeted button in the array, it worked, then 5 minutes later didn't work. I created a dummy flash file to make sure I wasn't crazy, swapped out the exact lines of code for the array and button action, and it worked. I went back and put in the actual path of the button instance in the original file, and it worked, I swapped the path for the array reference, it didn't work..... I don't understand.

Is this a bug in 2004, a bug in my file, a bug in my programming, or a bug in me?


also, another side question.
did #include change from AS1 to AS2? Is #include used at all anymore? or just classes? Because for some reason, the functions in my external AS file aren't being called. I take them out of the AS file and put them into the MX 2004 document, and they call correctly.
Also, I can't seem to figure out how to make the external AS file into a proper class; or rather know if I should be trying to make it into a class at all, or just leave it as an AS file (classless).

AS2 is so much more confusing to me than AS1... Everything used to be so simple... Maybe I'm just behind the curve.

2/3Soul
10-28-2003, 12:11 PM
it might be something to do with the fact that all variables in AS2 need to be predefined. If you define the variable first, does it work?

funkpucker
10-28-2003, 01:38 PM
The variable (Array) was defined correctly. I used the exact same lines of code in both documents. I targeted them correctly using absolute values with the "target" button. So I'm sure Flash sees the objects and their related instance names, just for some reason the code didn't work.
It didn't even work when I commented out every other piece of code in the entire flash document.
It's weird to me that although it can target the objects correctly in an Array in one document, when I put the code in another document, it doesn't work...sometimes...
I can't figure out what I did to break the document. If I reload the last good saved document and put the exact same code in the file, it works. It's so weird to me.

funkpucker
10-30-2003, 09:31 PM
oh well...
I took away the attachment

I didn't figure out why it didn't work... maybe something to do with the fact that it was originally an MX document and I saved it as 2004. All the code is the same, but whatever.

Eric Echols
11-03-2003, 11:29 AM
Check the Publish settings. The ActionScript version and optimization for 6.xxx could be your problem.