Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

hi all,

After doing some experiements in flash+AS+Extension+BrewMP, I have two basic doubts.

1. When flash runs with an ActionScript Extension with the backend C/C++ brew native code, who controls the graphics, Flash Engine or BREW ?
Take for example, I have a movie clip playing in flash. on Pressing a flash button I want a IDisplay_DrawHLine() function to draw a line somewhere in the screen (because AMC 1.1 do not support lineTo )
Will it work ?

2. I can run a swf movie in a flash widget X based on IFlashPlayer, but can my application (containing the flash widget X ) get some kind of notification on "key presses or any other event in the swf movie" ?

Looking forward to find some answer.

~bubble

Hi Bubble,
1) Combining IDisplay draw functions would not work very well, since they draw synchronously and the widget draw cycle is asynchronous. Since you mentioned that lineTo is not present, as a work around, you could create a movie clip with a simple image imported into the .fla to use as the line. If you are concerned about size you could use a very small image and adjust the scaling on the movie clip containing the image.
If you don t have to draw the line via ActionScript, since strokes aren t supported, use fill instead. For instance, you can draw a simple line with a rectangle that is extremely narrow.
2) In the event where the key presses are handled by the swf and you would like to notify the app, you would need to create an ActionScript extension that could send an event to the application via ISHELL_SendEvent() or ISHELL_PostURL().
-Jason

Hi Bubble,
1) Combining IDisplay draw functions would not work very well, since they draw synchronously and the widget draw cycle is asynchronous. Since you mentioned that lineTo is not present, as a work around, you could create a movie clip with a simple image imported into the .fla to use as the line. If you are concerned about size you could use a very small image and adjust the scaling on the movie clip containing the image.
If you don t have to draw the line via ActionScript, since strokes aren t supported, use fill instead. For instance, you can draw a simple line with a rectangle that is extremely narrow.
2) In the event where the key presses are handled by the swf and you would like to notify the app, you would need to create an ActionScript extension that could send an event to the application via ISHELL_SendEvent() or ISHELL_PostURL().
-Jason

Hi Jason:
I think I am meeting the similar problem.
Actually, I need use the ICamera in my action script extension. So i need either draw the preview frame in extension or pass it to action script (Flash) to render it.
I don't know how to deal with it?
I tried to draw something in extension in the flash_extension example ASESample_TimerFired interface, thought the display is created, but nothing is rendered on screen, So i suspect that the display in extension won't work at all. (it's not working well or not, but working or not)
then I guess I have to pass it to ActionScript, but I can only use
IASArgs_SetToInteger, IASArgs_SetToString, IASArgs_SetToObject, IASArgs_SetToBoolean
to organize the parameter, I don't think they're suitable for my case, right? Even i pass it to ActionScript successfully, how can i render it in ActionScript?
Can you give me some advises?
Thanks
Chunyuan

Hi Jason:
I think I am meeting the similar problem.
Actually, I need use the ICamera in my action script extension. So i need either draw the preview frame in extension or pass it to action script (Flash) to render it.
I don't know how to deal with it?
I tried to draw something in extension in the flash_extension example ASESample_TimerFired interface, thought the display is created, but nothing is rendered on screen, So i suspect that the display in extension won't work at all. (it's not working well or not, but working or not)
then I guess I have to pass it to ActionScript, but I can only use
IASArgs_SetToInteger, IASArgs_SetToString, IASArgs_SetToObject, IASArgs_SetToBoolean
to organize the parameter, I don't think they're suitable for my case, right? Even i pass it to ActionScript successfully, how can i render it in ActionScript?
Can you give me some advises?
Thanks
Chunyuan

Is there anyone can answer my question?

Is there anyone can answer my question?

When you say- "flash runs with an ActionScript Extension with the backend C/C++ brew native code" can you give an example? How exactly do you achieve this? I want to use Flash for making UI of my BREW C++ application. But I could not find much help on this.
Can you explain the method?
Thanks.

When you say- "flash runs with an ActionScript Extension with the backend C/C++ brew native code" can you give an example? How exactly do you achieve this? I want to use Flash for making UI of my BREW C++ application. But I could not find much help on this.
Can you explain the method?
Thanks.

Chunyuan,
There really isn't a way for an AS extension to render data *through* the Flash content. If your AS extension is using ICamera, you will have both ICamera and the Flash player fighting over who draws to the display. What you'd probably end up with is either no camera display or flickering.
One way to tackle this would be to use the CameraFrameModel within a FrameWidget which gets overlaid on top of the FlashWidget. This would allow both Flash and ICamera to work simultaneously (though you may lose some FPS in ICamera due to being in frame callback mode). This would also add some complexity on the interaction between your .swf, your AS extension, and the FrameWidget (which has to be controlled by your host application).
Hope this helps,
Mike

Chunyuan,
There really isn't a way for an AS extension to render data *through* the Flash content. If your AS extension is using ICamera, you will have both ICamera and the Flash player fighting over who draws to the display. What you'd probably end up with is either no camera display or flickering.
One way to tackle this would be to use the CameraFrameModel within a FrameWidget which gets overlaid on top of the FlashWidget. This would allow both Flash and ICamera to work simultaneously (though you may lose some FPS in ICamera due to being in frame callback mode). This would also add some complexity on the interaction between your .swf, your AS extension, and the FrameWidget (which has to be controlled by your host application).
Hope this helps,
Mike