Solved

How to open a file with mouse over/click event

Posted on 2001-07-20
13
751 Views
Last Modified: 2012-06-27
I am creating a flash file to run in a CD. I want to open a PDF file when a button in the flash file is mouseover or clicked. and the PDF file is in the same directory with the flash file. How can I do this? Remember the flash file is not gonna run on a web page. it is gonna run in a CD.
0
Comment
Question by:xduan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
  • 2
  • +2
13 Comments
 
LVL 1

Expert Comment

by:Brain-storm
ID: 6304637

 Hi Xduan:

  i working on this problem as well :)

 here i used get URL action to open the PDF file...
i have used whole path here, and it works ...

 but when i don't use the whole path, then it doesn't work,

i'm playing with it, and surely solve it in some days :)


put a button and give it following action

NOTE: here i hav used my own path as my documents etc etc, u will use yur own path of that specific PEF file


on (release) {
    getURL ("C:\\My Documents\\test\\pdf\\pdf-1.pdf", "_blank");
}


regards

ZAKIR

-------------------
-------------------
0
 
LVL 1

Expert Comment

by:Brain-storm
ID: 6304639

 Hi Xduan:

  i working on this problem as well :)

 here i used get URL action to open the PDF file...
i have used whole path here, and it works ...

 but when i don't use the whole path, then it doesn't work,

i'm playing with it, and surely solve it in some days :)


put a button and give it following action

NOTE: here i hav used my own path as my documents etc etc, u will use yur own path of that specific PEF file


on (release) {
    getURL ("C:\\My Documents\\test\\pdf\\pdf-1.pdf", "_blank");
}


regards

 *Brain

-------------------
-------------------
0
 
LVL 1

Expert Comment

by:Brain-storm
ID: 6304642

it works...  

 i don't know it wasn't working earlier...

 just put them in  same folder... ( swf and pdf files)

 like

on (release) {
    getURL ("yurfile.pdf", "_blank");
}

cheers

 *Brain
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Expert Comment

by:Jaymol
ID: 6307531
Use this....


  GetURL('file://the_file_is_in_the_same_dir_as_the_swf.pdf');

John.
0
 

Author Comment

by:xduan
ID: 6309421
I tried
on (release) {
   getURL ("yurfile.pdf", "_blank");
}
NOthing happened.

I can't use the following since the flash will be running in a CD. There is no way to know the drive name.
on (release) {
   getURL ("C:\\My Documents\\test\\pdf\\pdf-1.pdf", "_blank");
}

Then I tried
GetURL('file://the_file_is_in_the_same_dir_as_the_swf.pdf');

It gave an error message. something like wrong file path.

0
 

Author Comment

by:xduan
ID: 6309675
I tried
on (release) {
   getURL ("yurfile.pdf", "_blank");
}
NOthing happened.

I can't use the following since the flash will be running in a CD. There is no way to know the drive name.
on (release) {
   getURL ("C:\\My Documents\\test\\pdf\\pdf-1.pdf", "_blank");
}

Then I tried
GetURL('file://the_file_is_in_the_same_dir_as_the_swf.pdf');

It gave an error message. something like wrong file path.

0
 
LVL 3

Expert Comment

by:jeffbeasley
ID: 6314191
I burned a test file to a cd and tryed this on another computer and it worked with both files in the same directory.
on(release){
getURL("file.pdf");
}

you might also try using fscommand to launch adobe acrobat; however you must then use a direct path.
The getURL function worked just fine for me

Hope this helped
Jeff
0
 
LVL 5

Expert Comment

by:stef4s
ID: 6321325
try this function you need to export to projector exe

exeCommand("notepad.exe")

function exeCommand(command) {
     var arg;
     arg = "";
     
     for (i=1; i<=length(command); i++) {
          if (command.substring(i-1, i) == " ") {
               arg = arg add mbchr(9);
          } else {
               arg = arg add command.substring(i-1, i);
          }
     }
     fscommand ("exec", arg);
}

hope this helps.
0
 
LVL 1

Accepted Solution

by:
Brain-storm earned 100 total points
ID: 6324718
as i said earlier,,,

 on (release) {
   getURL ("yurfile.pdf", "_blank");
}

 works fine with me... and on a CD tooo....

 strange that it didn't worked for xduan ...
0
 
LVL 5

Expert Comment

by:stef4s
ID: 6325742
It might be that his browser can't read pdf
0
 
LVL 1

Expert Comment

by:Brain-storm
ID: 6326340
xduan:  pls check ... that yur browser supports pdf format, cuz this action opens new browser window to show .PDF content
0
 

Author Comment

by:xduan
ID: 6326558
Thank you guys. It works now.
0
 
LVL 1

Expert Comment

by:Brain-storm
ID: 6328422
u r welcome :)  

 
 regards

 *Brain-storm
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question