shane7 Posted September 30, 2012 Posted September 30, 2012 Hi there, I upgraded my Flash Builder this morning, and all of a sudden my TweenLite.as is giving off warnings that have NEVER popped up in my life. It says: Assignment within conditional. Did you mean == instead of =? I've tried upgrading to GSAP v12, But instead of 1 error warning, it gave off 10, in different Greensock files... so I went back to 11. Any solutions? Really need to get this project finished Regards Shane
GreenSock Posted September 30, 2012 Posted September 30, 2012 Those are erroneous errors/warnings. It's complaining about a statement like this: if ((myVariable = obj.whatever)) { } Which is perfectly valid - it just assigns obj.whatever to myVariable and evaluates whether or not it's false/null. It's a more concise way of doing: myVariable = obj.whatever; if (myVariable) { } And it can be particularly useful for improving performance when there's an if/elseif statement because if the first part is true, the 2nd condition doesn't even have to get evaluated. For example: if (isPlaying) { ... } else if ((myVariable = obj.getValue())) { myVariable.blah = "blah"; ... } If isPlaying is true, then myVariable never gets set to obj.getValue() which also saves us a function call. That's much better than setting myVariable up front and then running the conditions. See what I mean? Flash Builder is trying to be helpful and it's assuming that we meant == instead of = because it's in a conditional. Not true in this case. Thanks, Flash Builder, but leave me alone and move along. Nothing to see here. If you're actually getting compiler errors, please let us know and post a very simple example FLA that we can publish to see the errors. And for the record, I'd definitely recommend v12 over v11. It's rock solid and more feature-packed. The main thing delaying v12's launch is some work we're doing on the JavaScript side of things.
shane7 Posted September 30, 2012 Author Posted September 30, 2012 Wow! Fantastic! Thanks so much for helping me understand it all. Makes way more sense now. Definitely a case of Flash Builder trying to be a know it all It was just warnings, so I'm definitely going to upgrade to v12 again. Thanks so much again for everything, and great work on the platform. Definitely a life saver! Regards Shane
andytwoods Posted March 7, 2013 Posted March 7, 2013 Hi Shane, totally agree with Adobe being silly regarding this. The problem is, with Air 3.6, it is now impossible to compile IOS apps using Tween* as Adobe INSIST one cannot use your cleverness. I fixed this by manually going through your code and doing what you suggest above: myVariable = obj.whatever;if (myVariable) {... Any chance you could incorporate this 'unnecessarily long' way of doing things in future versions? cheers,Andy. }
GreenSock Posted March 18, 2013 Posted March 18, 2013 Would you mind giving the preview of 12.0.4 a shot and let me know if it compiles better for you? Snag it from this other post please: http://forums.greensock.com/topic/7405-memory-issue-with-timelinemaxpausedtrue/#entry27944
andytwoods Posted February 10, 2014 Posted February 10, 2014 Sorry, I never saw your reply! I've recently encountered this issue again. You can modify your project to disable such messages: http://stackoverflow.com/questions/3610516/how-to-suppress-warnings-for-one-actionscript-file cheers,Andy.
Eyal Zaidman_23147 Posted September 3, 2014 Posted September 3, 2014 Is there a solution to this issue? Using FlashDevelop 4.6.4, I've encountered the same warnings. I understand that this is a perfectly valid code, but FD halts on this warnings... Any advice? Thanks, EZ
GreenSock Posted September 3, 2014 Posted September 3, 2014 Perhaps contact the FlashDevelop folks? Unfortunately, we have no control over what their IDE does I wish I had an easy fix for you, but it definitely seems like it's an issue on their end.
Eyal Zaidman_23147 Posted September 4, 2014 Posted September 4, 2014 Thanks, I've posted on FlashDevelop forum. P.S. Seems like it happens only with ASC 2.0
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now