Copy link to clipboard
Copied
Hi Im new on this forum so apologies if this has been covered before.
Im using flash CS6 and AS3.
I have a 1 frame test that loads XML into a Dynamic text multiline box. The text box is set as HTML. I have added a UIScrollBar to scroll the text.
My issue is when I - Control > Test Movie > In Flash Professional everything works fine
When i - Control > Test Movie > In Browser the text fails to load and the scroll bar is useless.
Below is the AS and on the page is a txt box call about_txt and in the xml file there are <mcgtxt> tags.
var xml:XML;
var req:URLRequest = new URLRequest("PDHXML.xml");
var loader:URLLoader = new URLLoader();
function dataLoaded(event:Event):void
{
xml = new XML(loader.data);
about_txt.htmlText = xml.mcgtxt;
}
loader.addEventListener(Event.COMPLETE, dataLoaded);
loader.load(req);
I have looked round the web for possible solutions and not sure if Dynamic txt and UIScrollBar was never going to work or the xml file is not being loaded when previewed in the browser event though its in the same folder as the html/swf files.
I have used xml as the user will edit the xml to change txt but more importantly change hyperlink destinations contained in the text.
Any help will be appreciated.
apply validateNow() to your scrollbar instance after htmlText is assigned in dataLoaded()
Copy link to clipboard
Copied
attach a screenshot of the directory that contains your swf and embedding html on your server.
Copy link to clipboard
Copied
Screen Shot as requested
Copy link to clipboard
Copied
show the files on your server, not on you local computer.
Copy link to clipboard
Copied
Hi
Screen shot attached - 1 server files - 2 resulting page - the text does load from xml just the scroll bar that does not work (there is enough txt to force the scrollbar)


Copy link to clipboard
Copied
apply validateNow() to your scrollbar instance after htmlText is assigned in dataLoaded()
Copy link to clipboard
Copied
Many Thanks for your help - worked well. Thanks
Copy link to clipboard
Copied
you're welcome.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more