Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Supporting Technologies > HTML and JavaScript

Reply
 
Thread Tools Rate Thread Display Modes
Old 11-09-2006, 12:20 PM   #1
Billy T
Oops I did it again
 
Billy T's Avatar
 
Join Date: Oct 2001
Location: Melbourne
Posts: 8,579
Default convert styles to html tags

Hi all

I'm using a rich text editor ( http://www.kevinroth.com/rte/ ) in a cms I'm working on. It works well but it outputs inline styles which 'I think' won't work in Flash (which is where the text ends up) - could be wrong about this...

So, I'm looking for a way to convert

<span style="color: rgb(255, 0, 0);"> asdfv</span>asdv <span style="font-weight: bold; text-decoration: underline;">asdv</span>

into

<font color="#ff0000"> asdfv</font> asdv <u><b>asdv</b></u>

Anyone know of a function that will do this for me? Don't mind if its javascript, php or actionscript.

Alternatively, does anybody know of a good rich text editor that works on most browsers and has an option to output old school html tags? Or is there a way to get that first string to work in a flash html textfield?

Thanks in advance
__________________
Billy
Online Galleries
iPhone Safety App - iStaySafe
Free Flash Video Tutorials
Photo Website Template

Don't email or PM me questions...
Billy T is offline   Reply With Quote
Old 11-09-2006, 12:38 PM   #2
Cota
Super Moderator
 
Cota's Avatar
 
Join Date: Jul 2001
Location: NYC
Posts: 10,175
Default

I dont know of any off the top of my head, you might have to write a custom funtion in either javascript, php, or even AS to handle it. Flash wont read the span style. Most of the Rich Text Editors generate HTML that wont work in Flash.
__________________
Color Wars | (kul′ər wrs) n. - Open conflict between factions. www.theColorWars.com

cota - www.chadworkman.com | http://shavedplatypus.com
occupation: designer | flash developer | server-side developer (php, asp, mssql, mysql)
Cota is offline   Reply With Quote
Old 11-09-2006, 12:44 PM   #3
Billy T
Oops I did it again
 
Billy T's Avatar
 
Join Date: Oct 2001
Location: Melbourne
Posts: 8,579
Default

dagnammit!

oh well...

I have a flash text editor that uses some of josh dura's example hacked together with bits of my own. Its a little buggy but guess it will have to do.

Thanks for the reply
__________________
Billy
Online Galleries
iPhone Safety App - iStaySafe
Free Flash Video Tutorials
Photo Website Template

Don't email or PM me questions...
Billy T is offline   Reply With Quote
Old 11-09-2006, 12:46 PM   #4
Cota
Super Moderator
 
Cota's Avatar
 
Join Date: Jul 2001
Location: NYC
Posts: 10,175
Default

You could hack the RTE to change the output from spans to fonts. Just a matter of wading through lines upon lines of JS.
__________________
Color Wars | (kul′ər wrs) n. - Open conflict between factions. www.theColorWars.com

cota - www.chadworkman.com | http://shavedplatypus.com
occupation: designer | flash developer | server-side developer (php, asp, mssql, mysql)
Cota is offline   Reply With Quote
Old 11-10-2006, 12:32 PM   #5
Billy T
Oops I did it again
 
Billy T's Avatar
 
Join Date: Oct 2001
Location: Melbourne
Posts: 8,579
Default

unfortunately the RTE I'm using has compressed code - the original source code costs mullah

you're right though - that would probably be easier than trying to convert the tags after they have been created.

For now though, think I'll stick with the all Flash option - its working ok (just)

Thanks again

PS I often don't get new post notification from as.org...very strange...wonder if it has anything to do with the quick replies?
__________________
Billy
Online Galleries
iPhone Safety App - iStaySafe
Free Flash Video Tutorials
Photo Website Template

Don't email or PM me questions...
Billy T is offline   Reply With Quote
Old 11-10-2006, 12:45 PM   #6
Cota
Super Moderator
 
Cota's Avatar
 
Join Date: Jul 2001
Location: NYC
Posts: 10,175
Default

Have you looked into the FCKeditor. Its the one that I use most of the time.
__________________
Color Wars | (kul′ər wrs) n. - Open conflict between factions. www.theColorWars.com

cota - www.chadworkman.com | http://shavedplatypus.com
occupation: designer | flash developer | server-side developer (php, asp, mssql, mysql)
Cota is offline   Reply With Quote
Old 11-10-2006, 12:55 PM   #7
Billy T
Oops I did it again
 
Billy T's Avatar
 
Join Date: Oct 2001
Location: Melbourne
Posts: 8,579
Default

yeah I did a while back but then got side tracked by the other one which seemed to work in more browsers

Just had another look then though and it appears to be exactly what I need - ie uses <font> tags etc

Doesn't work in Safari at all but that's not too big a deal. Will have a good play with it again on Monday

Thanks again
__________________
Billy
Online Galleries
iPhone Safety App - iStaySafe
Free Flash Video Tutorials
Photo Website Template

Don't email or PM me questions...
Billy T is offline   Reply With Quote
Old 12-07-2006, 11:18 AM   #8
Billy T
Oops I did it again
 
Billy T's Avatar
 
Join Date: Oct 2001
Location: Melbourne
Posts: 8,579
Default

OK so I'm still going on this one

I took your advice and went back the fckeditor.

I've inserted it into my application and its working very nicely. Well it was anyway. I then upgraded my Firefox to version 2 (I'm on a mac) and suddenly the fckeditor slowed right down. Its loads fairly quickly and my text appears inside which I can manipulate with the controls but I can't type into it for about 30 seconds. Whats really strange is

a) the fckeditor examples on the homepage run just fine in firefox 2
b) I tried another html editor (tinyMCE) and I get the exact same delay before I can type into it

Its all very strange

I guess it could be something to do with my server but then why would it run fine before I upgraded to firefox v2?

Anyone got any ideas on this one?

Thanks
__________________
Billy
Online Galleries
iPhone Safety App - iStaySafe
Free Flash Video Tutorials
Photo Website Template

Don't email or PM me questions...
Billy T is offline   Reply With Quote
Old 12-07-2006, 11:29 AM   #9
Billy T
Oops I did it again
 
Billy T's Avatar
 
Join Date: Oct 2001
Location: Melbourne
Posts: 8,579
Default

just a follow up

I redownloaded an old version of firefox (the one before 1.5) and the fckeditor on my site works perfectly on that so it clearly has something to do with v2 of firefox


I've searched around and found no info on this problem
__________________
Billy
Online Galleries
iPhone Safety App - iStaySafe
Free Flash Video Tutorials
Photo Website Template

Don't email or PM me questions...
Billy T is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help HTMLtext - Stylesheet HTML tags aceadar ActionScript 2.0 6 08-23-2006 04:42 AM
insert html tags inside XML node emergency_pants ActionScript 2.0 8 07-07-2006 12:21 PM
textArea Html Default Tags LeahSmart Components 0 03-03-2006 11:14 AM
Inserting HTML tags using actionscript wout ActionScript 1.0 (and below) 3 08-17-2004 09:55 PM
use html tags, but not from text file mackmommy Other Flash General Questions 5 03-31-2003 01:56 PM


All times are GMT. The time now is 10:05 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.