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 Flash Forum

How do i put the javascript

Moderator: Phate

How do i put the javascript

Postby npsari on Fri Mar 09, 2007 11:31 pm

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 7:14 pm
Location: England

Postby doctordigital84 on Fri Apr 06, 2007 2: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 2:05 am

Postby siege on Mon Apr 30, 2007 11:41 pm

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"');}
siege
 
Posts: 31
Joined: Fri Apr 20, 2007 11:03 pm


Who is online

Users browsing this forum: No registered users and 0 guests

cron