|
主题: 急!!!WEBXTRA如果使用相对路径!
|
 chentian
职务:普通成员
等级:1
金币:0.0
发贴:118
注册:2002/1/2 10:05:49
|
#12002/3/4 21:43:08
今天在做东西的时候用了WEBXTRA这个插件,链接文件的时候发现这个插件好象只能用绝对路径,打包出来以后COPY到别的机子上就找不到链接文件了,检查后发现是使用绝对路径的问题,这样到了别台机子上路径还是链接到原来的那台打包的机子,所以不对,必须使用相对路径才可以~~~但是实在不知道WEB XTRA如何使用相对路径,请各位大虾帮忙~~~谢谢了!
|
 我是小马
职务:普通成员
等级:3
金币:17.0
发贴:794
注册:2000/11/13 14:56:59
|
#22002/3/4 23:43:38
可以使用相对路径的
Navigate(sprite 1, the moviepath&"htmlpath\aaa.html")
|
 chentian
职务:普通成员
等级:1
金币:0.0
发贴:118
注册:2002/1/2 10:05:49
|
#32002/3/5 0:05:53
Navigate(sprite 1, the moviepath&"htmlpath\aaa.html")
我没怎么看懂,这句是加在哪里的?!怎么个加法呢?!谢谢~~~:P
|
 我是小马
职务:普通成员
等级:3
金币:17.0
发贴:794
注册:2000/11/13 14:56:59
|
#42002/3/5 8:57:30
sprite 1 为xtra所在的通道号, the moviepath & “htmlpath\aaa.html”为aaa.html相对于director影片的相对位置
这句可以写在on mouseup句柄里或者帧脚本里
|
 chentian
职务:普通成员
等级:1
金币:0.0
发贴:118
注册:2002/1/2 10:05:49
|
#52002/3/5 13:34:58
能不能再说详细些,我还是没有弄出来` 比如说,我有个1.htm的文件放在XTRA里,然后我的DIR文件和这个1.htm在同一个目录下,那么对于上面的那段Navigate(sprite 1,the moviepath&"htmlpath\aaa.html")我应该怎么写呢?!
请指教!谢谢!
|
 我是小马
职务:普通成员
等级:3
金币:17.0
发贴:794
注册:2000/11/13 14:56:59
|
#62002/3/5 13:52:28
举例:
下面是目录结构: -html [目录] |-aaa.html [html文件] -projector.exe [可执行文件] -1.html [html文件]
插入webxtra并将其拖放到舞台(sprite 1),然后新建两个按钮〔浏览aaa.html〕〔浏览1.html〕
在按钮〔浏览aaa.html〕上加如下行为 on mouseup me Navigate(sprite 1, the moviepath&"html\aaa.html") end
在按钮〔浏览1.html〕上加如下行为 on mouseup me Navigate(sprite 1, the moviepath&"aaa.html") end
|
 chentian
职务:普通成员
等级:1
金币:0.0
发贴:118
注册:2002/1/2 10:05:49
|
#72002/3/5 13:58:56
恩,非常感谢朋友的回答~~~
但是,在WEBXTRA的PROPERTIES里的那栏的starting url应该怎么写呢?!
谢谢~~:]
另外,HTML文件是不是应该和DIR文件在同一级目录下?!
编辑历史:[这消息被chentian编辑过(编辑时间2002-03-05 14:01:31)]
|
 Felix14
职务:普通成员
等级:1
金币:0.0
发贴:30
注册:2002/3/5 14:13:34
|
#82002/3/5 14:44:42
chentian在上个帖子中说 引用: 恩,非常感谢朋友的回答~~~
但是,在WEBXTRA的PROPERTIES里的那栏的starting url应该怎么写呢?!
谢谢~~:]
另外,HTML文件是不是应该和DIR文件在同一级目录下?!
starting url里面什么都不用写,完全用上面的代码和鼠标事件来调用网页。html文件和dir文件可以分别放在各自目录里面。 补充斑竹一点,如果目录结构是这样的: -html [目录] |-aaa.html [html文件] |-1.html [html文件] -movie[目录] |-projector.exe [可执行文件] 那么调用的代码就变成: Navigate(sprite 1, the moviepath&"..\html\aaa.html")
|
 zch3
职务:普通成员
等级:1
金币:0.0
发贴:25
注册:2001/4/3 16:41:10
|
#92002/3/6 20:50:08
下面的语句放在webxtra 前一针 on exitframe me set the starturl of member("webxtra's member name",castlib name) to the moviepath&"htm\aaaaa.htm" end
下面的语句初始化一下URL on startmovie(or stopmovie) set the starturl of member("webxtra's member name",castlib name) to "" end 别人告诉我的。应该行。
修改了一下:)
编辑历史:[这消息被zch3编辑过(编辑时间2002-03-08 20:12:44)]
|
 chentian
职务:普通成员
等级:1
金币:0.0
发贴:118
注册:2002/1/2 10:05:49
|
#102002/3/6 22:42:54
非常感谢朋友们的帮忙 :] 等我试………………………………………………
|
 晓珍
职务:普通成员
等级:1
金币:0.0
发贴:117
注册:2001/10/25 9:56:18
|
#112002/3/7 9:24:02
我试了一下ZCH3所说的可运行程序时出现下面的错误提示: Script error:Variable used before assigned a value
set the starturl of member("webxtra's member name",castlib)?to the moviepath&"htm\aaaaa.htm"
|
 我是小马
职务:普通成员
等级:3
金币:17.0
发贴:794
注册:2000/11/13 14:56:59
|
#122002/3/7 12:58:00
晓珍在上个帖子中说 引用: 我试了一下ZCH3所说的可运行程序时出现下面的错误提示: Script error:Variable used before assigned a value
set the starturl of member("webxtra's member name",castlib)?to the moviepath&"htm\aaaaa.htm"
将webxtra's member name改为webxtra 演员的名称 castlib 改为webxtra演员所在演员表的名称或序号
|
 chentian
职务:普通成员
等级:1
金币:0.0
发贴:118
注册:2002/1/2 10:05:49
|
#132002/3/7 16:06:23
在按钮上用了这段程序 on mouseup me Navigate(sprite 5, the moviepath&"1.html") end 然后在帧脚本里用了 on exitFrame me go the frame end 但是运行后点按钮却出错,出错信息是: handler not defined Navigate(sprite 5, the moviepath&"1.htm") 朋友们帮忙啊```谢谢~~~~
编辑历史:[这消息被chentian编辑过(编辑时间2002-03-07 16:12:18)]
|
 晓珍
职务:普通成员
等级:1
金币:0.0
发贴:117
注册:2001/10/25 9:56:18
|
#142002/3/7 17:32:29
当然会出错了。the moviepath是定义路径。应改为: Navigate(sprite 5, the moviepath&"文件夹名\1.html")
|
 chentian
职务:普通成员
等级:1
金币:0.0
发贴:118
注册:2002/1/2 10:05:49
|
#152002/3/8 10:29:19
问题是我的那个1.htm文件和我的DIR文件是在同一个目录下啊~~~是否这样也需要把文件夹的名字加上去呢?!
|