Flash CS3 - Flash CS4

Free tutorials and scripts for all.
Actionscript 3.0

import html and css

This is a discussion on import html and css within the advanced Actionscript 3.0 forums, part of the Flash CS3 eng category; Hi everyone I'm trying to import a html file and a css file into flash I have followed this ...


Go Back   Forum Flash CS3 Flash CS4 > English Forums > Flash CS3 eng > advanced Actionscript 3.0

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 13-09-08, 03:39
Junior Member
 
Join Date: Jan 2008
Posts: 16
Rep Power: 0
jamiewa is on a distinguished road
import html and css

Hi everyone

I'm trying to import a html file and a css file into flash

I have followed this guys tutorial

http://www.smithmediafusion.com/blog/?p=234

But I can't get it to work

Could someone show me how this could be achieved

I have attached a zip

Cheers

Jamie
Attached Files
File Type: zip Archive.zip (7.1 KB, 4 views)


Last edited by Onsitus; 16-09-08 at 06:00..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #2 (permalink)  
Old 13-09-08, 14:43
Junior Member
 
Join Date: Jan 2008
Posts: 16
Rep Power: 0
jamiewa is on a distinguished road
Re: import html and css

Hi Guy

I found this which works perfectly

//************************************************** **************************
// Copyright (C) 2005-2007 Adobe Systems Incorporated. All Rights Reserved.
// The following is Sample Code and is subject to all restrictions on such code
// as contained in the End User License Agreement accompanying this product.
//************************************************** **************************

import fl.controls.UIScrollBar;

var my_txt:TextField = new TextField();
my_txt.x = 16;
my_txt.y = 50;
my_txt.wordWrap = true;
my_txt.multiline = true;
my_txt.width = 280;
my_txt.height = 178;
my_txt.background = true;
my_txt.backgroundColor = 0xFFFFFF;
addChild(my_txt);

var my_sb:UIScrollBar = new UIScrollBar();
my_sb.x = my_txt.x + my_txt.width;
my_sb.y = my_txt.y;
my_sb.height = my_txt.height;
my_sb.scrollTarget = my_txt;
addChild(my_sb);

//Note: Download the TXT and CSS files to look at their structure. Use the URLs below.
//load text
function loadMyText():void {
var url:String = "http://www.helpexamples.com/flash/text/sampletext.txt";

var loadIt:URLLoader = new URLLoader();
loadIt.addEventListener(Event.COMPLETE, textCompleteHandler);
loadIt.load(new URLRequest(url));
}

function textCompleteHandler(event:Event):void {
var urlV:URLVariables = new URLVariables(event.currentTarget.data);
my_txt.condenseWhite = true;
my_txt.htmlText = urlV.content as String;
my_txt.styleSheet = myStyleSheet;
}

//apply stylesheet
var flash_css:URLLoader = new URLLoader();
flash_css.addEventListener(Event.COMPLETE, cssCompleteHandler);
flash_css.load(new URLRequest("http://www.helpexamples.com/flash/text/styles.css"));

var myStyleSheet:StyleSheet;

function cssCompleteHandler(event:Event):void {
myStyleSheet = new StyleSheet();
myStyleSheet.parseCSS(event.currentTarget.data);
my_txt.styleSheet = myStyleSheet;
loadMyText();
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Tags
css, html, import css html

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads

Thread Thread Starter Forum Replies Last Post
Flash CS3 import from photoshop cs to flash cs3 - image quality danmo Flash CS3 eng 0 10-10-08 11:30
XML and HTML Blusquare CSS | HTML 14 02-07-08 18:26
AIR su HTML kikk Actionscript 3.0 base 2 01-04-08 13:11
How to convert SWF to AVI with alpha channel and import in Premiere thunderfish Off Topics 5 11-03-08 08:14
leggere as3 esterno dal file.as (prob. import) ehijon Actionscript 3.0 base 1 01-03-08 19:36


All times are GMT. The time now is 21:32.


Powered by vBulletin versione 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC4
Forum SiteMap


FlepStudio
by Filippo Lughi
P.IVA 03605860406