Author |
Topic |
|
T00N
Super User
573 Posts |
Posted - 03 Mar 2009 : 16:26:04
|
I have this page in which i want to show 4 different flash picturegalleries. When I click on GALLERY A I want to show GALLERY etc.
Normally you can do this with a link to the swf file and show it in an iframe.
Unfortenately this flash slideshow you can't just link to but you have to embed it with code like this:
<embed src="http://www.schepwelding.nl/banner/schepwelding.swf?fs_path=http://www.schepwelding.nl/banner/" quality="high" width="800" height="240" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
Now I can make 4 different html boxes and make them invisible and when On Click make them visible.
But I hope it can be done with a cleaner solution.
So is there a way that I can click on a link and show the flash file (like above) in an iframe or html box.
Something like: OnClick the html code in htmlbox 1 is the above code. |
|
petran
Super User
Netherlands
345 Posts |
Posted - 04 Mar 2009 : 15:34:15
|
This must be possible using PHP. At the moment I'm working on a similar thing (showing different locations on a Google map). If I found a solution I let you know ASAP. |
--------
regards
Petran |
|
|
s.dav
Site Admin
Italy
3364 Posts |
Posted - 04 Mar 2009 : 16:00:29
|
Very simple also using HTML:
1- draw a generic IFRAME object, press Ok and in its HTML content write the following code:
<div id="mydiv" style="width:$WIDTHpx;height:$HEIGHTpx;"></div>
2- Resize the generic object, now we are using a generic object in order to customize some HTML code on the fly 3- create a javascript section into your page and when an event occurs call a function like this
document.getElementById("mydiv").innerHTML="<embed src=\"http://www.schepwelding.nl/banner/schepwelding.swf?fs_path=http://www.schepwelding.nl/banner/\" quality=\"high\" width=\"$WIDTH\" height=\"$HEIGHT\" align=\"middle\" allowscriptaccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed>";
in this way you'll be able to insert any HTML code into any HTML element like a DIV
|
Regards, Davide |
|
|
joneq
Super User
433 Posts |
Posted - 04 Mar 2009 : 19:51:03
|
quote: Very simple also using HTML
Very simple for you
This kind of thing,and there have been others, is where you need a special place/forum for like "Things you may want to try in DWHE" Or "Things you never knew you could do with DWHE"
Someone may never think they want it or need it,or that it even exists, but when they see it and how to do it all in one spot they may make use of it.
This is not really a tutorial as much as a mostly unknown feature of DWHE
|
Edited by - joneq on 04 Mar 2009 20:39:27 |
|
|
T00N
Super User
573 Posts |
Posted - 04 Mar 2009 : 22:18:57
|
I followed your instructions.
I created a hotspot and onclick I added a javacall with
document.getElementById("mydiv").innerHTML="<embed src=\"http://www.schepwelding.nl/banner/schepwelding.swf?fs_path=http://www.schepwelding.nl/banner/\" quality=\"high\" width=\"$WIDTH\" height=\"$HEIGHT\" align=\"middle\" allowscriptaccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed>";
Unfortenately it doesn't work. When I view the page there is an error:
\";returnfalse;">
I hope it's something small...
|
|
|
T00N
Super User
573 Posts |
Posted - 04 Mar 2009 : 22:29:09
|
Hmm maybe error isn't the right word. On the place of the hotspot I see the above text and when I click the hotspot nothing happens. |
|
|
Andy
Expert
United Kingdom
83 Posts |
Posted - 04 Mar 2009 : 22:46:44
|
Hi,
Dav,
I just spent a couple of hours trying to understand it as well and failed with same error. I think you are assuming we know more than (I) do. I created the iframe, deleted the HTML content and put your <div> code in. Then put text box in with an event "onclick" and put javacall in by copying your code into the bottom line and adding. Id hoped to play a swf file on demand so the main page loads faste.
Cheers
Andy |
Andy |
|
|
T00N
Super User
573 Posts |
Posted - 05 Mar 2009 : 08:20:40
|
Everywhere there is a " it has been replaced by /"
That can't be good, can it? |
|
|
s.dav
Site Admin
Italy
3364 Posts |
Posted - 05 Mar 2009 : 09:29:02
|
There is a syntax error, please send me the code for the SWF objects and I'll upload a sample to my site showing how to fix the problem ;-)
|
Regards, Davide |
|
|
T00N
Super User
573 Posts |
Posted - 05 Mar 2009 : 09:37:18
|
This is the code I use in a html box to show the banner:
<embed src="http://www.schepwelding.nl/banner/schepwelding.swf?fs_path=http://www.schepwelding.nl/banner/" quality="high" width="800" height="240" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed> |
|
|
T00N
Super User
573 Posts |
Posted - 05 Mar 2009 : 10:10:32
|
and this what its like in the page
<div id="ldheHotSpot1" style="position: absolute; left: 239px; top: 750px;" align="left"> <a href="#" onclick="document.getElementById(\"mydiv\").innerHTML=\"<embed src=\"http://www.schepwelding.nl/banner/schepwelding.swf?fs_path=http://www.schepwelding.nl/banner/\" quality=\"high\" width=\"$WIDTH\" height=\"$HEIGHT\" align=\"middle\" allowscriptaccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed>\";return false;"><img src="files/blank.gif" width="176" height="49" border="0" alt=""></a></div>
|
|
|
joneq
Super User
433 Posts |
Posted - 05 Mar 2009 : 18:21:54
|
Delete |
Edited by - joneq on 05 Mar 2009 18:22:47 |
|
|
petran
Super User
Netherlands
345 Posts |
Posted - 06 Mar 2009 : 09:05:02
|
And here is my PHP solution:
In your page (in this example I named it photos.php) make a HTML box with the following code:
<?PHP
switch($_GET[gallery]) {
case 1: print "Her comes your code for Gallery 1";
break; case 2: print "Her comes your code for Gallery 2";
break; case 3: print "Her comes your code for Gallery 3";
break; default: print "Here your code when none of the cases are true"; break;
} ?>
On that same page you can make buttons or text-links with the links:
photos.php?gallery=1 photos.php?gallery=2 photos.php?gallery=3
That's it.
When you use a " character you have to escape it with a backslash like you also do in Javascript, like this \". Remind that PHP is a serverside script so you have to test it remote online or local when you have your own server up and running. |
--------
regards
Petran |
Edited by - petran on 06 Mar 2009 09:20:47 |
|
|
s.dav
Site Admin
Italy
3364 Posts |
Posted - 06 Mar 2009 : 10:31:32
|
I'll put a sample asap on my site ;-) |
Regards, Davide |
|
|
T00N
Super User
573 Posts |
Posted - 07 Mar 2009 : 22:05:44
|
Oke great!
If it was only a syntax error... I have a deadline for this site next tuesday...
:) |
|
|
s.dav
Site Admin
Italy
3364 Posts |
|
T00N
Super User
573 Posts |
Posted - 09 Mar 2009 : 20:14:02
|
Oke Thanks for the tutorial.
Got it working but it's completely different from what you wrote before?
The fact that you have to put the code in the header isn't as handy as putting the code in the div. A div you can copy to another page and the make some adjustments. Now you have to go to the header section, copy the code and put it in the header section of the other page.
But hey, it's working! |
|
|
jtarin
Super User
Russia
444 Posts |
Posted - 09 Mar 2009 : 23:49:22
|
Have you tried using "Batch Manager" to accomplish this? |
Porky www.pacificwavetour.com |
|
|
s.dav
Site Admin
Italy
3364 Posts |
Posted - 10 Mar 2009 : 08:45:53
|
The sample I done can be made in many ways ;-) I made it thinking that is it a tutorial ;-) |
Regards, Davide |
|
|
T00N
Super User
573 Posts |
Posted - 10 Mar 2009 : 09:18:38
|
Oh you mean I have to learn from it :)
I'm strictly a cut and paste guy when it comes to coding :)
|
|
|
|
Topic |
|