Solved

How to open a file with mouse over/click event

Posted on 2001-07-20
13
745 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
 
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to how to record live broadcast.

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now