Solved

How to open a file with mouse over/click event

Posted on 2001-07-20
13
750 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
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

Suggested Solutions

Title # Comments Views Activity
Text To Speech Reader For Adobe Flash Pages 4 986
IE 11 Flash Player issue 7 262
Flash Player White Screen Facebook 5 798
File drag and drop 6 158
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…
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

732 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