[flexcoders] AIR crash when call C function

2011-12-25 Thread James Ong
I want to pass the James string to getTestString function, the first
time, the string could return This is James without any error.
Subsequently after the button is click, the application will just
hang/crash (grey out), it seem there some bugs in this code?

Screenshot: http://imagetwist.com/7896zupwtu97/a.jpg.html

Code:

FREObject getTestString(FREContext ctx, void* funcData, uint32_t argc,
FREObject argv[]) {
FREObject result;

//Temporary values to hold our actionscript code.
uint32_t albumLength;
const uint8_t *str;
uint8_t *strAll;

//Turn our actionscrpt code into native code.
FREGetObjectAsUTF8(argv[0], albumLength, str);
strcpy(strAll,This is );
strcat(strAll,str);  //str is James

//const char *str = this is ;
FRENewObjectFromUTF8(strlen(strAll)+1, (uint8_t *)strAll,
result); //UTF8 to object and return

return result;
}


[flexcoders] Bug in C function caused AIR to crash

2011-12-25 Thread yanlilei64
I want to pass the James string to getTestString function, the first
time, the string could return This is James without any error.
Subsequently after the button is click, the application will just
hang/crash (grey out), it seem there some bugs in this code?

Screenshot: http://imagetwist.com/7896zupwtu97/a.jpg.html

Code:

FREObject getTestString(FREContext ctx, void* funcData, uint32_t argc,
FREObject argv[]) {
   FREObject result;

   //Temporary values to hold our actionscript code.
   uint32_t albumLength;
   const uint8_t *str;
   uint8_t *strAll;

   //Turn our actionscrpt code into native code.
   FREGetObjectAsUTF8(argv[0], albumLength, str);
   strcpy(strAll,This is );
   strcat(strAll,str);  //str is James

   //const char *str = this is ;
   FRENewObjectFromUTF8(strlen(strAll)+1, (uint8_t *)strAll,
result); //UTF8 to object and return

   return result;
}



RE: [flexcoders] Re: Problem migrating project from FB 4.5 to FB 4.5.1 - runtime error

2011-12-25 Thread Sells, Fred
I'm not using 4.5.1 yet, so this observation is more generic than you
may want.  When using the tabnavigator without states, but just setting
the index, I get this error if I try to access a variable/method in any
child other than the first child.  Apparently they are not created until
they are displayed the first time.  A possible solution is to display
each one briefly in a loop at startup.  Perhaps you could even make the
container invisible so it's faster - not sure.

 

Hope this helps,

 

Fred.

 

From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On
Behalf Of yms0411
Sent: Sunday, December 25, 2011 1:52 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Problem migrating project from FB 4.5 to FB
4.5.1 - runtime error

 

  

have you any solutions from this yet? 

I am having the same problem when i am making changes in views.
In my case, I wasn't using visual states to make state transitions
however through dynamically adding and removing elements.

null reference error with the following msg:

at spark.components::Scroller/focusInHandler()at
spark.components::Scroller/focusInHandler()[E:\dev\4.5.1\frameworks\proj
ects\spark\src\spark\components\Scroller.as:1273]
at flash.display::Stage/set focus()
at
mx.core::UIComponent/setFocus()[E:\dev\4.5.1\frameworks\projects\framewo
rk\src\mx\core\UIComponent.as:9895]
at
mx.managers::FocusManager/setFocus()[E:\dev\4.5.1\frameworks\projects\fr
amework\src\mx\managers\FocusManager.as:598]
at
mx.managers::FocusManager/activate()[E:\dev\4.5.1\frameworks\projects\fr
amework\src\mx\managers\FocusManager.as:864]
at
mx.managers.systemClasses::ActiveWindowManager/deactivateForm()[E:\dev\4
.5.1\frameworks\projects\framework\src\mx\managers\systemClasses\ActiveW
indowManager.as:259]
at
mx.managers.systemClasses::ActiveWindowManager/deactivate()[E:\dev\4.5.1
\frameworks\projects\framework\src\mx\managers\systemClasses\ActiveWindo
wManager.as:213]
at
mx.managers::FocusManager/hideHandler()[E:\dev\4.5.1\frameworks\projects
\framework\src\mx\managers\FocusManager.as:1765]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at
mx.core::UIComponent/dispatchEvent()[E:\dev\4.5.1\frameworks\projects\fr
amework\src\mx\core\UIComponent.as:13128]
at
mx.controls::Menu/dispatchEvent()[E:\dev\4.5.1\frameworks\projects\mx\sr
c\mx\controls\Menu.as:1528]
at
mx.core::UIComponent/setVisible()[E:\dev\4.5.1\frameworks\projects\frame
work\src\mx\core\UIComponent.as:3280]
at mx.core::UIComponent/set
visible()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\core\UICompo
nent.as:3238]
at
mx.controls::Menu/hide()[E:\dev\4.5.1\frameworks\projects\mx\src\mx\cont
rols\Menu.as:1773]
at
mx.controls::Menu/http://www.adobe.com/2006/flex/mx/internal::hideAllMen
us()[E:\dev\4.5.1\frameworks\projects\mx\src\mx\controls\Menu.as:2528]
at
mx.controls::Menu/mouseUpHandler()[E:\dev\4.5.1\frameworks\projects\mx\s
rc\mx\controls\Menu.as:1928]