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
Solved

html/iframe in flash animation

Posted on 2004-09-24
7
457 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
  • 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
use of cookies and regulations 1 100
Problem to echo 6 109
How to get statistic's from a competitors website?! 1 112
Import data into excel from web page 10 101
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 …
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to how to record live broadcast.
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.

856 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