views:

43

answers:

2

I don't really play with web stuff at all, but someone gave me a site template recently and I wanted to start playing with it. I apologize in advance if my terms are misguided.

The main top section of the site is a little Flash thing that has buttons as links to different areas of the site. All of that is well and good, but whenever I click those links, it has to reload the entire page (including the Flash app) when only the bottom part changes. This isn't really a huge issue, since everything's real small, but it's kind of annoying.

I vaguely remember "fixing" this behavior using AJAX during my web programming class, but that was just straight HTML and Javascript, no Flash players to muck around with.

My question is, how do I overcome having to reload the entire page when someone clicks a link from the Flash object? Is there some nice way I can call something other than getURL() to achieve this effect? I would prefer to not have to try and recreate that site's experience without the Flash ( but if I had some graphical ability, I would! ).

Thanks for any suggestions!

+1  A: 

hmmm... can you change the Flash object? would suggest changing the URLs on the link to plain javascript that would load the URL...

trace
This sounds fantastic to me. Could you please give me a bit more to go on though? How would I go about doing this?
mrduclaw
this would mean you need to have the flash file (.fla file) used to create the flash object... if you have that, then you can find links on the flash file and change them from the url to javascript calls that load the URL... hope I am making sense...
trace
@trace I found the calls to `getURL()`, but I can't just very well replace `getURL("index2.html");` with `getURL("someJavaScriptMethod");` can I?
mrduclaw
trace
+2  A: 

Flash has a nice thing called ExternalInterface. It allows you to call a JS method on the parent HTML page directly from your flash movie.

The format is something to the effect of:

ExternalInterface.call("myJSFunctionName", params:Object);

Or something to that effect, double check to get the exact format. That should let you handle your navigation directly in JS without refreshing your page every time.

Myk
Awesome! I'll check into this, it looks perfect! Thanks!
mrduclaw