Jump to content
xisto Community
Sign in to follow this  
BlueInkAlchemist

Displaying Html In Flash Using ActionScript

Recommended Posts

Since ActionScript.org appears to be down, I'm going to annoy you all with more design questions. :)I know I can use the getURL and URLLoader classes to bring HTML content into Flash. But can these also be used if I only want to show part of an HTML page? For example, if the content I want to show is in a <div> tag, and that's all I want to show, how would I go about calling for that part of the HTML source?Thanks in advance...

Share this post


Link to post
Share on other sites

Using javascript, it's something like document.documentElement.innerHTML=document.getElementById('lolz').innerHTML (could be wrong though)I'm not sure how you'd integrate that into Flash though..But if you have the source as a string, can't you use indexOf and substr to get that? Or something...

Edited by Nabb (see edit history)

Share this post


Link to post
Share on other sites

I think it would be easier to make a php page to load the html page you want to, parse out everything except the contents in the div, and then have flash load your php page. Perhaps if you were a bit more specific I could whip up a php script to do this for you.

Share this post


Link to post
Share on other sites

I think it would be easier to make a php page to load the html page you want to, parse out everything except the contents in the div, and then have flash load your php page. Perhaps if you were a bit more specific I could whip up a php script to do this for you.

Basically, what I want to do is, within a Flash movie, when a navigation button is selected, a content area (a MovieClip more than likely) should be populated with formatted text from an outside page.

Also, this is going to be hosted on my domain which is currently held by Microsoft Office Live, meaning it's an ASP-based site. It'll be ASP wrapped around Flash, but still.
Edited by BlueInkAlchemist (see edit history)

Share this post


Link to post
Share on other sites

Well I'm not that familiar with ASP, but you should be able to do the same thing. Basically instead of having flash load that certain external page, have flash load an ASP page you created, which loads and parses the external page.

Share this post


Link to post
Share on other sites

Well I'm not that familiar with ASP, but you should be able to do the same thing. Basically instead of having flash load that certain external page, have flash load an ASP page you created, which loads and parses the external page.

What about XML? For example, within Flash, ActionScript will read the nodes of an XML file which contain external file names, corresponding variables, etc. On an event (a Mouse Click more than likely), the selected variable will load the corresponding external file in a content area. That's the rough idea.

Share this post


Link to post
Share on other sites

Well if you are planning to do it like that you would be better off using actionscript string parsing function such as split.

For example:

String cont;  //Or whatever the name of your content variable istemp=cont.split("<div>");temp2=temp[1].split("</div>");cont=temp2[0];

Share this post


Link to post
Share on other sites

Since ActionScript.org appears to be down, I'm going to annoy you all with more design questions. :)
I know I can use the getURL and URLLoader classes to bring HTML content into Flash. But can these also be used if I only want to show part of an HTML page? For example, if the content I want to show is in a <div> tag, and that's all I want to show, how would I go about calling for that part of the HTML source?

Thanks in advance...


How about flashprobe?
http://www.flashprobe.com/

Share this post


Link to post
Share on other sites

How about flashprobe?http://www.flashprobe.com/


BlueInkAlchemist is trying to get html into flash dynamically, not extract text and images from flash, which is what this tool seems to do. He would need to either have flash or some other server side script parse the html and have flash load the content when the swf is played.

Share this post


Link to post
Share on other sites

Well if you are planning to do it like that you would be better off using actionscript string parsing function such as split.
For example:

String cont;  //Or whatever the name of your content variable istemp=cont.split("<div>");temp2=temp[1].split("</div>");cont=temp2[0];

I'll have to try this out, see if it will preserve HTML text formatting when taken from the source page into Flash...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.