Solved

Showing HTMLpage inside Flash

Posted on 2007-03-29
34
263 Views
Last Modified: 2012-08-13
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.
0
Comment
Question by:s_federici
  • 12
  • 8
  • 6
  • +2
34 Comments
 
LVL 37

Expert Comment

by:CyanBlue
Comment Utility
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
0
 

Author Comment

by:s_federici
Comment Utility
What's Apollo/AS3? I tried to google it, but couldn't find anything meaningful.
0
 
LVL 37

Expert Comment

by:CyanBlue
Comment Utility
Check this page out...  :)
http://labs.adobe.com/technologies/apollo/

CyanBlue
0
 
LVL 1

Expert Comment

by:veiko_1001
Comment Utility
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...
0
 

Author Comment

by:s_federici
Comment Utility
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?
0
 
LVL 37

Expert Comment

by:CyanBlue
Comment Utility
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
0
 

Author Comment

by:s_federici
Comment Utility
Any other clues?
0
 
LVL 1

Accepted Solution

by:
veiko_1001 earned 168 total points
Comment Utility
Yes, you can use PHP to create the text file with the data you want to import. But as I said before, it must contain only very basic HTML. And no, <html> or <body> tags.

Here is a link with the allowed tags for Flash MX 2004:
http://livedocs.adobe.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Flash_MX_2004&file=00001040.html
0
 
LVL 37

Expert Comment

by:CyanBlue
Comment Utility
Like I was saying Flash only understands HTML 1.1 specification which means no TABLE or DIV or whatsoever...

CyanBlue
0
 

Author Comment

by:s_federici
Comment Utility
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.
0
 
LVL 1

Expert Comment

by:veiko_1001
Comment Utility
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 !
0
 

Author Comment

by:s_federici
Comment Utility
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?
0
 
LVL 1

Expert Comment

by:veiko_1001
Comment Utility
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.
0
 
LVL 37

Assisted Solution

by:CyanBlue
CyanBlue earned 166 total points
Comment Utility
Here is a component available if you want to display the HTML table in Flash...

HTMLMaker by FlashRelief
http://www.flashrelief.com/tablemaker/features.html

CyanBlue
0
 

Author Comment

by:s_federici
Comment Utility
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?
0
 
LVL 37

Expert Comment

by:CyanBlue
Comment Utility
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
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:s_federici
Comment Utility
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?
0
 
LVL 37

Expert Comment

by:CyanBlue
Comment Utility
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
0
 
LVL 10

Expert Comment

by:najh
Comment Utility
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.)
0
 

Author Comment

by:s_federici
Comment Utility
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?
0
 
LVL 10

Expert Comment

by:najh
Comment Utility
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.
0
 

Author Comment

by:s_federici
Comment Utility
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).
0
 
LVL 10

Expert Comment

by:najh
Comment Utility
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...
0
 
LVL 75

Expert Comment

by:Michel Plungjan
Comment Utility
Any luck here?
0
 

Author Comment

by:s_federici
Comment Utility
"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.
0
 
LVL 10

Expert Comment

by:najh
Comment Utility
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) )
0
 

Author Comment

by:s_federici
Comment Utility
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.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
Comment Utility
Seems there is even no need to rewrite
http://www.google.com/search?q=flash+calendar
0
 
LVL 37

Expert Comment

by:CyanBlue
Comment Utility
Nope...  You've got to create your own within the Flash...

CyanBlue
0
 
LVL 10

Expert Comment

by:najh
Comment Utility
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.
0
 

Author Comment

by:s_federici
Comment Utility
Can I pleave have then a good reference URL? I looked for someone, but none of them were opensource and/or nice. Thanks.
0
 
LVL 10

Assisted Solution

by:najh
najh earned 166 total points
Comment Utility
Here's a thread about making a calendar:
http://www.kirupa.com/forum/showthread.php?t=49179


Alternatively you could use the built in component... (and if you don't like how it looks you could skin it)

Also found one here:
http://flashwanted.com/flash-swf/various/calendar.html
Doesn't look too pretty to me, but it should give you ideas.

There's quite a nice one here:
http://www.widgetbox.com/widget/flash-date-calendar-

this is a bit crazy: (click the calendar button though)
http://www.esnips.com/doc/c7b97aff-43a6-4440-9238-f09a770f0cd0/Clock-and-Calendar

there are loads of others out there - plus it'd be a doddle to make your own - even if you drew them out by hand and put them in a time line there are only a handful of possible calendar configurations:
31 days starting with mon, tue, wed....
30 days starting with mon, tue, wed...
29 days starting with mon, tue, wed....
28 days starting with mon, tue, wed...

So that's a maximum of 28 different month layouts. Put them all in a time line and select the appropriate one for the month you want. That way you don't even have to do any dynamic positioning of numbers etc.

0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now