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

Developer

Forums

Hi,

I have created a sample app on flash. This is my code.

result += ISHELL_CreateInstance(pMe->piShell, AEECLSID_FlashAMCPlayer, (void **)&pMe->piFlashPlayer);
//Create FlashWidget
result += ISHELL_CreateInstance(pMe->piShell, AEECLSID_FlashWidget, (void **) &pMe->piwFlash);
//Create FlashFrameModel
result += ISHELL_CreateInstance(pMe->piShell, AEECLSID_FlashFrameModel,(void **)&pMe->piFlashFrameModel);
//Set FlashPlayer to FlashFrameModel
result += IFlashFrameModel_SetIFlashPlayer(pMe->piFlashFrameModel, pMe->piFlashPlayer);
//Set FlashFrame model as FlashWidgt's model
result += IWidget_SetModel(pMe->piwFlash, (IModel *)(void *)pMe->piFlashFrameModel);

{
IWidget * piwLayer = 0;
WidgetExtent we;
//AEERect rcRoot;
// Base container
result += ISHELL_CreateInstance(pMe->piShell, AEECLSID_XYContainer, (void **)&(pMe->picLayer));

result += IXYContainer_QueryInterface(pMe->picLayer, AEEIID_IWidget, (void **)&piwLayer);

we.width = pMe->deviceInfo.cxScreen;//pMe->rcRoot.dx;
we.height = pMe->deviceInfo.cyScreen;//pMe->rcRoot.dy;
IWidget_SetExtent(pMe->piwFlash, &we);
}

// Create an instance of SignalCBFactory.
result += ISHELL_CreateInstance(pMe->piShell, AEECLSID_SignalCBFactory, (void **)&pMe->piSignalCBFactory);
// Create a signal to be used for Flash player events.
result += ISignalCBFactory_CreateSignal(pMe->piSignalCBFactory,Flash_OnEvent, pMe,&pMe->piSignal, &pMe->piSignalCtl);
// Register a signal to be set if a Flash player event occurs.
result += IFlashPlayer_OnEvent(pMe->piFlashPlayer, CAST(ISignal *, pMe->piSignalCtl));
//Load swf file

res =IFlashPlayer_LoadURL(pMe->piFlashPlayer, SWF_MOVIE_FILE); // SWF_MOVIE_FILE "fs:/~/flash_basicapp.swf"...

So when ever i launch the brew mp simulator it is creating 4 files in this path "C:\Brew MP\Targets\Sapphire (1.0.2.320)\fs\usermods\flashapp" (flash app is my sample app).
1. MIF
2. BAR
3. DLL
4. PDB file.

So i think this is the MIF directory path. So in this path there is no "flash_basicapp.swf" file. So when i try to do IFlashPlayer_LoadURL, it is returning EFILENOEXISTS error. So after launching the brew mp simulator, if i paste the flash_basicapp.swf file in this path ("C:\Brew MP\Targets\Sapphire (1.0.2.320)\fs\usermods\flashapp"), then it is returning this junk value 127319040.

What this junk value means?

And when ever i launch the brew mp simulator, it is creating new MIF BAR DLL PDB files. Why it is like that? And previously pasted "flash_basicapp.swf" in the working directory is automatically removed. Why it is removed automatically when i launch the simulator?

Thanks in advance
Jit

This is my CIF file.
include "flashapp.h"
include "AEEFlashPlayerPrivs.bid"
include "AEEFlashWidget.bid"
include "AEEFlashAppletFactory.bid"
-- Include Directory = F:\SVN\flashapp\flashapp
-- Include Directory = C:\Program Files\Qualcomm\Brew MP SDK\Platforms\1.0.2.320\platform\languages\inc
ModRsc {
name ="IDS_STRING_6",
id = 6,
type = 1,
data =UTF16_EncString("Remoba"),

Applet {
appletid =AEECLSID_flashapp,
resbaseid =20,
applethostid = 0,
type = 0,
privs = {AEEPRIVID_FlashPlayerAllowASExtensions,AEEPRIVID_FlashPlayerAllowASExtensionEvents},

ModRsc {
name ="IDS_STRING_20",
id = 20,
type = 1,
data =UTF16_EncString("flashapp"),

Dependencies{
AEECLSID_FlashAppletFactory

This is my CIF file.
include "flashapp.h"
include "AEEFlashPlayerPrivs.bid"
include "AEEFlashWidget.bid"
include "AEEFlashAppletFactory.bid"
-- Include Directory = F:\SVN\flashapp\flashapp
-- Include Directory = C:\Program Files\Qualcomm\Brew MP SDK\Platforms\1.0.2.320\platform\languages\inc
ModRsc {
name ="IDS_STRING_6",
id = 6,
type = 1,
data =UTF16_EncString("Remoba"),

Applet {
appletid =AEECLSID_flashapp,
resbaseid =20,
applethostid = 0,
type = 0,
privs = {AEEPRIVID_FlashPlayerAllowASExtensions,AEEPRIVID_FlashPlayerAllowASExtensionEvents},

ModRsc {
name ="IDS_STRING_20",
id = 20,
type = 1,
data =UTF16_EncString("flashapp"),

Dependencies{
AEECLSID_FlashAppletFactory

It looks like IFlashPlayer_LoadURL() is returning AEE_IFlashPlayer_EPENDING, which is the expected behavior. When the load is complete your signal should fire at which point you should call IFlashPlayer_Play(). c_ui_flashplayer shows you how to do to this.
As for those files constantly being recreated, check your post-build steps or your debugging steps in your VS project - it sounds like something is running which is blowing away your current directory and recreating it.
Hope this helps,
Mike

It looks like IFlashPlayer_LoadURL() is returning AEE_IFlashPlayer_EPENDING, which is the expected behavior. When the load is complete your signal should fire at which point you should call IFlashPlayer_Play(). c_ui_flashplayer shows you how to do to this.
As for those files constantly being recreated, check your post-build steps or your debugging steps in your VS project - it sounds like something is running which is blowing away your current directory and recreating it.
Hope this helps,
Mike

Please see my reply on the thread titled "unable to run the flash swf file".
Thanks,
Mike

Please see my reply on the thread titled "unable to run the flash swf file".
Thanks,
Mike

Hi,
Thanks for the reply. Yaa it is coming to IFlashPlayer_Play. It is returning success too. But the swf file is not playing. I guess the IDS_DD_HW_RAM_SIZE is the problem. I increased it too. But it is not playing. I'm using saphire(1.0.2.320) simulator.
if (AEE_SUCCESS == IFlashPlayer_GetEvent(pMe->piFlashPlayer, &event)) {
if (IFlashPlayer_Event_LoadComplete ==
(IFlashPlayer_Event_LoadComplete & event))
{
int err;
err =IFlashPlayer_Play(pMe->piFlashPlayer);
DBGPRINTF("Err");
}
If RAM SIZE is the problem, then in c_ui_flashplayer example, the same swf file is playing. :(
Thanks in advance.
Jit

Hi,
Thanks for the reply. Yaa it is coming to IFlashPlayer_Play. It is returning success too. But the swf file is not playing. I guess the IDS_DD_HW_RAM_SIZE is the problem. I increased it too. But it is not playing. I'm using saphire(1.0.2.320) simulator.
if (AEE_SUCCESS == IFlashPlayer_GetEvent(pMe->piFlashPlayer, &event)) {
if (IFlashPlayer_Event_LoadComplete ==
(IFlashPlayer_Event_LoadComplete & event))
{
int err;
err =IFlashPlayer_Play(pMe->piFlashPlayer);
DBGPRINTF("Err");
}
If RAM SIZE is the problem, then in c_ui_flashplayer example, the same swf file is playing. :(
Thanks in advance.
Jit