View Full Version : AS3 project in flex 2 - Compile error keeps coming
bzouchir
08-06-2007, 03:50 AM
Hi guys,
I'm new to using flex 2 to write my AS3 projects but I have benn finding it great so far, until yesterday thi started to happen.
Basically it's really simple classes and the problme is not related to the code, might be a flex bug? or flash player?
for instance I'm writting a main class, instantiating a class where I define a variable, that due to scope returns a null value when compiling, lunchs the debugging perspective, error highlighted in red saying can't access null object...
all this is alright.
I see the problem , I fix it, compile again, same error again :|
I even delete this variable and simply add a trace command, and compile, same error saying this variable is null, or the can't access a function that doesn't even exist anymore!
does this ever happened to anyone working AS3 projects in Flex builder 2?
Please help, even relaunching flex application doesn't solve it! where is it still reading this variable from?!:confused:
how can i fix this?!
just to add when running or debuggin I'm launching the swfs directly instead of launching the default html.
thanks
kifah
08-06-2007, 09:13 AM
I suggest you to add code to this thread to understand excatly what's the problem
but if you create new actionscript project in Flex
note that you can't use stage properties in constructor function
bzouchir
08-06-2007, 12:38 PM
that's the weird thing that it's not code related.
Whatever compile error I get, in many different scenarios, even if i fix it it keeps being reported.
I'll try to write a sample code tonight to try to replicate and demonstrate the problem.
cheers
kifah
08-06-2007, 01:06 PM
Dear bzouchir
sometimes we think that the problem is not in the code but
Access to null object reference
appears in runtime when some instance are not defination
so post your simple code and let me try it in my PC then we will consider if the problem with code or Flex Builder 2 it self
ok
ryryguy
08-06-2007, 06:55 PM
Am I understanding correctly, you're seeing this as a compile-time error?
I've seen a few times where Flex continues to report a compile warning even when the code at that line has been changed... even if, for example, I've changed that code to a comment. Using the Clean command under the Project menu has cleared that up for me.
(If it's a run-time error then never mind.)
bzouchir
08-07-2007, 01:08 AM
thanks for the help.
kifah: it's not a runtime-error that's the weird thing, it's showing a compile-time error.
It's exactly what "ryryguy" said, I have changed the code into a comment, and Flex still reported it at compile-time.
I will try to clean and let you know if it happens.
I would be happy to put the code if it wasn't massive, I'm in the final stages of the app.
I need to try to write some small code to try and get that error again.
Note that this error is not the same everytime.
basically it's whatever error I had, it keeps coming again!
null Object, access of undefined property, etc...
after fixing the error or after changing the code to comment, that same error comes back each time, I even deleted the class file, I was instantiating through the main class, got rid completely of the relation between both, and I kept getting the error about a null variable i had in that class i deleted.
Really weird!
I'll try the clean command and let you know how it goes.
thanks a lot guys
kifah
08-07-2007, 04:47 PM
bzouchir:
sorry I misunderstand you
but did you try to Uninstall the flex application and then reinstall it ?
and maybe there is another Java program service encounter the service of Flex builder 2.0 which it's Javaw ?
and so on ..
geniium
10-28-2008, 09:41 AM
Hello guys,
Im facing exactly the same problem, still today, with the last version of the compiler and Flex Builder.
Looking for a workaround.
Any help'd be appreciated!
Thanks!
geniium
10-28-2008, 09:48 AM
Cleaning the project with the "Project > Clean ... " command didn't help at all.
But cleaning the browser's cache did the trick.
Works again.
Cheers!
PS: Safari and Firefox are really really crashing a lot when the flex application is launched in debug mode. Do you have the same problem?
bzouchir
10-28-2008, 11:32 PM
Yup i remember clearing the cache did the trick for me as well, sorry should have updated the post.
If the browser is crashing try to launch the profiler if you're using FlexBuilder and see if you have any memory leaks.
In debug mode check if you are logging/tracing any infinite loops or huge objects.
good luck
jedrichards
03-30-2009, 03:50 PM
hallo.
sorry, a bit late to the party.
this exact same problem was happening for me quite a lot. i think it comes from not terminating a flex builder debugging session. if you get a runtime error while viewing your SWF through the debugging perspective (like null object reference) then jump back into your code without terminating the debugging session then it'll trip up the compiler when it nexts tries to compile the project (like when you hit save etc.)
just make sure to press the red "stop button" in the debugging perspective when you get a run time error. this will close the debugging perspective, and exit out of whatever you're using to view your SWF (be that a browser or standalone flash player).
hope this helps someone :P
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.