Solved

How to open a file with mouse over/click event

Posted on 2001-07-20
13
748 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How do I convert a CS4 FLA file to CS6? 1 873
Adobe Flash Player not supported on my Tablet 7 735
free flash maker 5 212
File drag and drop 6 142
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
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…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

803 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