PDA

View Full Version : Autoformat Bug



jonhallman
May 12th, 2007, 01:54 PM
I've been experiencing a supposed fault with CS3's autoformatting. It completely ignores my selected option of putting spaces around operators, and when assigning variables a class:


var theText = new TextField ();

it turns it into


var theText=new TextField ;

erasing the parenthesis... this is definitely not normal. When I delete the spaces that it creates, then autoformat it, it recreates the two spaces...

I'm very particular about keeping my code very clean and organized, so this is very frustrating.

Is anyone else experiencing this bug?

Voetsjoeba
May 12th, 2007, 02:21 PM
Nope, not happening here. But I did notice a typo: the Auto Format options panel's last checkbox says "mulitline" instead of "multiline".

senocular
May 12th, 2007, 03:22 PM
Nope, not happening here. But I did notice a typo: the Auto Format options panel's last checkbox says "mulitline" instead of "multiline".

niiiice. I'll log it :)

devonair
May 12th, 2007, 11:23 PM
I use FlashDevelop more than the actions panel, but just checked and it doesn't include spaces around operators for me either. I don't get the parenthesis problem though. Does it do that if you type your variables?

I kinda like "mulitline"... :)

dthought
May 12th, 2007, 11:24 PM
Can't say that I'm experiencing that one, but I have noticed on the Mac platform, if you have a large font in the AS window, sometimes characters get clipped weirdly although that's just visual artifacting and nothing code-damaging.

What I'd really like to know about the actions panel is, where did the Esc-shortcuts go? They were totally awesome. The option is still there, but it appears to do absolutely nothing.

jonhallman
May 12th, 2007, 11:32 PM
After working for a while, the problem stopped appearing... I'm glad it's gone, but I fear the day it returns...

K2xL
May 30th, 2007, 03:30 PM
I actually have this exact same problem mentioned. It doesn't happen all the time but it happens quite a bit.

-Danny

K2xL
May 30th, 2007, 04:09 PM
Also,
The parenthesis are sometimes removed from just regular lines. I had some mathematical calculations that suddenly stopped working because the autoformat removed the parenthesis around some operations!

-Danny

senocular
May 30th, 2007, 04:20 PM
FYI, adobe is aware of the issues currently mentioned in this thread. If you have found other unique circumstances where auto format fails, post them here and I will make sure Adobe is notified.

K2xL
May 30th, 2007, 06:06 PM
Thanks as usual Senocular,
Here is an example if adobe is interested. Just replace where you see mNumerator, mDenom,xPtNumerator, and xPtDenom with their value assigned.



/**
* The reason I do numerator and denomenator
* is due to a flash cs3 bug where when a file
* is autoformatted the paranthesis are sometimes
* removed... this causes errors in order of operations
*/
var mNumerator:Number = pt2.y-pt1.y;
var mDenom:Number = pt2.x-pt1.x;
var m:Number=mNumerator/ mDenom;
var g:Number= -1 / m;
var b1:Number= pt2.y - (m * pt2.x);
var b2:Number= p.y - (g * p.x);


var xPtNumerator:Number = -b1+b2;
var xPtDenom:Number = m-g;
var xPt:Number= xPtNumerator/xPtDenom;
var yPt:Number= m * xPt + b1;


This is a very critical bug, and I am afraid to use the autoformat now.

Originally when I only saw it happened to (what was mentioned above) blank constructor calls... I thought it was a new feature with AS3 that if the constructor was blank you didn't have to put parenthesis!

In other words, I thought


var a:Array = new Array();

to


var a:Array = new Array;

was a feature! LOL!

Huinoio
June 2nd, 2007, 11:25 AM
I was creating components in FlashCS3 and noticed my MetaTags suddenly stopped working. It took me a while to figure out that "auto format" was adding a semicolon to the end of the tags, effectively disabling them.
[Inspectable(type="Color",defaultValue="#D6DBFF")]
would become
[Inspectable(type="Color",defaultValue="#D6DBFF")];

Did anyone else already note this somewhere?

senocular
June 2nd, 2007, 11:29 AM
sending to auto format thread; logging as bug for Adobe

Dan0
July 29th, 2007, 01:54 PM
From this, perfect use of brackets;

var a = (mouseX-cellW)/(sW-cellW*2);
a=(a<0)?0:a;
a=(a>1)?1:a;
var s = (((sW-cellWTot*cellW)*a)-container.x)/6;
s=(s>maxS)?maxS:s;
s=(s<-maxS)?-maxS:s;
container.x += s;
to this MONSTER of a script;

var a=mouseX - cellW / sW - cellW * 2;
a=a < 0?0:a;
a=a > 1?1:a;
var s=sW - cellWTot * cellW * a - container.x / 6;
s=s > maxS?maxS:s;
s=s < - maxS?- maxS:s;
container.x+= s;
I was in tears after autoformating, and realising my code was completly screwed up. I spend about 15 mins trying to remeber what combo of brackets I had... then I remembered ctrl+z! YAYZERS for ctrl+z!!!:P:z::thumb2::thumb: all the smilies... I was looking for a praying one, so I can worship the undo command.

DFox
August 20th, 2007, 02:00 PM
Hey,

Does anyone have any info on the current status of this bug? It definitely has not been fixed yet which is ashame.

Auto format keeps forcing these bugs on my code, and I can't live without auto format :)

senocular
August 20th, 2007, 02:13 PM
It hasn't been fixed because CS3 is the latest version of Flash. Wait until CS4 comes out and check in on it then. Until that time, I wouldn't use auto format.

DFox
August 20th, 2007, 02:16 PM
It hasn't been fixed because CS3 is the latest version of Flash. Wait until CS4 comes out and check in on it then. Until that time, I wouldn't use auto format.
Oh, OK, thanks for the info. I thought maybe they could release it in an update patch but apparently that's wishful thinking :)

brommer
May 27th, 2008, 02:25 AM
I was royally screwed by this bug too, but, I found out what causes it (at least I was able to reproduce it on my system).

IF you have only .as files open (no .fla file open in flash - i.e. no Target in your .as window) then this format bug triggers.

Workaround is to have a .fla open (target set) all the time.

I think the autoformat looks for some info in a target .fla.

edtsch
August 18th, 2008, 05:16 PM
I think they should release a patch for this. I've had a couple of weird reformats too that changed the meaning and syntax of the code and rendered it unusable. I'm not sure if there's any point in my including examples here, but here's one, pared down to its essentials:

package packagename{

import flash.display.MovieClip;

public dynamic class myMovie extends MovieClip {

public function myMovie() {
}
}
}
becomes

package packagename{

import flash.display.MovieClip;

public dynamic class myMovie extends MovieClip {;

public function myMovie() {
}
}
}

edtsch
August 18th, 2008, 05:17 PM
I had a worse one revolving around a modulo operator that broke the code. I think my prior example still compiles.

edtsch
August 18th, 2008, 05:20 PM
By the way, it's the word "dynamic" in my example that trips up the autoformatter. If you remove it, the code formats just fine.

senocular
August 18th, 2008, 05:30 PM
final also does it.

As stated earlier in this thread, do not use auto format with Flash CS3.

glosrfc
August 18th, 2008, 06:00 PM
It hasn't been fixed because CS3 is the latest version of Flash. Wait until CS4 comes out and check in on it then. Until that time, I wouldn't use auto format.

Will CS3 owners get a free update to CS4 when it's released? It's fine to say check auto-formatting when CS4 comes out, but that's gonna be an expensive option for a lot of users! Earlier versions of Flash used to have updates to correct bugs but there's been no update for some of the issues in F8 like reporting the wrong stage size when testing a movie and, from the sound of it, there's unlikely to be an update for CS3.

Although I don't have CS3, making people upgrade (and pay) in order to obtain fully-functioning software doesn't seem to be the right way for Adobe to generate loyalty among their userbase. In some countries (the EU in particular) that type of commercial activity is also highly illegal!

dragonfly
September 20th, 2008, 11:42 PM
So for the entire remaining duration of Flash CS3 we can't use auto format? Really? :stare:

Templarian
September 21st, 2008, 12:14 AM
^It's how adobe does things, same reason they don't release a patch for the Aero, bug in Fireworks. It can be worked around so they figure they will get more customers without hurting anyone too badly. Adobe is a business. :(

senocular
September 21st, 2008, 11:35 AM
There are a number of reasons why a patch wouldn't released. For one, its widely understood that [loosely] all software has bugs. You can't escape that, especially with a product of Flash's magnitude. If Adobe tried to fix all the bugs for a release, that release may never be released. There's a schedule to be maintained and to make that schedule, decisions have to be made about what is most important and what can be left broken for now. In fact, some pretty cool features have been dropped from Flash CS3 because of time.

Directly after CS3 (and maybe even a little before) CS4 work started. For that release there's also a schedule that needs to be maintained and requirements that need to be met. If people had to stop work on that release to put out a patch for CS3, that could have an adverse affect on CS4. And yes, it sucks up more time than you would think to manage something like that.

Concerning the auto format, that especially is not critical for the application to function. It's merely a helper tool and if it doesn't work 100%, then it's not a serious issue. It is not a critical feature for application development and all the things it does you could have done while writing the code in the first place. Feature-wise, for AS3, it's also very new given the new syntax associated with ActionScript 3. Because it's been rewritten/reworked for that release, its much more likely that they'll be problems with it. Also, as Temp said, if there are workarounds, then priority is lowered because, again, its not considered critical for the application to function since the workaround can be used as a solution.

Then you have a certain customer satisfaction aspect. Yes, its true that a patch is usually a positive in this area, its not all sunshine and roses. How many of you out there actually like the Adobe auto-updater? Thought so. In fact when you search Adobe on Twitter you'll find that when most people are talking about Adobe, they're doing so to complain about the updater. (It's mentioned in #2 at Dear Adobe (http://dearadobe.com/top_rated.php). To constantly be pushing out patches for all these products means a substantially more annoying updater, as if it wasn't bad enough as it is.

And there could very well be a number of other reasons. But for the most part, patches are only released for critical issues, namely security related, or if there are some very serious problems with an application (like I believe Flash MX 2004 which originally had some major stability issues).

glosrfc
September 21st, 2008, 03:19 PM
I wouldn't be me if I didn't disagree fundamentally with some* of the points you've raised ;)

So here goes.

Why should software be treated any differently from another product? Okay, in the early days of computer development, buggy software was acceptable but surely not in an industry that claims to be mature? Given that the price of the Adobe CS3 suite is rapidly approaching that of a small car, I'll use the latter to make comparisons.

If you purchase a car you would expect it to work. As you point out, with critical problems e.g. safety, the customer would rightly demand, and expect, a product recall and the repairs (upgrades) to take place at the expense of the manufacturer.

However, you would also hope that the car's quality of build was also up to snuff. If you got the car home and found that the trim began to fall apart, the paint to peel, or the chrome to tarnish beyond normal wear and tear...you'd also expect the manufacturer and/or dealer to put these faults right. I doubt that you'd be very happy if they told you that, because they're currently developing the new Ford Millennium Atomic Conveyancer Mk VI, they can't be bothered to provide any kind of maintenance for earlier models. You'd also be miffed to be told that you'd have to buy the new model of car because all of the previous faults should be ironed out...yet without having the foggiest idea what new faults might also be introduced along with that new model. To me, that's the exact opposite of good customer satisfaction.

I'm pretty sure that the Ford MAC Mk VI designers would also have a whole heap of bells and whistles when it was still a concept car - three foot-high tail fins; solid rubber tyres; auto-parking; self-dimming headlamps, and so on. And most of these would've been dropped along the way because they were a) too costly, b) too silly, or c) would take too long to design according to the overall development schedule. Thus a MAC Mk VI would be introduced regardless yet it would still be fit for purpose.

So, while the autoformat option isn't deemed critical enough to prevent the software from working, it's purchased as part of the overall product and therefore the customer has an expectation that it should work. Otherwise it's like finding that the speedometer no longer works on your car. Sure there's a workaround for that....you can count the number of telegraph poles passed per minute, guess the average distance between them, and attempt to compute an average speed! But I doubt any sane driver would take that suggestion seriously.

Although it hasn't been mentioned, any counter-argument that software is naturally more complicated because it's designed to run on different platforms wouldn't hold water either. Cars are also designed to run on different platforms...different sides of the road, manual/automatic, diesel, unleaded, leaded, LPG, and so on.

Shifting responsibility onto the primary support function (the auto-updater) is disingeneous. Surely, if you recognise that the auto-updater is a problem, then more resource needs to be spent there to make that particular product fit for purpose too? Making it an opt-in, or selective, updater would overcome any perceptional difficulties with "constantly pushing out updates" - if the customer wants the updates, let the customer choose how and when they can obtain them...but at least make updates available. After all, the customer is also purchasing that support as part of the overall package. You wouldn't buy a car unless you knew that there was an adequate support infrastructure in place...spare parts, fuel, servicing, go-faster stripes and furry dice, etc.

I actually think that Temp summed it up...Adobe is a business. Sometimes they need to act like one too**.

* Okay...most!

** This isn't aimed just at Adobe, it's true for most of the software industry.

DFox
November 1st, 2008, 07:30 AM
Well, sadly, here we are over a year later looking at Flash CS4, and the Auto formatter contains the exact same bugs as in CS3.

Now I feel safe saying "Shame on Adobe". I reported the bugs myself over a year ago, and I'm sure many other people did also. They were clearly ignored. That's simply careless, and there's no other excuse for it.

Frankly, Adobe should be embarrassed. A once functional feature has been broken in the last 2 or 3 major releases of Flash. That's just bad quality control. I can see one version. But after that, it isn't "software has bugs", it's "software has bugs that were too lazy to fix".

I really hope they do something about this. Or maybe we can keep a running tally for how many versions of Flash they can release with a useless, completely broken auto formatter. You know what, even if they remove the feature, that's better than having this broken thing in an outstanding program. But I'd much prefer they just fix it.

johnglynn
January 7th, 2010, 09:50 AM
package {

class VideoFlash extends Media {

public function VideoFlash() {
playMedia = new PlayVideo();
recordMedia = new RecordVideo();
}

}
}


when I auto format it becomes



package {

class VideoFlash extends Media {

public function VideoFlash() {
playMedia = new PlayVideo ;
recordMedia = new RecordVideo ;
}

}
}


No big deal with a 16 line code but my 680 line code really got screwed up!! And took forever to dubug:anger:!