• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 178
  • Last Modified:

How do I get my HTML edit of my Flash to work with Flash?


I have added some Java Script to the Flash Website I have built.  I did this by using an HTML editor to add my script.  When I preview this in my HTLM editor it works great, and looks good.  My issue is that it is HTLM, how do I get this work on my flash site now?  My website is running from the .swf files.

This seems like it should be simple can anyone help?

Randy
0
rmefford
Asked:
rmefford
  • 8
  • 6
  • 2
1 Solution
 
BillystyxCommented:
what is it your js is doing?
Can you post that?

Billystyx
0
 
rmeffordAuthor Commented:
Here you go... (It is calling a search Window)

<head>
<style type="text/css">
  #search_main { position:absolute; top:480px; left:127px; }
</style>
<script type="text/javascript" language="Javascript" src="http://www.mytemplatestorage.com/codes/search_form.php?aff=MicroWorks&skin=20&layout_id=h1&by_type=1&by_category=1&locale=en&cols=3&rows=3&sadult=off&t_skin=21&pr=on&src=on&target=_blank&bgcolor=#FFFFFF"> </script> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>velvet3_2_gallery</title>
</head>
0
 
negatyveCommented:
Where's the relation between this code and your flash movie? Anyway, any movie is embedded inside an html page even if you load, from your browser, the movie alone, like:

http://www.site.com/movie.swf

Then, nothing should push you to use your swf alone. Use, on your website, an html page embedding both javascript and flash code..
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
rmeffordAuthor Commented:
I built the website with FLASH, but to add the JAVA code I used a HTLM editor FrontPage 2003, and tested my HTML in my browser and it works.  But when I upload the site and execute it the HTML pages won't work, only the .SWF files will work.  

The problem is that since only the .swf files work on the website to execute the flash movie/site, the HTML I edited never gets called.

I agree/understand my flash movie is embedded in HTML, so how can I edit the HTML within Macromedia FLASH MX?  
0
 
negatyveCommented:
>so how can I edit the HTML within Macromedia FLASH MX?  

you cannot. have you uploaded to the site

a. the swfl file
b. the html page
c. eventually the external js file

?
0
 
rmeffordAuthor Commented:
I have uploaded the html page and the .swf, .html. and the .fla files., but the only thing being called are the .swf files.
0
 
negatyveCommented:
Could you post a link to that page?
0
 
rmeffordAuthor Commented:
0
 
rmeffordAuthor Commented:
The page I am trying to edit is the "gallery" page...at the bottom gray area is where my JAVA script will insert the "search screen"
0
 
negatyveCommented:
There's no javascript code in that page...
0
 
rmeffordAuthor Commented:
:)  That is what I am saying!

I published my .fla file, and then took the HTML version that was created and added my JAVA script to it.  Everything works fine with it, but the webiste is only using the .swf files for visitors, when I upload that .html file to the site nothing happens...I still see the same thing you just saw.

The issue I believe is that my html edit has never been added/incorporated into the .swf files.  So it (the .swf "gallery" page) has no idea it isn't doing exactally what it should be doing.  How do I add my script to this page?
0
 
negatyveCommented:
If you have edited the html page created by flash and added the javascript code, you should move this one to the server, and use it as index.html (that should be the main page)
0
 
rmeffordAuthor Commented:
Negatyve,

That is actually a really good idea, but the page I edited was the "gallery" page not the main page, and I only want my scrip to run on the "gallery" page, any other ideas?  Thanks for all the help.

Randy
0
 
negatyveCommented:
- insert your javascript code in the main page, as said above
- encapsulate it inside a javascript function
- call the function from flash in the gallery page with this command:

getURL("javascript:functionName()");
0
 
rmeffordAuthor Commented:
Negatyve,

So would my script look like this?  When I try to insert this command on my FLASH page I get an error:

JavaScript
getURL("javascript:functionName(<script type="text/javascript" language="Javascript" src="http://www.mytemplatestorage.com/codes/search_form.php?aff=MicroWorks&skin=20&layout_id=h1&by_type=1&by_category=1&locale=en&cols=3&rows=3&sadult=off&t_skin=21&pr=on&src=on&target=_blank&bgcolor=#FFFFFF"> </script>)");

When Executing Error: In file ""SearchTemplate""":
getURL("javascript:functionName(<script type="text/javascript" language="Javascript" src="http://www.mytemplatestorage.com/codes/search_form.php?aff=MicroWorks&skin=20&layout_id=h1&by_type=1&by_category=1&locale=en&cols=3&rows=3&sadult=off&t_skin=21&pr=on
missing) after argument list.
0
 
BillystyxCommented:
the script function goesin your html page, inside the head tags, and the call goes in flash, on a button for example, like above:

getURL("javascript:functionName()");
around your js, but inside the script tags on the html page, you put:
function functionName(){
//your script
}

Billystyx


0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

  • 8
  • 6
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now