It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

linking flash to javascript

linking flash to javascript

Postby robroy85 on Tue Apr 15, 2008 10:43 pm

Hello

I have made a character in flash, which you can ask questions to...I have created 6 animated responses for the character in flash.

I have a series of 'if' statments for the questions. I would like to link the animations to the 'if' statements in JS.

Ive tried this:

Code: Select all
if(qi == "hello"){ 
         document.getElementById("fill").innerHTML = "Hello how are you?"; "document.getElementById ('charani').innerHTML = '<object width='550' height='400'> <param name='movie' value='Thumbsup.swf'> <embed src='Thumbsup.swf' width='160' height='200' style='position:absolute; right:0px; bottom: 5%; z-index:3; '> </embed> </object>";

    }
   if(qi == "hi"){ 
         document.getElementById("fill").innerHTML = "Hello There"; "document.getElementById ('charani').innerHTML = '<object width='550' height='400'> <param name='movie' value='yo.swf'> <embed src='yo.swf' width='160' height='200' style='position:absolute; right:0px; bottom: 5%; z-index:3; '> </embed> </object>";


Robm85 is an unknown quantity at this point

linking flash to javascript
Hello

I have made a character in flash, which you can ask questions to...I have created 6 animated responses for the character in flash.

I have a series of 'if' statments for the questions. I would like to link the animations to the 'if' statements in JS.

Ive tried this:

Code:

if(qi == "hello"){
document.getElementById("fill").innerHTML = "Hello how are you?"; "document.getElementById ('charani').innerHTML = '<object width='550' height='400'> <param name='movie' value='Thumbsup.swf'> <embed src='Thumbsup.swf' width='160' height='200' style='position:absolute; right:0px; bottom: 5%; z-index:3; '> </embed> </object>";

}
if(qi == "hi"){
document.getElementById("fill").innerHTML = "Hello There"; "document.getElementById ('charani').innerHTML = '<object width='550' height='400'> <param name='movie' value='yo.swf'> <embed src='yo.swf' width='160' height='200' style='position:absolute; right:0px; bottom: 5%; z-index:3; '> </embed> </object>";

However it doesnt seem to work. Does anyone know what the problem is?

Any help here would be great! Rob[/code]
robroy85
 
Posts: 5
Joined: Mon Apr 14, 2008 12:03 am

Postby rangana on Wed Apr 16, 2008 3:00 am

You had mess with your quotes, use this instead ;)
Code: Select all
document.getElementById("fill").innerHTML = "Hello There";
document.getElementById ('charani').innerHTML = "<object width='550' height='400'> <param name='movie' value='yo.swf'> <embed src='yo.swf' width='160' height='200' style='position:absolute; right:0px; bottom: 5%; z-index:3; '> </embed> </object>";
User avatar
rangana
500+ Club
 
Posts: 935
Joined: Wed Feb 27, 2008 5:14 am
Location: Cebu City Philippines

Postby robroy85 on Thu Apr 17, 2008 2:21 pm

thanks, really appreciate that :)
robroy85
 
Posts: 5
Joined: Mon Apr 14, 2008 12:03 am


Who is online

Users browsing this forum: No registered users and 3 guests