Author Topic: Placing the swf in a Table in HTML  (Read 1834 times)

Matt Stone

  • Jr. Member
  • **
  • Posts: 27
Placing the swf in a Table in HTML
« on: December 19, 2010, 08:19:46 pm »
I just wanted to replace the DHTML page-flipper I have now with the better Megazine3, but putting the div inside a table doesn't work.  How should I put this in a table?

Thanks :-\

Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1989
  • MegaZine3 Developer
    • MegaZine3
Re: Placing the swf in a Table in HTML
« Reply #1 on: December 21, 2010, 10:30:14 am »
I'm not sure how exactly SWFObject works internally, but I'd assume it doesn't necessarily have to be a div that contains the Flash content. So you could just give the table cell that should contain it the appropriate ID, i.e. <td id="megazine"></td>.
For the Snark was a Boojum, you see.

Before you ask a question
          After you get an answer
  • please document your problem with the answer in the Project Wiki. (e.g. in the FAQs)
  • help others out if you can, by answering their questions on the forum.

Matt Stone

  • Jr. Member
  • **
  • Posts: 27
Re: Placing the swf in a Table in HTML
« Reply #2 on: December 21, 2010, 02:57:26 pm »
I tried that, it doesn't work...Nothing is displayed at all when I try that.

Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1989
  • MegaZine3 Developer
    • MegaZine3
Re: Placing the swf in a Table in HTML
« Reply #3 on: December 22, 2010, 12:54:25 pm »
Well, I don't know what it is, but something is wrong in your page then. I just tested both cases, i.e.
Code: (xml)
  1. <table><tr><td><div id="megazine"></div></td></tr></table>
and
Code: (xml)
  1. <table><tr><td id="megazine"></td></tr></table>

Both worked fine. Are you sure you're not missing the SWFObject JavaScript or something? I.e. the
Code: (xml)
  1. <script type="text/javascript" src="js/swfobject.js"></script>
For the Snark was a Boojum, you see.

Before you ask a question
          After you get an answer
  • please document your problem with the answer in the Project Wiki. (e.g. in the FAQs)
  • help others out if you can, by answering their questions on the forum.

Matt Stone

  • Jr. Member
  • **
  • Posts: 27
Re: Placing the swf in a Table in HTML
« Reply #4 on: December 22, 2010, 01:26:58 pm »
I don't know what I'm doing wrong...my code looks the same, at least for those lines.  Would you take a look?  http://www.mattstone.biz/mshowcase/index.html

Thanks.

Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1989
  • MegaZine3 Developer
    • MegaZine3
Re: Placing the swf in a Table in HTML
« Reply #5 on: December 23, 2010, 05:20:33 am »
Your HTML is broken, try the w3c validator once in a while ;)
Code: (xml)
  1. <table><tr><td id="megazine"></td></tr></table><tr><td>
  2. <div id="megazine">
  3. ...
  4. </div>
  5. </td></tr>
  6. </table>

should be
Code: (xml)
  1. <table><tr><td>
  2. <div id="megazine">
  3. ...
  4. </div>
  5. </td></tr>
  6. </table>
For the Snark was a Boojum, you see.

Before you ask a question
          After you get an answer
  • please document your problem with the answer in the Project Wiki. (e.g. in the FAQs)
  • help others out if you can, by answering their questions on the forum.

Matt Stone

  • Jr. Member
  • **
  • Posts: 27
Re: Placing the swf in a Table in HTML
« Reply #6 on: December 23, 2010, 05:41:55 am »
Yes, my bad...but it still doesn't work as a table.  I've changed it to add 2 rows:  first with the swf, second with a graphic.  The graphic doesn't display...nor does the table.  What I want is for the flash object to show as an element of a table, much as the DHTML pageflipper does here: http://www.mattstone.biz/testsite/Closed_for_maint.htm

Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1989
  • MegaZine3 Developer
    • MegaZine3
Re: Placing the swf in a Table in HTML
« Reply #7 on: December 23, 2010, 06:22:23 am »
Well, the remaining issue seems to be, that the path to megazine.swf file seems to be incorrect. Produces a 404.
For the Snark was a Boojum, you see.

Before you ask a question
          After you get an answer
  • please document your problem with the answer in the Project Wiki. (e.g. in the FAQs)
  • help others out if you can, by answering their questions on the forum.

Matt Stone

  • Jr. Member
  • **
  • Posts: 27
Re: Placing the swf in a Table in HTML
« Reply #8 on: December 23, 2010, 06:29:17 am »
I just fixed that...was in too much of a hurry.

Matt Stone

  • Jr. Member
  • **
  • Posts: 27
Re: Placing the swf in a Table in HTML
« Reply #9 on: December 23, 2010, 06:43:52 am »
It seems I may not be able to run this from godaddy, as I cannot register the mz3 or asul files with IIS there.  It shows the problem when running index.html locally as a file, tho.

Matt Stone

  • Jr. Member
  • **
  • Posts: 27
Re: Placing the swf in a Table in HTML
« Reply #10 on: December 23, 2010, 07:06:16 am »
I really appreciate your help.  I've put all the relevant files in this zip: http://www.mattstone.biz/mshowcase/FlashPageFlip.zip .

Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1989
  • MegaZine3 Developer
    • MegaZine3
Re: Placing the swf in a Table in HTML
« Reply #11 on: December 23, 2010, 02:16:34 pm »
Aside from your HTML still being broken (what I pointed out before... the table is incorrect), you'll have to set some absolute sizes somewhere. If you don't set the size for the <td>, then you'll have to change the two '100%'s in the swfobject.embedSWF call to some absolute values.

Regarding the mz3/asul extension issues, just change the extension to xml. For the book definition just adjust the xmlFile FlashVAR to make the engine find it afterwards, as for the ASUL files, see http://www.megazine3.de/doc/Book#asulextension
For the Snark was a Boojum, you see.

Before you ask a question
          After you get an answer
  • please document your problem with the answer in the Project Wiki. (e.g. in the FAQs)
  • help others out if you can, by answering their questions on the forum.

Matt Stone

  • Jr. Member
  • **
  • Posts: 27
Re: Placing the swf in a Table in HTML
« Reply #12 on: December 23, 2010, 04:25:03 pm »
Thanks so much...I got it from here!

Matt Stone

  • Jr. Member
  • **
  • Posts: 27
Re: Placing the swf in a Table in HTML
« Reply #13 on: December 28, 2010, 07:13:57 am »
I think it's working 90% of the way I'd like it to.  All that's left is, the page doesn't scroll!  I have this version at http://www.mattstone.biz/mshowcase/maint.html.  I really appreciate the help.

Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1989
  • MegaZine3 Developer
    • MegaZine3
Re: Placing the swf in a Table in HTML
« Reply #14 on: December 28, 2010, 03:42:10 pm »
Remove the overflow:hidden from your body CSS.
For the Snark was a Boojum, you see.

Before you ask a question
          After you get an answer
  • please document your problem with the answer in the Project Wiki. (e.g. in the FAQs)
  • help others out if you can, by answering their questions on the forum.