views:

160

answers:

4

I know very little about Flash, and so is not programming in it. I have a website in PHP, and obviously, HTML, CSS, JS, etc.

What I want to do is to allow users to full-screen certain pieces of the DOM. So my question is, is there any way to wrap flash around certain portions of the DOM dynamically in order to allow full screening of that portion.

Edit:

The current responses are very interesting and could be the only options.

But in my ideal world there would be an embedded flash object, and inside that would be some sort of iframe or the flash equivalent so that the rendering is still handled by the browser and not flash itself.

A: 

use allowFullScreen="true" ine embed tag

<embed src="kitchen.swf" allowFullScreen="true" bgcolor="#333333" width="1024" height="576"
 name="fullscreen" align="middle" type="application/x-shockwave-flash"
 pluginspage="http://www.macromedia.com/go/getflashplayer" />
joe
A: 

If you're asking if it will fullscreen the HTML of the page, then no - I've never heard of anything like that before (not with Flash at least).

You could use some jQuery to accomplish something like this by increasing the scale of the content and the elements inside of a parent element, but it sounds like it would be difficult to say the least.

Hugoware
Actually I'm doing that, but it's not true full screen. :)
Mark
A: 

Flash is very limited to what HTML it can render by itself ( bold,italic,underline, a, ul, li and img I think are the only tags supported ) in the Flash Player. AIR renders full HTML, but that won't help you at all.

You could try and use an html parser. I didn't spent to much time with html in flash, so I don't know which parser does the best job. Here's one that looks ok-ish:

http://code.google.com/p/htmlsprite/

Once you have your html rendered in flash properly, the rest is easy peasy. Assuming fullscreen would be your fullscreen button.

fullscreen.addEventListener(MouseEvent.CLICK, fullscreenClicked);

function fullscreenClicked(event:MouseEvent):void{

switch(stage.displayState) {
                case StageDisplayState.NORMAL:
                    stage.displayState = StageDisplayState.FULL_SCREEN;
                    break;
                case StageDisplayState.FULL_SCREEN:
       default:
                    stage.displayState = StageDisplayState.NORMAL;
                    break;
            }
      trace('stage.displayState: ' + (stage.displayState));

}

As Krish stated, don't forget to set allowFullScreen to true in both embed and object tags. Also, you can only test in the browser, not in the IDE.

George Profenza
Very interesting, thanks!
Mark
+1  A: 

The standard Flash player does not have the concept of iFrame. With AIR you can embed a browser (WebKit based) within a Flash application, but this is only for desktop applications.

The only real way to do exactly what you want would be to have Flash read out to the DOM via ExternalInterface, pull in the structure of the page, and recreate it in Flash. The complexity of this depends on the complexity of your page and how you choose to render the content you get from the DOM.

Branden Hall
Would javascript work inside flash? Or would I have to make it into flash script or whatever it is.
Mark