Solved

How to call javascript

Posted on 2001-06-06
3
156 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
  • 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Does Flash have a Firefox problem? 5 307
Action Script commands 4 303
Action Script coding 1 170
Adobe Flash player - Microsoft Edge 9 145
I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
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…

744 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

13 Experts available now in Live!

Get 1:1 Help Now