n**d 发帖数: 9764 | 1 I want use buttons to control several .swf files. By clicking different
button, the corresponing .swf will be load. It is easy to implement if all
the buttons are in the HTML file.
If I put all these buttons in a .swf file, say main.swf, how can I use these
buttons to call the other .swf files? |
f*******e 发帖数: 222 | 2 as2中用loadMovie function
as3中用Loader class
var loader:Loader = new Loader();
loader.load(new URLRequest(xxx.swf));
these
【在 n**d 的大作中提到】 : I want use buttons to control several .swf files. By clicking different : button, the corresponing .swf will be load. It is easy to implement if all : the buttons are in the HTML file. : If I put all these buttons in a .swf file, say main.swf, how can I use these : buttons to call the other .swf files?
|
n**d 发帖数: 9764 | 3 Thanks! But I am new for this technology. Could you give me an example or
links to the example?
【在 f*******e 的大作中提到】 : as2中用loadMovie function : as3中用Loader class : var loader:Loader = new Loader(); : loader.load(new URLRequest(xxx.swf)); : : these
|
n**d 发帖数: 9764 | 4 Adobe Flex Builder 3, compile error:
1119: Access of possible undefined property swf through a reference with
static type Class.
import flash.events.Event;
private function printMessage(event:Event):void {
var loader:Loader = new Loader();
loader.load(new URLRequest(AAA.swf));
// message.text += event.target.label + " pressed" + "\n";
}
]]>
【在 f*******e 的大作中提到】 : as2中用loadMovie function : as3中用Loader class : var loader:Loader = new Loader(); : loader.load(new URLRequest(xxx.swf)); : : these
|
n**d 发帖数: 9764 | 5 fixed error, but nothing happens after clicking button.
do I have to run http server?
import flash.events.Event;
import flash.net.URLRequest;
import flash.display.Loader;
private function printMessage(event:Event):void {
var loader:Loader = new Loader();
loader.load(new URLRequest("b.swf"));
// addChild( loader );
// message.text += event.target.label + " pressed" + "\n
【在 n**d 的大作中提到】 : Adobe Flex Builder 3, compile error: : 1119: Access of possible undefined property swf through a reference with : static type Class. : : : import flash.events.Event; : private function printMessage(event:Event):void { : var loader:Loader = new Loader(); : loader.load(new URLRequest(AAA.swf)); : // message.text += event.target.label + " pressed" + "\n";
|
f*******e 发帖数: 222 | 6 以为你用在flash里面,所以给了你上面那段简单的代码。如果要用button控制还要加
addEventListener。
在Flex里面有一个SWFLoader的component,可以直接load swf文件。
下面是一个简单的Flex例子,按button开始load swf
http://www.adobe.com/2006/mxml" layout="absolute">
internal function loading():void{
myLoader.load("test.swf");
}
]]>
sca
【在 n**d 的大作中提到】 : fixed error, but nothing happens after clicking button. : do I have to run http server? : : : import flash.events.Event; : import flash.net.URLRequest; : import flash.display.Loader; : private function printMessage(event:Event):void { : var loader:Loader = new Loader(); : loader.load(new URLRequest("b.swf"));
|