1 Reply Latest reply on Apr 10, 2007 4:27 AM by MotionMaker

    Loading HTML view

    Heros_Darkness
      Hi, I was trying to load a webpage within a swf and was wondering if anyone has any idea on how to do this and if its possible. So lets say I have a swf file with links to the left, and just some title text at the top. Then on the rest of the area showing a webpage from within a textbox, movieclip, or something. I have gotten txt files to load from a dynamic text box called "textview". I have attached the code I used to load a txt file. Note: The txt file and swf must be in the same directory to work.
      So with this said, CLICK HERE to see what I mean layout wise about the webpage in a swf.
        • 1. Re: Loading HTML view
          MotionMaker Level 1
          Generally you use LoadVars.load or XML.load to dynamically retrieve data for a Flash TextField.

          However before you deal with that you will find limitations to using a TextField to display a web page. Or better said you cannot replicate the layout of HTML inside of a TextField so avoid the frustration. Generally a Textfield in Flash is be suited for text and formatting can be maximized with CSS styles.
          See: StyleSheet AS Class.
          See:
          Formatting text with Cascading Style Sheet styles

          However the overall goal to make a Flash movie work like a web site is fine.

          A plan you should consider is to have a shell movie contain the buttons, title and other page common items, functionality and code.
          Then use MovieClip.loadMovie or MovieClipLoader to load in page Flash movies that will contain the pages. A good plan is to create 'template" Flash movies for the types of pages and have them separately load their page specific data that is not hardwired into the Movie.

          A MovieClip.loadMovie simple example can be seen MovieClip and LoadMovie To Load Page Movies.

          It lakes the sophistication of page buffering and will not handle timing issues of knowing when the page is loaded so other functions could occur, but is the basic place to start the research so you can formulate more questions to meet your goals.