flex网页中的图片在本机编译运行时可以展示,但是IIS发布后无法加载图片
flex网页中的图片在本机编译运行时可以显示,但是IIS发布后无法加载图片
小弟最近在做flex开发,自己定义了一组图片作为功能钮:
<!-- 加载漫游、放大、缩小;上一视图、下一视图、全图工具条 -->
<mx:Image id="imgpan" source="../src/image/i_pan.gif" width="25" height="20" left="400" top="100" click="panmap()"
useHandCursor="true" buttonMode="true" smoothBitmapContent="true" toolTip="漫游"/>
<mx:Image id="i_zoomin" source="../src/image/i_zoomin.png" width="25" height="20" left="425" top="100" click="zoominmap()"
useHandCursor="true" buttonMode="true" smoothBitmapContent="true" toolTip="放大"/>
<mx:Image id="i_zoomout" source="../src/image/i_zoomout.png" width="25" height="20" left="450" top="100" click="zoomoutmap()"
useHandCursor="true" buttonMode="true" smoothBitmapContent="true" toolTip="缩小"/>
<mx:Image id="i_zoomprevious" source="../src/image/i_zoomprevious.png" width="25" height="20" left="475" top="100" click="zoompremap()"
useHandCursor="true" buttonMode="true" smoothBitmapContent="true" toolTip="前一视图"/>
<mx:Image id="i_zoomnext" source="../src/image/i_zoomnext.png" width="25" height="20" left="500" top="100" click="zoomnextmap()"
useHandCursor="true" buttonMode="true" smoothBitmapContent="true" toolTip="后一视图"/>
<mx:Image id="i_zoomfull" source="../src/image/i_zoomfull.png" width="25" height="20" left="525" top="100" click="zoomfullmap()"
useHandCursor="true" buttonMode="true" smoothBitmapContent="true" toolTip="全图"/>
其中的图片都是存放在SRC的包中:

该网页工程在本机IIS服务上发布的网站配置如下:

其中cnlinghtning文件夹就是工程所在目录。
注意到编译之后工程目录下的的bin-release文件夹里面也出现了Image文件夹并且将src里面的图片放入进去了,但是最后出现了这样的情况:
本机使用用flashbuilder启动工程的时候,可以看到图片:

但是在IIS里面启动浏览,或者在外网上通过网址访问的时候,就出现无法加载图片的问题

怀疑是因为路径的问题导致的,发布的路径指向了bin-release,是不是里面的html就只是识别改文件中的内容而无法识别../src这样外面的文件?如果要直接使用cnlightning文件夹发布,如何指定启动默认的页面呢?
最终是为了解决图片显示的问题,希望大家多多指教
------解决方案--------------------
LZ,建议你把图片和控件绑定,应该能解决这个问题。
例子:<s:Image x="10" y="30" source="@Embed('style/assets/compnent/panel/pre-tooltip.png')"/>
------解决方案--------------------
source="../src/image/i_pan.gif" 路径问题 改成 source="image/i_pan.gif" 试试
------解决方案--------------------
路径写法有问题,应该这样写:source="image/i_zoomnext.png"
小弟最近在做flex开发,自己定义了一组图片作为功能钮:
<!-- 加载漫游、放大、缩小;上一视图、下一视图、全图工具条 -->
<mx:Image id="imgpan" source="../src/image/i_pan.gif" width="25" height="20" left="400" top="100" click="panmap()"
useHandCursor="true" buttonMode="true" smoothBitmapContent="true" toolTip="漫游"/>
<mx:Image id="i_zoomin" source="../src/image/i_zoomin.png" width="25" height="20" left="425" top="100" click="zoominmap()"
useHandCursor="true" buttonMode="true" smoothBitmapContent="true" toolTip="放大"/>
<mx:Image id="i_zoomout" source="../src/image/i_zoomout.png" width="25" height="20" left="450" top="100" click="zoomoutmap()"
useHandCursor="true" buttonMode="true" smoothBitmapContent="true" toolTip="缩小"/>
<mx:Image id="i_zoomprevious" source="../src/image/i_zoomprevious.png" width="25" height="20" left="475" top="100" click="zoompremap()"
useHandCursor="true" buttonMode="true" smoothBitmapContent="true" toolTip="前一视图"/>
<mx:Image id="i_zoomnext" source="../src/image/i_zoomnext.png" width="25" height="20" left="500" top="100" click="zoomnextmap()"
useHandCursor="true" buttonMode="true" smoothBitmapContent="true" toolTip="后一视图"/>
<mx:Image id="i_zoomfull" source="../src/image/i_zoomfull.png" width="25" height="20" left="525" top="100" click="zoomfullmap()"
useHandCursor="true" buttonMode="true" smoothBitmapContent="true" toolTip="全图"/>
其中的图片都是存放在SRC的包中:
该网页工程在本机IIS服务上发布的网站配置如下:
其中cnlinghtning文件夹就是工程所在目录。
注意到编译之后工程目录下的的bin-release文件夹里面也出现了Image文件夹并且将src里面的图片放入进去了,但是最后出现了这样的情况:
本机使用用flashbuilder启动工程的时候,可以看到图片:
但是在IIS里面启动浏览,或者在外网上通过网址访问的时候,就出现无法加载图片的问题
怀疑是因为路径的问题导致的,发布的路径指向了bin-release,是不是里面的html就只是识别改文件中的内容而无法识别../src这样外面的文件?如果要直接使用cnlightning文件夹发布,如何指定启动默认的页面呢?
最终是为了解决图片显示的问题,希望大家多多指教
------解决方案--------------------
LZ,建议你把图片和控件绑定,应该能解决这个问题。
例子:<s:Image x="10" y="30" source="@Embed('style/assets/compnent/panel/pre-tooltip.png')"/>
------解决方案--------------------
source="../src/image/i_pan.gif" 路径问题 改成 source="image/i_pan.gif" 试试
------解决方案--------------------
路径写法有问题,应该这样写:source="image/i_zoomnext.png"