Solved

How to open a file with mouse over/click event

Posted on 2001-07-20
13
749 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
  • 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to how to record live broadcast.
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.

821 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