Log in

View Full Version : An Actionscript/Ajax/Javascript Nightmare. Can you wake me?



cb010101
08-21-2007, 04:34 PM
I've been having this issue for several days now, and it should be clear that I'm only savvy enough to be dangerous, but I'm hoping someone here can help me, because I'm sooooo close to achieving the results that I want, and am achieving them in all browsers, except for the beloved IE. Here's my issue.

I have 3 things in play.
1. Flash navigation on the left of my page. Very simple, nothing fancy going on.
2. I'm using ajax. This script to be exact: http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm
This I use for the main content area of the site, laid out similarly to how the demo is laid out on that page, only I have a Flash nav.
3. I'm using SWFObject.js to get around the IE "feature". The 'click to activate'.

On all browsers (except IE) it works fine. My Flash buttons in the nav tell the ajax to load the content into my main content area to the right. However, in IE, my navigation disappears, which seems to be a direct result of the script not pulling properly, and therefore not displaying the Flash navigation. In fact, I'm sure that's what the problem is, because if I just embed the Flash normally, it works, but then of course I have the 'click to activate' issue, which I don't want. I've narrowed it down, to the problem is that I'm not loading that Javascript correctly on my Flash button. My actionscript is incorrect. According to the Ajax document, I need to load that SWFObject.js script, as it will not carry over to the styling of my new content that appears on click.

How would I accomplish this? I need to write some actionscript that will load point to the page and also load that javascript, so that my navigation appears in IE. Here's the script I have on there now, that is not working:

on (release)
{
getURL("javascript:ajaxpage('../templates/calendar/calendar.php', 'content-area'); loadObjs('swfobject.js')");
}

It works in all browsers, except IE, because its not loading the swfobject script. The ajax part of that is fine. I need that script to be called, to get rid of the 'click to activate'. In anyway possible. Efficiency and ease would be best, but at this point, I'll take any solution.

I'm really hoping someone has the answer here as its the last issue I have to work out and its driving me nuts. I'm sure its my syntax. I'm pretty sure my approach is correct, but as you can tell, I'm no Flash/Actionscript guru.

Can anyone point me in the right direction? Thanks!

Medyman
08-21-2007, 05:30 PM
If it's working for you in other browsers, then the ActionScript is not your problem. Flash doesn't behave differently across browsers.

If Flash does behave differently, there is something else at play.

In this instance, it's the javascript. I barely know javascript (and ajax is really out of the question) so I won't be much help there. But you should look into what part of javascript is causing this.

Maybe try another eloas bug (click to activate) script.

cb010101
08-21-2007, 05:35 PM
Thanks, but actually that is the problem. I know that much to be true. It's not Flash that displays differently across browsers, but rather how the browser reads the embeded swf, hence my need for swfobject. Here's more info about that:
http://blog.deconcept.com/swfobject/

It's working in other browsers, because other browsers don't have this 'feature'.

Anyone have some ideas for me? I'm 95% certain, I just need to call that javascript from my actionscript. thanks...

Medyman
08-21-2007, 06:16 PM
I know all about SWFObject.

We're misunderstanding each other. I think we're making the same point.

In any case, post your issuse at GTAL (http://www.gotoandlearn.com/forum). There are far more knowledgeable people there.