html need help

liunx

Guest
right seen this on other sites so i know you can do it well here i go<br />
right say i want to make a page with a swf cartoon on a .html and instead of making new page like <!-- w --><a class="postlink" href="http://www.mydomain.com/cartoon1.html">www.mydomain.com/cartoon1.html</a><!-- w --> and <!-- w --><a class="postlink" href="http://www.mydomaim.com/cartoon2.html">www.mydomaim.com/cartoon2.html</a><!-- w --> just have it so say one swf file is called cartoon.swf so i make on page eg <!-- w --><a class="postlink" href="http://www.mydomain.com/cartoon.html">www.mydomain.com/cartoon.html</a><!-- w --> and so when i want to play cartoon.swf it looks like <!-- w --><a class="postlink" href="http://www.mydomain.com/cartoon.html?cartoon.swf">www.mydomain.com/cartoon.html?cartoon.swf</a><!-- w --> and it play the cartoon.swf on that page (the url dosent have to look like that but near)<br />
thanks pogo all help apricated!<!--content-->You should be looking more towards server side coding for that, although it can be done with JavaScript but that would make it inaccessible.<br />
<br />
ASP or PHP would be ideal for this sort of thing, does your server support either of those? If it doesn't then try changing servers to one that does support these things.<br />
I can give you a script in ASP to do this and I could probably do one in PHP although that isn't my fort&eacute;.<!--content-->please ASP I'd love that! how can i pay you? (not with money) i could make you a global mod?(on my site)<!--content-->Well for ASP the code would look a bit like this:<object width="550" height="400" id="myMovieName" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://Download <!--more-->.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><br />
<param name="movie" value="<%= request.querystring("cartoon") %>.swf"><br />
</object>The <%= is short for response.write and %> signals the end of the ASP code. request.querystring("cartoon") grabs the value from the URL so long as your URL looks like this:<br />
<br />
<!-- w --><a class="postlink" href="http://www.mydomain.com/cartoon.html?cartoon=swf_file_here">www.mydomain.com/cartoon.html?cartoon=swf_file_here</a><!-- w --><br />
<br />
The resulting HTML would look something like this:<object width="550" height="400" id="myMovieName" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://Download <!--more-->.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><br />
<param name="movie" value="swf_file_here.swf"><br />
</object>If you are using embed to display your flash files then you can easily adapt it, I used object because embed is no longer part of the standards.<br />
<br />
This is only a simple ASP script that grabs something from the URL and puts it into some HTML, I have removed the .swf extension from the URL because it will always be a .swf file so there is no point in passing it through the querystring.<br />
If this is the only ASP on the page then I assume that you will not have this in your source:<%@ language="VBscript" %><br />
<% option explicit %>You must have that before the first bit of ASP on the page otherwise it will not work.<br />
<br />
If you are wondering where I got the horrendously long classid and codebase from, Macromedia have it on their web-site (<!-- m --><a class="postlink" href="http://www.macromedia.com/support/flash/ts/documents/tn4150.html">http://www.macromedia.com/support/flash ... n4150.html</a><!-- m -->).<br />
<br />
By the way, help here is usually free. ;)<!--content-->
 
Back
Top