0

I want to call my update(id) javascript function from my flash menu with actionscript 3. How do I do?

2 Answers 2

2

You can use ExternalInterface.call.

import flash.external.ExternalInterface;


ExternalInterface.call('update', id);
Sign up to request clarification or add additional context in comments.

1 Comment

This results in nothing... I'm using CS3 and the button handler works, but nothing is happening. Any reason for it?
0
<script>
function displayCurrentTime()
{
var date = new Date();
return date.toLocaleTimeString();
}
</script>

You can call this function just like you always would, but simply call it like you would any other kind of a getter function where you store the returned value as part of some variable:

var currentTime:string = ExternalInterface.call("displayCurrentTime()");

When this code runs, Flash will call the displayCurrentTime JavaScript function and store the returned value from it in the currentTime variable.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.