Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 12-12-2006, 11:50 AM   #1
Flashger
Registered User
 
Join Date: Dec 2006
Posts: 3
Default WYSIWYG Text Editor i Flash With Image Upload

Hi Guys.
My first post here at the AS.org. -> been following along for some time.

I working on a WYSIWYG TextEditor i Flash, and it's more as an religiues state of mind that it has to be done in Flash. It's for our Danish Flash User Group, so "must be Flash"

Well I have worked out the TextEditor class okay, and it works as it should, with the basci functionalities, but I'm now trying to add "image upload" on the fly, so that one should be able to upload an image in the "blog editor" and the image will load right away. Kind of like the www.flashtexteditor.com thing.
BUT I have NO control of the images what so ever. What I would like is when an image loads up into the editor, the "I" -courser is set under the image. I have tried all kinds of things and ends up with text alon the side of the image, text under the image and alle kind of crazy things.
I have sat the hspace to 0 and the image width to the same as the input field to make sure that text should not be able to "get along" with the image

Right now i'm trying to work aroud text being able to get placed alon the side of the image, and to create a loader, by loader in a swf file, who using MovieClipLoader loads the image in.

But still i have to calculate "how big is this image" and then add like "<br />" tags according to the calculatet hight to get the "I" courser under the image, and ready for typing.

Is this just an imposible task, and should I surrender and get hold of html Editor to our blog system?

I know there isn't much "code" to take a look at, and that i might be very confusing as my english isn't to good, but I hope some one has an idea or suggestion of what could og should be tryied.

Code:
//---------------------------------------------------------------------------------------------------------------
	//							UPLOAD IMAGE FUNCTIONS: GIF PNG JPG
	//---------------------------------------------------------------------------------------------------------------
	private function uploadImage():Void
	{
		_editorText.htmlText += '<p><img width="'+Math.ceil(_editorText._width)+'" hspace="0" vspace="0" height="100" src="textImageLoader.swf"></p>';
		_editorText.htmlText +='<p>This is a new line</p>';
		setTextFocus(_editorText)
		
	}
This is what happens right now when you push the "UPLOAD IMAGE" button.
As you can see the image is set to the width of the textField, and therefor the "This is a new line" should appear UNDER the image... but dosn't

you can see the editor her http://www.dfug.dk/blog/opretBlog.html

Best Regards
Asger
From Denmark
Flashger is offline   Reply With Quote
Old 12-12-2006, 12:01 PM   #2
johnnyboy
JBOY
 
johnnyboy's Avatar
 
Join Date: Nov 2005
Location: Stockholm
Posts: 480
Send a message via MSN to johnnyboy
Default

Yo Flasger good to see u in the international forum

Did u consider using multiple txtfields instead of just one container. So instead of pushing the image into the existing txtfield, u cut of that txt field and create a new movieclip to contain the image, and when the size is registered, u create a new txtfield just under the image...

Flashforum.dk rules
__________________
/JBOY

www.f-i.com
johnnyboy is offline   Reply With Quote
Old 12-12-2006, 01:07 PM   #3
Flashger
Registered User
 
Join Date: Dec 2006
Posts: 3
Default

Hey JBOY!
Yeah I dont come out much

Could very much be a solution to split the blog up in different textFields, but I would of cause like to have just one field. especially when a user wants to edit the blog later on, it would be harder to get the html back into alot of different textFields.

It's a shame that flash don't support a little better control over html tags. Could it be posible to control the image from css to better spacing in the textfield?

@JBOY:
I'll See you later... are you coming to Århus next Wendsday?

Best Regards

Asger
Flashger is offline   Reply With Quote
Old 12-12-2006, 01:34 PM   #4
johnnyboy
JBOY
 
johnnyboy's Avatar
 
Join Date: Nov 2005
Location: Stockholm
Posts: 480
Send a message via MSN to johnnyboy
Default

u could just give the individual "blocks" a relative vertical placing, so anyone who would edit the existing posts, don't mess up the layout. But yes - one container for it all would be nice, but hard to achieve I think...

http://oddhammer.com/index.php/site/comments/images_in_the_text_field_or_textarea/

--> Yupp I'll be there
__________________
/JBOY

www.f-i.com
johnnyboy is offline   Reply With Quote
Old 12-14-2006, 12:53 PM   #5
Flashger
Registered User
 
Join Date: Dec 2006
Posts: 3
Default

A little update.
I did som working on the project and actually i feel that it can be done: loading images/swf's into a wysiwyg editor on the fly. I even made a ugly hack regarding the "get the curser under the image" thing... BUT there is ALWAY a snake in paradise!

I have created a swf which i'm loading in to the textField first, when the user uploads an image. This swf will do the loading of the jgp image indside the textfield, and show a loaderprogress. BUT when i'm trying to load image two something bad happens.. the first swf in the textfield gets reloaded. meening that each time a try to and another image to the textField all the other images is removed. I have of cause given the swf container a unique id, but it's dos not matter. Do I really have to have an unik file name for each swf loaded into a text field to prevent this from happening?

I'm about to give up

Take a look here..
www.dfug.dk/blog/opretBlog.html

There is three images, and they should get loaded in, one at the time, when you press the upload image btn.
Flashger 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 Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
User text resize feature in Flash LMacD ActionScript 2.0 12 09-17-2006 05:36 PM
Updating an image file after Flash reads It zuckie13 ActionScript 2.0 0 07-10-2006 06:40 PM
search a text file with flash rabid lemming ActionScript 1.0 (and below) 0 01-26-2004 06:25 PM
Flash MX seminar Tink ActionScript 1.0 (and below) 5 03-17-2002 04:41 AM


All times are GMT. The time now is 08:53 PM.

///
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.