View Full Version : Flash Button load <div> with Dynamic Ajax content "ajaxcars"
jweiss
05-23-2008, 06:27 PM
Hi I am trying to get the Dynamic Ajax content "ajaxcars" sample from dynamicdrive.com to work with a flash button. The sample works great using <a href> in html. However when I call on the javascript in Flash with get URL (javascript) It does not work. Has anyone successfully done this? If so can you please show examples or offer suggestions on how you did it. Thank You in advance.
JW
Medyman
05-27-2008, 02:16 PM
What is the gerURL command that you're using? I have done this before, though I don't have any examples readily available I can show you.
But it should work, if coded properly. If you post your getURL code, I'll take a look.
AndreNoel
06-18-2008, 03:43 AM
//jweiss
try this
on (release) {
getURL("javascript:ajaxpage('your-page.html', 'your-DIV');");
}
ph8ed
07-08-2008, 10:28 PM
I had this problem yesterday and this was the exact solution I came across as well. This should solve your problem no question.
I have succesfully used this method today, but am having trouble getting the first page to load without first clicking on the 'home' button. It starts with an empty div untill a button is pressed.
Now, i've tried passing the variable to the movie using FlashVars and the button in the flash appears to animate (home/first button) but then the ajax part doesn't work until i interact with it.
<param name="flashVars" value="button=1"/>
Does anyone know how i can tell flash to load home.html into my div upon 1st load please? Otherwise, i end up with an empty div until a button is pressed.
Many thanks :)
Cortez
11-25-2008, 07:05 PM
Hey. I realize this is an old thread but I'm so close to a nice working solution with my project that is based on this concept. I have an all flash site but want to include a utube video and google map so I've set up an Empty Div to hold these two when needed and then call an empty html when it's not needed.
This is working perfectly on everything except Internet Explorer it replaces the page to a complete white screen grrr. I've tried all manner of changing opacity and such but still no joy.
in my html css for the div
#rightcolumn{
position:absolute;
height: 400px;
width: 500px;
left: 50%;
top: 50%;
margin-top: -280px;
margin-left: -245px;
z-index:3;
filter:alpha(opacity=.1);
and opacity:.1;
}
* html #rightcolumn{ /*IE only style*/
height: 400px;
}
and within my flash I have
var divURL:String = "clear.htm";
getURL("javascript:ajaxpage('"+String(divURL)+"', 'rightcolumn');");
The clear html itself is just an empty container
Would appreciate any help with this been fighting Bill Gates for 2 days now.
Alternatively how would I change the css for the div to be hidden as opposed to loading in the empty html?
Medyman
11-25-2008, 11:54 PM
First the easy question:
Alternatively how would I change the css for the div to be hidden as opposed to loading in the empty html?
You can hide an element by giving it a display:none style property;
About the rest... the error is probably in your AJAX script (out of my area of expertise). If it's working in other browsers, that's most likely it. The HTTP Request object is called differently in different browsers.
I would suggest some reduction testing. Get the AJAX script to work in IE with HTML. Then add Flash.
Cortez
11-26-2008, 04:33 AM
A whole new world to me honestly AJAX really I just found that script on this forum and mixed it with my flash. Reading up on it I realize I need to do some more reading up on it for my websites.
I started to rebuild and realized I've got the wrong doc type would this cause the problem with IE but not the others?
One other question about the css
to call the html into the div from flash i used this code
var divURL:String = "clear.htm";
getURL("javascript:ajaxpage('"+String(divURL)+"', 'rightcolumn');");
how do I properly reference the css in order to attach a different style to the div?
Thanks for the help!
TheAgapist
01-11-2009, 07:13 AM
Hey Guys, i'm trying to use a flash button in place of a hyperlink for the facebox "http://www.dynamicdrive.com/dynamicindex4/facebox/index.htm" and the above suggestions don't seems to work...
...any Idea?
-TheAgapist
Medyman
01-11-2009, 10:27 PM
Hey Guys, i'm trying to use a flash button in place of a hyperlink for the facebox "http://www.dynamicdrive.com/dynamicindex4/facebox/index.htm" and the above suggestions don't seems to work...
...any Idea?
-TheAgapist
Facebox is another beast. It isn't triggered by a direct javascript call. At least, not by default. You have to set up a JS function that, when clicked, relays the proper information to facebox. If you search around here, you'll see examples of how I've done this in the past with Lightbox and Lightbox++.
I'm not familiar with Facebox so I can't comment on the specifics of making this work.
billius
03-23-2009, 01:56 PM
Hi All,
Sorry if I'm dragging up an old thread, but I've been having problems with Flash and Ajax for a while and this seemed to be the best thread to post on.
I have the links working fine in my Flash file. The problem is that the style of the text changes when you click on the link. For an example of this, click on the HOME icon on the Flash navigation on my testsite:
http://www.funkymunkydesigns.com/testsite/index.html
See how the text changes from one style to another?
It’s as if the style sheet isn’t loaded when the link is clicked. I'm using PHP pages to load into my main content DIV. The PHP pages look fine when loaded on their own:
http://www.funkymunkydesigns.com/testsite/home.php
And they view fine in Dreamweaver.
Any idea how I can make sure the correct style is loaded on all the PHP pages?
This is driving me mad!! I'm not good with Ajax or Javascript at all!!!
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.