View Full Version : Html links in flash movie ?
ozgurerdogan
10-17-2007, 01:54 PM
I want to add html links in flash movie but when user clicks on links they are taken to http://file.html which is incorrect. What I want is to be opened from cd rom like file:///E:/file.html. How can I do that? A flash example would be great. Thank you
ozgurerdogan
10-17-2007, 03:49 PM
I have found the following commands from an older version but it gives error:
%FSCommand% = FlashObject(Flash1).GetProperty("Last FSCommand")
IF (%FSCommand%="alfaromeo")
File.Open (open, "%ScrDir%\folder\file.html")
END IF
The error is Line1=": unexpected symbol near '%'
Can someone please correct the commands and also the commands in flash would be gorgeous.
Thank you
longedge
10-17-2007, 05:11 PM
The way to use fsCommand is different in the current version of AMS. When you have inserted a flash object, in the object's properties you will see an "On FSCommand" event in the script tab. Put something like this in to that event -
if e_FSCommand=="alfaromeo" then
File.Open("AutoPlay\\Docs\\file.html", "", SW_SHOWNORMAL);
end
Instead of opening the html you could have a web object on your page and use the Web.LoadURL action to load the page inside AMS.
p.s. Have a look in the help file under "fsCommand".
ozgurerdogan
10-17-2007, 05:20 PM
The way to use fsCommand is different in the current version of AMS. When you have inserted a flash object, in the object's properties you will see an "On FSCommand" event in the script tab. Put something like this in to that event -
if e_FSCommand=="alfaromeo" then
File.Open("AutoPlay\\Docs\\file.html", "", SW_SHOWNORMAL);
end
Instead of opening the html you could have a web object on your page and use the Web.LoadURL action to load the page inside AMS.
p.s. Have a look in the help file under "fsCommand".
Thank you for respond. Ok I put that in AMS, what should I put the button in flash? And I want to open the page in new window, because user should be able to close it and return to AMS because there will be main swf and user will chose what button to click. Where is Web.LoadURL ? In Flash or AMS?
Thank you again.
longedge
10-17-2007, 05:34 PM
In flash you have a button, movie clip etc which 'on release' has an action fscommand("alfaromeo");.
In AMS on the page you have a flash object which contains the swf and that "listens" for fsCommand coming from the flash object and when one occurs it tests to see if it is the fsCommand specified and reacts in the way specified in your code.
In AMS you can have a web object on the page. You can use the action Web.LoadURL to load a page into the web object.
Hope that is clearer :)
longedge
10-17-2007, 06:07 PM
An example for you which I hope will make things clearer :)
ozgurerdogan
10-18-2007, 04:18 AM
An example for you which I hope will make things clearer :)
Thank you so much but I can not open html files on AMS, I have tı open them on a new window of explorer as whole of my work is flash. In your examples, there is a space to open html file. But I have to open them from cd rom. So I yhink only fs command in flash and fs command listener in AMS will be enough. Web.LoadURL is not needed. I need to open from cd rom and drive letter is different on computers sı fs command must do this job.
Thank you
longedge
10-18-2007, 04:44 AM
Thank you so much but I can not open html files on AMS, I have tı open them on a new window of explorer as whole of my work is flash. In your examples, there is a space to open html file. But I have to open them from cd rom. So I yhink only fs command in flash and fs command listener in AMS will be enough. Web.LoadURL is not needed. I need to open from cd rom and drive letter is different on computers sı fs command must do this job.
Thank you
Since this is the forum for AMS6, I assumed we were talking about working in an AMS project :)
Still talking about AMS, if in my example you change the line in the flash object on fsCommand event from -
Web.LoadURL("Web1", "http://www.indigorose.com");
TO
File.OpenURL("AutoPlay\\Docs\\file.html", SW_SHOWNORMAL);
- then it will open in the users default web browser. It doesn't matter if the file is on a CD or Hard Drive as long as it's in the AMS Docs folder.
ozgurerdogan
10-18-2007, 04:51 AM
Since this is the forum for AMS6, I assumed we were talking about working in an AMS project :)
Still talking about AMS, if in my example you change the line in the flash object on fsCommand event from -
Web.LoadURL("Web1", "http://www.indigorose.com");
TO
File.OpenURL("AutoPlay\\Docs\\file.html", SW_SHOWNORMAL);
- then it will open in the users default web browser. It doesn't matter if the file is on a CD or Hard Drive as long as it's in the AMS Docs folder.
This is exatly what I was asking for. Thank you so much you saved my life :)
I will try and post result in few hours thank you again. This is very kind of you.
ozgurerdogan
10-19-2007, 01:35 PM
Thank you very much. Thats why I love forums :)
longedge
10-19-2007, 03:13 PM
Thank you very much. Thats why I love forums :)
You're welcome, glad it helped.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.