Link to home
Start Free TrialLog in
Avatar of s_federici
s_federici

asked on

Showing HTMLpage inside Flash

Is there a Flash mechanism that would allow me to show an existing HTML page INSIDE the flash Movie by specifying the pge URL? Sort of an HTML Iframe.
Avatar of CyanBlue
CyanBlue
Flag of United States of America image

Nope...  No such thing exists in Flash...  As a matter of fact, Flash only understands HTML 1.1 specification, so that's not really possible...
But with Apollo/AS3, you can embed the HTML page inside it...  I don't know how to do that, but I saw that in one of those online sessions...

CyanBlue
Avatar of s_federici
s_federici

ASKER

What's Apollo/AS3? I tried to google it, but couldn't find anything meaningful.
Check this page out...  :)
http://labs.adobe.com/technologies/apollo/

CyanBlue
You could, however, import very basic HTML from a text file using loadVariables, and then introduce this into a dynamic text field. As an alternative...
I had  look at Apollo, but I guess this is something that must be installed on the web server. My Hosting company is not going to allow me this. As for the dymanic text field, I need to embed a page that is created by PHP code. Can your solution be useful in this case?
Nope...  Apollo is basically a desktop version of Flash, if I can simply put it...  
That means that you cannot embed the HTML document to the Flash movie that is served via web...

CyanBlue
Any other clues?
ASKER CERTIFIED SOLUTION
Avatar of veiko_1001
veiko_1001

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Like I was saying Flash only understands HTML 1.1 specification which means no TABLE or DIV or whatsoever...

CyanBlue
Ok, I can stick to a very basic HTML page. But how do I embed the resulting page (whose URL is, let us say, http:///www.mydomain.com/myphppage.php) into Flash? I'm not a Flash expert and I need the exact sequence of operations to be performed. Thanks.
Well the output of myphppage.php should look like this:

myContent=this is <b>my</b> text

It does not all have to be in one line, but I find it's better if it is. Otherwise, you get extra spacing. In your flash file create a dynamic textfield named myTextField and select the 'Generate text as HTML' option. And this is the code:

myData = new LoadVars();
myData.load("http:///www.mydomain.com/myphppage.php");
myData.onLoad = function (success) {
        if (success) {
                myTextField = this.myContent;
        } else {
                myTextField = "Error";
        }
}

Hope this helps !
I didn't read well about what HTML 1.1 doesn't allow... no tables... I need tables... any other solution? Or... can I create the table in Flash and put a dynamic textfield inside each cell? Could that work? The table has always the same number or rows and cols. Does Flash have tables and cells? Or can I just put several dynamic textfields each close to each other?
You can use several text fields or there is a suggested way to simulate a table in the link from Adobe that I sent before. Good luck.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
To CyanBlue: will I add this component to my Flash installation and the output swf file will be able to load the external web page, with no modification to the web server?
That component only takes care of the HTML table nothing else...  I'd say you've got to check out that page further to see if that's all you need or not and purchase it if that's indeed what you are looking for...

CyanBlue
I saw in that page that I can specify an html file and it will be loaded and the table rendered. What I do not still fullly understand is if this component must be installed on the web server on which the flash (swf) file is located or if this simply allows Flash to output a swf file that will manage the table definition from the HTML file.

To sum up: is it a component to be installed onto the web server or a component to be added to my local Flash installation?
No, that's the component Flash IDE needs to have as far as I am aware...  It has nothing to do with the server...

CyanBlue
Is the web page you're loading something that you're also creating yourself? If it is then it sounds as if the "loading in a web page" option might not be ideal. For example if you're simply wanting to load in data of some sort there are better ways to do it and then you can get flash to display things properly. Loading in a regular HTML page into flash isn't really going to be feasible.  However there's no reason why you couldn't have a flash interface on a normal web page with an IFrame on the web page too - the flash app could then control which content was loaded into the IFrame. (So it could look just like what you were asking for.)
Do you mean disposing several flash boxes around the iframe (I need the iframe to be internal to the web page rendered by flash)? It seems really complex to me...do you have a working example?
Well possibly having several flash boxes but not necessarily - it depends how much flash stuff you really need on your page - if all of one side of the IFrame is just a graphical border then you could just use an image etc around it. I appreciate it could be a bit of a pain but it shouldn't be that hard. I don't have any examples to hand but there are plenty of websites around which blend bits of flash with bits of HTML. I guess it just depends how complex your flash application is really and what you're wanting the flash application to do. If it's just to load in web pages into an IFrame then it's conceivable that most of the logic could be in just one of the flash elements while the rest are just their for prettiness.

This link has some info about getting more than one swf to talk to each other within a web page:
http://groups.google.co.uk/group/macromedia.flash.actionscript/browse_thread/thread/951f11b65c0dc598/0250c21dc5dff30a?lnk=st&q=communicate+between+swfs+on+web+page&rnum=2&hl=en#0250c21dc5dff30a

Tis a bit fiddly I guess, but if you go about it this way then you know that any kind of web page will be acceptable and rendered in a normal way rather than depending on various plug-ins to render half decent tables etc.  It's an interesting technique anyway.
I already have the website that is completely developped in flash. I just would like to add a box that is managed by PHP (a PHP calendar).
ok well if it's possible to spool the data out in xml from your php calendar (assuming it is full of data other than the dates) then perhaps you could build a simple flash calendar and use one of the xml classes to read in the data? doesn't sound too tricky...
Avatar of Michel Plungjan
Any luck here?
"spool the data out in xml from your php calendar"

I have no idea of what you are speaking of najh. Could you please give me more details? Thanks.
Well what does your php calendar consist of? Had it got data in, like say birthdays or significant days of some sort? If so, then this data is possibly held in a database, in which case you could probably use php to write some XML with the dates of interest encoded. Then you read in the XML into a snazzy flash calendar.

However if your PHP calendar is just a calendar showing the current month and nothing more then just knock one up in flash.  In fact there's even a "date chooser" component in flash, so if you weren't sure what you were doing you could just drag and drop that into your existing flash file. This would probably look a much neater solution than having some HTML being parsed into flash somehow and better than having an IFrame in an HTML page, but it does of course depend on what you have already and what you know about it's implementation. (and your skills in implementing it - but for the skills bit there are people here who are at least prepared to point you in the right direction :o) )
Yes, I'm speaking of a regular calendar. So you say that I cannot plug my PHP calendar in my flash site just by showing its HTML output inside the flash page.
Seems there is even no need to rewrite
http://www.google.com/search?q=flash+calendar
Nope...  You've got to create your own within the Flash...

CyanBlue
Agreed - write your own in flash - it'll be much nicer anyway.
There must be a million ready made examples and tutorials out there already and you could use the included calendar component to help you on your way.
Can I pleave have then a good reference URL? I looked for someone, but none of them were opensource and/or nice. Thanks.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial