Solved

How to call javascript

Posted on 2001-06-06
3
160 Views
Last Modified: 2008-03-06
Hi!

I have a javascript file called "show.js"
this file create a web page with document.write instructions.
I have 3 parameters, the filename (.jpg), the background and the title.

so, when I call it from a Web page, it look like this: show("image1.jpg", "ffffff", "A beautiful picture");

Now, I want to call this script from a Flash animation.  The script is in a file called show.js

How can I call the function show in this file?  Should I include my javascript in my flash movie?

Fast help would be apreciated!
Thanks
Jav
0
Comment
Question by:javascript120497
[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
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
Jaymol earned 300 total points
ID: 6159935
Hi.

You need to use the "GetURL" command.

Include the JS file in your HTML in the normal manner, then use this....

    GetURL('JavaScript:show("image1.jpg", "ffffff", "A beautiful picture")');

That'll do the same as running it directly from the html.

Have a look at http://www.thefade.co.uk , specifically the media page.  (It takes a while - I know :(

Click one of the photo thumbnails to view the bigger one and I think you'll see that I've done what you were trying to do.  (I included the JavaScript function in the HTML that holds the Flash - that's the only difference.)

Hope this helps,

John.
0
 

Author Comment

by:javascript120497
ID: 6160273
Great!
0
 
LVL 6

Expert Comment

by:Jaymol
ID: 6162707
Thanks mate.  Glad to help out.

John.
0

Featured Post

Technology Partners: 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!

Question has a verified solution.

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

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 …
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 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.
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.

730 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