How can I load the unique content without using iframes? It really goes pair-shaped for users with small resolutions (for this reason, I've decided to use <div>s instead).
Can I use javascript (or FSObject) to replace a <div> ?
I could do that, but it's an awful lot of work. If you look at my site, the menu moves and changes depending on what page is loaded (into the iframe). http://www.pc16.net/chris/test/div.php
I'd rather just use css than have to make a whole array of swf files which would each need updating whenever the site changes.
I was hoping that someone tell me something about using Flash and javascript together.
maybe use CSS and LAYER your FLASH menu over the HTML..using the z-index. (never really used it or looked into much
and you would still only have 1 menu.swf...you just use an #include statement to add it to every HTML page as suggested above...same thing you do for a consistant header/footer throughout a site.
a 3rd option..would be to NOT load your next HTML page on the CLICK of the button..but rather when the 'sliding animation' was complete....
on the NEW page that loads..just have the menu open at that point again...flash can read a variable in the URL of an HTML page..and display the correct menu 'look'
How does a SWF read variables? Are these php variables?
That would solve my problem if the reloaded menu could go straight to a particular "state".
( I've used getURL with "post" and "get" before, so I understand what happens the other way round )
...However, what I was thinking was to use javascript - much like the SWFObject.js for embedding SWFs available on these boards. Instead of replacing the contents of the <div> with the swf file, I could replace the MAIN <div> with other pages. I'd have to use FSObject in making the .fla files, though, right?
Does that make sense? (I'm pretty tired now!)
Anyone know how to do this?
ps - I've been changing things, but here's the link: http://www.pc16.net/chris/test/div.php
Note: Clicking on "About Us" loads the old Flash menu. This is like what I want to happen with the main <div> but with the proper content.
Thanks,
Chris
Last edited by flashMine; 06-28-2006 at 08:35 PM.
Reason: making something clearer
you can use a little bit of javaScript and..and the .swf can then read the URL of the HTML..and pick out the VARIABLE from there..
example how it pertains to you.
you click on a link in your menu... it plays the sliding down animation (although why it does that..I dont know...there are NO sub-links...and if there were this would get harder)...at the end of the sliding animation..you have a FRAME action that says getURL... this calls another HTML page..however the url is calls is like so:
getURL("http://www.whatever.com?page=contact");
when your "contact" HTML page loads....the .swf (MENU) will read this variable in the URL string.....you will have code that says:
Code:
if (page == contact) {
_root.menu.gotoAndStop("contactState");
}else if (page == home) {
_root.menu.gotoAndStop("homeState");
};
etc..etc..on and on until you check against all your possible options..
thx, I understand all that, but exactly how does the .swf get the variables (page etc.) from the url?
What is the function?
thaks again,
chris
ps - the animation is all done by actionscript, and i was planning to have submenus. i'll have to figure out how best to deal with that after i sort out the fundamentals, like how the menu interacts with the page.
pps - i'm not happy with the way the animation looks. maybe i'll load flash submenus across using the SWFObject.js ( just like the "about us" link loads the original red menu in its place.
I don't know what the ampersand in the object tag will do, or if flash will read it as a separate variable. It might, it can read txt file variables that way. I just haven't done it either, and don't have the time to try.
yep..I just tried it in my example... didnt even have to change any code..(unless I wanted to trigger somethign with those vars...I just added another var to the "URL" and pulled in all vars on _root..shouldnt be a problem at all.. ..this is different that pulling in a hardcoded var from the HTML code..