Re: [Flashcoders] This actionscript error is driving me mad
Dear Zeh, thank you for your reply. 2007/12/30, Zeh Fernando [EMAIL PROTECTED]: var p1:Point = new Point(10, 20); var p2:Point = p1; // not a copy, but a reference p2.x = 0; trave (p1.x); // traces 0, not 10 That's the only thing I can imagine. I guess it will depends on what's on the [snip] part of your code. Is anything (that's also part of the pathB array) assigned to pnt? Unfortunately, pnt is not assigned anywhere else. It only appears in those lines of code I have already sent. If I replace them with pnt.x=pnt.x; pnt.y=pnt.y; the code works fine! But anything else fails. I am thinking this could be an internal Flash bug. Where should I report this? I am willing to send all of my code if this could help tracing out the bug. BTW, happy new year! :) Bill Kotsias wrote: ...[snip]... private var pnt:Point = new Point(); private var dirp:int; private var fastp:int; private var i:int; private var pathB:Array; ...[snip]... for (dirp=fastp; dirp=i; dirp++) { // BUG!!! If I UNCOMMENT 1 of the 2 following lines, code gets mixed up. // pnt.x=pathB[dirp][0].x+pathB[dirp][2].x; // pnt.y=pathB[dirp][0].y+pathB[dirp][2].y; pnt=new Point(pathB[dirp][0].x+pathB[dirp][2].x,pathB[dirp][0].y+pathB[dirp][2].y); if (addElement(pnt, dirp, pathB[dirp][2], pathB[dirp][3]+1)) return pathF; } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] This actionscript error is driving me mad
Hello. I am a newbie to this list, so I am sorry if this message is off-topic. If it is, I would be obliged if anyone could direct me to the correct place. I am a veteran programmer but I am new to actionscript. I have come across some strange behaviour which is driving me mad. Following is a part of my code : ...[snip]... private var pnt:Point = new Point(); private var dirp:int; private var fastp:int; private var i:int; private var pathB:Array; ...[snip]... for (dirp=fastp; dirp=i; dirp++) { // BUG!!! If I UNCOMMENT 1 of the 2 following lines, code gets mixed up. // pnt.x=pathB[dirp][0].x+pathB[dirp][2].x; // pnt.y=pathB[dirp][0].y+pathB[dirp][2].y; pnt=new Point(pathB[dirp][0].x+pathB[dirp][2].x,pathB[dirp][0].y+pathB[dirp][2].y); if (addElement(pnt, dirp, pathB[dirp][2], pathB[dirp][3]+1)) return pathF; } As I mention above, if I uncomment //pnt.x=... or //pnt.y=... or if I even replace them with something like pnt.x=pnt.x+1; then my code gets mixed up and returns wrong results. This is driving me nuts because these two lines shouldn't have any effect since right below them there is pnt=new Point(...); which supposedly cancels the 2 previous instructions. Right? Could anyone, please, show me the obvious that I can't see? Many thanks in advance, Bill Kotsias ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders