Click to See Complete Forum and Search --> : HTML Navigation w/Flash Reaction?
Hi,
I'm designing my pages with html based navigation in mind, basically so it's more universally accessable (by people and the search engines).
However, I don't see why Flash should be disregarded entirely, as it is a great asset. So I was racking my brains over an incorporation of the two elements (html and flash).
Here's what I concluded: that the actual linked part of the nav bar (i.e. the text) would have to be done in html, for the afore-mentioned reason. But what if i could have a part of the nav flash based, that reacts to the html being rolled over, clicked on etc, which is inturn all designed in such a way that the two look seamless to the vistor. This would then keep intact all the values that comes with a html nav link (the SEO etc), but also bring all the 'jazz' of a flash nav bar.
Could anyone help me with the research on this subject, by answering these Q's if you have any experience/ideas on the solution: a) can a html based component (i.e. the link) initiate a flash based component? Which if true, leads to... b) How do you make a html navigation (for example, created in Dreamweaver) cause a reaction (start an animated sequence) on a component that is created in Macromedia Flash? Where is the bridge created?
Thanks,
Rich.
Webjedikungfu
08-18-2007, 06:46 PM
Hey RTP,
I have experience doing what you asked. And yes Flash NAV can control HTML pages, and HTML links can control what happens inside of an .swf file(flash).
Pass variables into your flash movies from HTML links by appending the .swf file. Example:
test.swf?var1=$pagechoice
Then that variable gets passed into the flash file, where you then use it to go to whichever page they clicked, or whatever frame you want in a flash movie. HTML links can indeed do that.
So if the user clicks on a HTML link you reload the page with that choice recorded and in goes the variable to flash.
Use PHP if you can to do all that.
You're a genious! lol.
Never in many-a hours of studying for a solution would I have figured that out!
I'm quite basic at actionscript however (animator by trade, but still a student when it comes to scripting as you probably already guessed!)
So this variable; is it placed in the flash actionscript so that it responds to certain designated html links, or is this variable placed in the html link code itself (within dreamweaver for example) where it references the flash aspect? Please excuse the begginner's ignorance when responding! lol.
Your answer has hit it spot on the money for what I need (making my html links have a flash reaction in a seamless way), so thankyou for that.
Rich.
Webjedikungfu
08-18-2007, 10:21 PM
Shucks, thanks.
OK check it,
Set up HTML links like this, many as needed:
<a href="search.php?get_it=search">Search</a>
<a href="index.php?get_it=homepage">Homepage</a>
Then setup the PHP file to accept a simple _GET request to grab the URL variable the user has now given you to run into flash.
$thechoice= $_GET['get_it'];
So in your HTML file requesting the _GET, adjust your flash <object> tags like this to take the var into flash:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="800" height="550" id="testfile" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="testfile.swf?var1=<?php echo "$thechoice"; ?>" />
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
<param name="bgcolor" value="#999999" />
<embed src="testfile.swf?var1=<?php echo "$thechoice"; ?>" quality="high" wmode="transparent" bgcolor="#999999" width="800" height="550" name="testfile" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
Finally Once in flash get at the var from the [_root] like so:
this.showchoice_txt.text = (_root.var1);
// This will print the choice to the screen in a dynamic text field
// So once you have the var do what you need to with it in flash
Good luck Partner!
Webjedikungfu
08-18-2007, 10:35 PM
You may find a syntax error or two in there, I was just trying to show the theory.
Hopefully it's error free, I have not tested.
Thankyou Webjedikungfu, i think (touch wood) i've got it.
One thing though, due to lack of experience, i'm a lil' (understatment!) fuzzy with the PHP aspect. I'm not too bad with html now after constantly working with it, training myself so to speak, and learning as i go. But PHP - i openly confess i havn't a clue! Never used it b4, and as always with something new, I keep putting off studying it as it seems daunting to me (did the same with html until i just jumped in and went for it).
Best get starting with it then! lol. So; the _GET request - how do i use it and even (although a lil ashamed to ask) where do i put it? lol. Sorry, but i really havn't a clue about PHP. I know it's sever side development etc, but i've never used it (as this is my first crack at site design - don't worry, the site's for me!).
I'm working with Dreamweaver if that has any bearing. At a risk of sounding dumb again - do i place this code (request) in the code element of Dreamweaver, or somehwhere else?
Thanks again,
Rich.
Webjedikungfu
08-18-2007, 11:05 PM
LOL, don't sweat it. PHP is simple if you don't over complicate it like I see so many doing. Couple of pointers before we send you out:
1. Be sure your server can run PHP.
2. You can rename any of your .html files to .php files and add PHP tags in them to run php(simple), anywhere in the HTML file too.
3. Start with An introduction to Variables http://www.phpfreaks.com/tutorials/37/0.php
4. Come back to this thread and gather my examples back up and use.
Oh yeah, php won't execute on your system, but it will up on your webserver. Unless you set up through dreamweaver. I think dreamweaver hold server side testing stuff.
Good luck!
Ok, thanks for the guidance.
Christ, i didn't even know i had to download PHP! Lol, shows how new i am too this. How do i know if my web server supports PHP? How do i even know what web server i have?! Do i need to 'get' that too, or should i already have one. :o , I have Win XP if that's any relevance. As i'm saying this, I realise how stupid it's more than likely sounding, but like i said, i'm really new too this. Suppose this is what happens when you do it ALL by yourself.
I just downloaded PHP (which was complex by itself!) using a MSI Installer. I think it worked fine - in that i didn't get any errors and i believe i followed the install instructions on their site ok. What's the next step to testing PHP, to see if it did work? Suppose i'm gonna need a test host site, right?
Thanks again, you've been a big help.
Rich.
Webjedikungfu
08-19-2007, 09:37 AM
No sweat RTP,
This little simple PHP test script will output "Hello Universe!" to the page when Executed.
<html>
<body>
<?php echo("Hello Universe!"); ?>
</body>
</html>If you don't see "Hello Universe" as output to the page, then PHP is not working.
Do you have a hosting account with a web server yet where you can FTP PHP files for testing(online)?
Or are you testing scripts on your machine at home(not online)?
BTW, You can ask PHP questions in the PHP forum here to get better answers on PHP stuff.
I've gone thru a step-by-step and installed PHP, MySQL & Apache Server (as advised in the step-by-step guide). I used a test it outlines and it all seems to work fine. It said to save some some test .php files in notepad and check them at 'http://localhost/'. And all seems to be good!
So next step i think is that introduction variables! Thanks again for your help - i'll have to bookmark this thread so i come back when i'm ready to go for the flash/html bridge!
Rich.