Is it possible to use Javascript in flash. For example, as a simple test I am trying to use Javascript’s alert method when a button is clicked.
I am using AS3. Is it possible?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Like Marty mentioned, you can use the ExternalInterface class to execute a Javascript. Your options are to execute a function embedded in the (html) page code and create one from scratch. Because
alertis a default function you can use its name as the first parameter for thecallmethod (ofExternalInterface) and the string as the 2nd one.If you provide a single parameter, you might wanna write a function instead to execute (or return) something.