Solved

html/iframe in flash animation

Posted on 2004-09-24
7
461 Views
Last Modified: 2013-11-19
I'm making a website, and i have a flash template. Right now when you click on the navigation buttons, it loads some text to the right. But i want it to load an html file, so that I can just edit the html file and upload it without having to redo the flash animation and upload it every time i update my site. I would like to be able to add images in the html, and maybe some basic formatting.
By the way, I haven't used flash in a while, so i guess im a n00b again.

Thanks
0
Comment
Question by:tweaq
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 6

Accepted Solution

by:
hsmtp earned 250 total points
ID: 12149730
First of all, make your HTML file in standarts of XHTML, so it will be totally clear as XML.
Then you'll need to use UTF-8 encoding.

And then just create dynamic texfield on the stage, name it somehow, f.i. "theText".

Add DataBinding Classes to your library (Window -> Other Pannels -> Common Libraries -> Classes)

And use this AS:

import mx.xpath.XPathAPI;

txt = new XML();
txt.ignoreWhite = true;
txt.load("index.html");

txt.onLoad = function () {
      path = "/html/body";
      tempXML = mx.xpath.XPathAPI.selectNodeList(txt.firstChild, path);

      for (i=0; i<tempXML[0].childNodes.length; i++) {
            _root.theText.htmlText += tempXML[0].childNodes[i];
      }
}

And here it is - your html inside textfield. Don't forget to turn on the textfield option "render text as HTML".

Additionally you may apply CSS to this textfield.
0
 
LVL 1

Author Comment

by:tweaq
ID: 12152438
Ok, i added the databinding classes, and put the action script on it. i named the dynamic textfield to theText, and set render as html. i changed the html to mine (news.html). and i made it xhtml (not sure how to do the UTF-8 encoding). and i have the html in the same place as the flash. when i test the movie, it gives me 5 errors, and it plays the movie, but it doesn't show any text and it shows the databinding classes icon.

here are the errors
**Error** Symbol=info, layer=info, frame=21:Line 1: Syntax error.
     import mx.xpath.XPathAPI;

**Error** Symbol=info, layer=info, frame=21:Line 3: Statement must appear within on/onClipEvent handler
     txt = new XML();

**Error** Symbol=info, layer=info, frame=21:Line 4: Statement must appear within on/onClipEvent handler
     txt.ignoreWhite = true;

**Error** Symbol=info, layer=info, frame=21:Line 5: Statement must appear within on/onClipEvent handler
     txt.load("news.html");

**Error** Symbol=info, layer=info, frame=21:Line 7: Statement must appear within on/onClipEvent handler
     txt.onLoad = function () {

Total ActionScript Errors: 5        Reported Errors: 5

0
 
LVL 6

Expert Comment

by:hsmtp
ID: 12156731
You need to put this AS not in the Symbol, but in the frame.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Expert Comment

by:hsmtp
ID: 12156736
Damn, looks like you're using Flash 6.
Could you switch to Flash MX 2004? Because it provides good html support in textfields.
0
 
LVL 1

Author Comment

by:tweaq
ID: 12163980
ok, i'll try, and i do have flash mx
0
 
LVL 1

Author Comment

by:tweaq
ID: 12164106
well i got it down to 1 error: import mx.xpath.XPathAPI;
but im going to use just the menu as flash, but thanks though, and i'll give you the points
0
 
LVL 6

Expert Comment

by:hsmtp
ID: 12167607
It's possible not to use x-path at all. If you will have html file started from <body> tag (without <html> and <head> tags) then you will be able to use common XML parsing methods.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
recommended CMS for the website revamp 3 99
Build and evolve an interactive experience 1 99
2012 Domain With 350 Machines All Running Windows 7 7 139
cookies analysis tools 2 108
Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
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.

696 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