display yahoo map in swf without wrapper html

本文探讨了在没有HTML包装器的情况下,在某些设备上直接运行SWF文件显示Yahoo地图的问题。作者尝试了多种方法来与SWF内容交互,但遇到了错误。文中详细介绍了尝试的解决方案和技术细节。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Goal:

To run a SWF shows yahoo map in some device rather than IE or Firefox . In my device, I can run swf only, no html.

Till now what I know:

  I built a Flex project following the Yahoo map tutorials

(http://developer.yahoo.com/flash/tutorials/as3/maps.html). It worked perfectly in IE or Firefox with the wrapper ***.html. But if I run .swf directly, the map can’t be shown.

 

 The SWF is in fact a wrapper of Yahoo map for AS2, It loads as2map.swf using SWFLoader, which is a subclass of UIComponent. One thing special is, when as2map.swf is loaded, wrapper swf call ExternalInterface.call to communicate with as2map.swf. The call is:

    Method name: YahooMapFlex.setMapSize100

       Parameter :   {w:100,h:100}

 “YahooMapFlex” is the name (in firefox) or id (in IE), “setMapSize” is a method exposed by as2map.swf. “ 100” is ID of sa2map instance, the value depends on specification in YahooMapFlex.swf.  If you call 101, the map cant show. There’s no document about the grammar of “ 100” .

 IE

 As2map.swf

YahooMapFlex.swf

ExternalInterface.call

 

 Calling “setMapSize” seems to be necessary. It triggers as2map to show itself.

 There are same other calls, but not necessary.

Question:

  If I open YahooMapFlex.swf in IE directly, map cant be shown. Is there some thing in the wrapper html? I simplify the wrapper html to this:

  Firefox:

<embed src="YahooMapFlex.swf" name="YahooMapFlex">

</embed>

 IE:

<object  id="YahooMapFlex" type="application/x-shockwave-flash" >

<param name="movie" value="YahooMapFlex.swf">

</object>

the key is “name” or “id” property must be specified, to communicate with the SWF. Since I have no wrapper html, I have no way to specify the ID or name.

 What’s more , in my device, ExternalInterface.available = flase, means I cant use ExternalInterface.

Now the problem come to a point: how can I communicate with a swf without using ExternalInterface.

 

I tried SWFLoader.content to make a call:

 var movie :*= this.content;

    movie.YahooMapFlex.setMapSize100({w:100,y:100});

    the result is an Error:

ReferenceError: Error #1069: flash.display.AVM1Movie has no property YahooMapFlex …

The following call also fail:

YahooMapFlex.setMapSize100({w:100,y:100});

movie. setMapSize ({w:100,y:100});

movie.setMapSize100 ({w:100,y:100});

 

 

 

So far I’m confused, any comment is appreciated. Thank you.

My msn : rogeryuan_9@hotmail.com

 

 
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值