Hi,

I would like to integrate a flash object in my web application. If the
flash object does not require a configuration file, it works fine with
the given example at
http://cwiki.apache.org/WICKET/object-container-adding-flash-to-a-wicket
-application.html
<http://cwiki.apache.org/WICKET/object-container-adding-flash-to-a-wicke
t-application.html> .

 

However, it does not work, if the flash object is based on an XML
configuration file.  In my case, the flash objects requires some
information from  the config.xml file which must be placed within the
same folder as the flash object is placed. 

But I always get the following error:

"Error loading asset - please check config.xml & all assets exist on the
expected path  Error #2032"

 

Playing around with the firebug, I found out that the flash object
always looks for the config.xml file in the root folder of the web
application!?!? Therefore I searched the Forum for another solution. I
found an interesting posting at
http://apache-wicket.1842946.n4.nabble.com/Embedding-advanced-flash-obje
ct-td1875047.html.

>From this posting I used the following code, but I got the same error
message:

 

static final ResourceReference WHITEWHEEL = new ResourceReference(
TastefulSearchPanel.class, "WineWheel.swf" );

static final ResourceReference CONFIGWHITE = new ResourceReference(
TastefulSearchPanel.class, "config.xml" );

 

String swfURL = RequestUtils.toAbsolutePath( urlFor( WHITEWHEEL
).toString() );

 

WebMarkupContainer flashParam = new WebMarkupContainer("flashParamTag");

WebMarkupContainer flashSrc = new WebMarkupContainer("flashSrcTag");

WebMarkupContainer flashEmbed = new
WebMarkupContainer("flashEmbedTag");

 

IModel flashConfig = new AbstractReadOnlyModel<String>(){

 

                @Override

                               public String getObject() {

                                                              return
RequestUtils.toAbsolutePath(RequestCycle.get().urlFor(CONFIGWHITE).toStr
ing());

                               }

};

 

IModel flashFile = new AbstractReadOnlyModel<String>(){

 

@Override

                               public String getObject() {

                                                               return
RequestUtils.toAbsolutePath(RequestCycle.get().urlFor(WHITEWHEEL).toStri
ng());

                               }

 

};

 

flashParam.add(new AttributeModifier("value", flashConfig));

flashSrc.add(new AttributeModifier("value", flashFile));

flashEmbed.add(new AttributeModifier("flashvars", flashConfig));

flashEmbed.add(new AttributeModifier("src", flashFile));

 

add(flashParam);

add(flashSrc);

add(flashEmbed);

 

 

**********************************************

In the mark-up I use the following code:

 

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="700"
height="700" id="WineWheel">

                    <param wicket:id="flashParamTag" name="FlashVars"
value="someVar=someValue" />

 
<param wicket:id="flashSrcTag" name="SRC" value="WineWheel.swf" />

 
<param name="quality" value="high" /><param name="bgcolor"
value="#ffffff" />

 
<param name="allowScriptAccess" value="sameDomain" />

 
<param name="allowFullScreen" value="true" />

                    <embed wicket:id="flashEmbedTag"
flashvars="someVar=someValue" src="WineWheel.swf" menu="false"
pluginspage="
http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=S
hockwaveFlash" width="700" height="700" name="WineWheel">

                    </embed>

</object>

 

**********************************************

 

Do you have any solution on my problem? The weird thing is, that it
works on a regular web server, when I deploy the html markup that is
generated by wicket (of course, after modifying the paths that were also
generated by wicket). As I said, the problem is that it always tries to
access the config.xml file from the root of my web app at
http://localhost:8080/w7/config.xml. 

 

Thanks for your help.

Rainer

 

Reply via email to