Copy link to clipboard
Copied
I want to open different format external files(*.wmv, *.mp4, *.pdf, *.ppt, *.doc etc) on click event, I try this for *.wmv but got some error.
--------------------------------------------------------------------------------
package {
import flash.display.SimpleButton;
import flash.events.MouseEvent;
import flash.net.navigateToURL;
import flash.net.URLRequest;
public class clickbutton extends SimpleButton {
public function clickbutton() {
this.addEventListener(MouseEvent.CLICK, clickF);
}
private function clickF(e:MouseEvent):void{
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
videoPlayer.attachNetStream(ns);
var listener:Object = new Object();
listener.onMetaData = function(evt:Object):void {};
ns.client = listener;
ns.play("video_test.wmv");
}
}
}
--------------------------------------------------------------------------------
Please tell me correct code
you don't need the swf.
you're creating a projector (.exe) file.
if you know users will have the programs and default settings to open those file types, you can use fscommand to open them (as long as they files are in an fscommand subdirectory).
you'll need to use an executable helper file, too: http://www.northcode.com/blog.php/2007/08/07/Conquering-FSCommand-EXEC-Part-1-Proxy
Copy link to clipboard
Copied
that's not a supported file type: http://help.adobe.com/en_US/flashmediaserver/techoverview/WS07865d390fac8e1f-4c43d6e71321ec235dd-7ff...
Copy link to clipboard
Copied
Is there other why to link the external file?
Copy link to clipboard
Copied
the mp4 should work.
some of the rest might work in an air or projector app.
Copy link to clipboard
Copied
Boss my target is not only for video. i want to open all formats. (swf, flash.exe, video, sound, PowerPoint, world, PDF etc.. files) Like a URL.
Now I try this code but this is going in the browser. want to open directly. For example If video file then should be open in directly in some video player. if pdf file, should be open directly in pdf reader. if powerpoint file, should be open directly in powerpoint software etc…. Is there any way to do like this?
package {
import flash.net.navigateToURL;
import flash.net.URLRequest;
import flash.display.SimpleButton;
import flash.events.MouseEvent;
public class externallink extends SimpleButton {
public function externallink() {
this.addEventListener(MouseEvent.CLICK, clickF);
}
private function clickF(e:MouseEvent):void{
var url:String = "Klacid.exe";
var request:URLRequest = new URLRequest(url);
navigateToURL(request);
}
}
}
Copy link to clipboard
Copied
are you making an air app?
Copy link to clipboard
Copied
no boss, i need this for PC
Copy link to clipboard
Copied
are you publishing a swf?
if yes, will it be embedded in an html file that you'll upload to a server and will be displayed in a browser?
Copy link to clipboard
Copied
Boss, I make one flash file. Inside that I have different button
World template (button)
PowerPoint template (button)
Video template (button)
PDF template (button)
Etc….
I want to link these buttons to different file format on cline event
(I didn’t embed anything, when I click, its open directly in the browser, which I don’t need. I need to open directly in same plate form, world software, powerpint software, PDF reader etc).
Mean to say If I press world template button, file should be open in world software. If I press powerpint template button, file should be open in powerpoint software…..etc)
Copy link to clipboard
Copied
when you finish your project will you upload it to a server?
Copy link to clipboard
Copied
You can check my project on this link
http://www.delta-adv.com/nav/Files_Linking.zip
When I click on the button, file is going in the browser that I don’t need (only HTML file button is ok). Need to open all files directly in his software’s (world file should be open in world software. PowerPoint file should be open in PowerPoint software. Video file should be open in any video player…..etc.)
Copy link to clipboard
Copied
i understand your problem. you don't need to keep explaining about what's inside your fla.
i'm trying to determine how your published app will be used. if you're publish an air app or projector app, you can do what you want though you may not realize the problem that will occur if your app is used by someone that does not have powerpoint installed, for example.
attach a screenshot of your publish settings panel (file>publish settings).
Copy link to clipboard
Copied
Need only SWF and EXE files
Copy link to clipboard
Copied
you don't need the swf.
you're creating a projector (.exe) file.
if you know users will have the programs and default settings to open those file types, you can use fscommand to open them (as long as they files are in an fscommand subdirectory).
you'll need to use an executable helper file, too: http://www.northcode.com/blog.php/2007/08/07/Conquering-FSCommand-EXEC-Part-1-Proxy
Find more inspiration, events, and resources on the new Adobe Community
Explore Now