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

Forum

Log In Sponsors
Partner Sites
Board index Programming Flash Forum

How do i put the javascript

Moderator: Phate

How do i put the javascript

Postby npsari on Sat Mar 10, 2007 12:31 am

In the Flash I am doing...

It allows me to put a Javascript part

So, I typed this one :

<script language="JavaScript">
document.write('<IMG src="http://www.example.com/pic.jpg"');
</script>


Is that the right format to type in the Javascript?
Because the flash does not show the image at all
npsari
 
Posts: 19
Joined: Thu Mar 08, 2007 8:14 pm
Location: England

Postby doctordigital84 on Fri Apr 06, 2007 3:27 am

nope. i dont even think you can run javascript in flash. look for "actionscript" image loaders
doctordigital84
 
Posts: 12
Joined: Fri Apr 06, 2007 3:05 am

Postby siege on Tue May 01, 2007 12:41 am

there are a few ways to communicate with external scripts. Look in the help menu for external communication/ or communicating with JS. An easy to access your JS from flash is to put the JS in a function in the
Code: Select all
<head> function imgWriter(myReallyCoolHref)
   {
   document.write('<IMG src=myReallyCoolHref');
   
   }</head>
of your html. Then in flash call it from a button; passing the argument/s. For example:
Code: Select all
my_btn.onPress=function(){getURL("javascript:imgWriter('"http://www.example.com/pic.jpg"');}
best
siege
siege
 
Posts: 31
Joined: Sat Apr 21, 2007 12:03 am


Return to Flash Forum

Who is online

Users browsing this forum: No registered users and 0 guests