PDA

View Full Version : what's the different?


vicky
04-09-2004, 11:32 AM
hi,
I just started to use flash mx 2004 and xml. I have read a lot of tutorials about this and know I'm wonder about all the way you could make textfields. some use ordinary dynamic textfields, some make movieclips with textfields in it, some make the textfiled with only script and some use the textarea component. Now I wonder what's the different and especially what's the best metod to use? I have a feeling that it is if you script it by yourself, but I wonder if it some limitation or advantage of some textfield?

I'm grateful for all the thougt you want to share

emergency_pants
04-13-2004, 06:05 AM
Vicky,

I tend to use the old standard dynamic textfields for most things. This allows you to easily reference the dynamic textfield to a variable.

I find the textArea component is best used for binding data from dataSets and Connectors, etc.

I tend not to script my textfields because I like to work as visually as possible. I'm a designer sort, you know. No doubt there are times when one method of creation is better than another (i.e. creating fields with scripting at runtime vs. drag n drop at authortime). I haven't found a need to script my textFields in yet. :) So that's a matter of need and/or personal preference, I guess.

Rossman
04-13-2004, 08:04 PM
As a followup question to the original:

Which is better to keep your file size smallest, creating text fields dynamically at run-time using actionscript, or placing a text field on the stage at design-time?

I am keen on keeping my final SWF as small as possible (as I'm sure we all are), and I was thinking if I just generate them as needed at run-time will this make a huge difference in file size or does the compiled actionscript embedded in the SWF take up about an equivalent amount of space?

Has anyone ever done any experiments to see which one is better overall? If not I might have to try some myself...

Thoughts and opinions welcome!

Thanks,
mark ;)

Rossman
04-13-2004, 08:22 PM
I just did a real quick and probably not very accurate test:

I created two FLA's, one which had two text fields placed on it statically at design time. I put the text "testing" in both fields, and gave them instance names (test1 and test2). I saved/compacted/published this. I got an SWF that was 140 bytes long.

I then created another FLA which has nothing on stage and entered the following lines to replicate what was in the static file:

_root.createTextField("test1", 10, 69, 37, 172, 21);
_root.createTextField("test2", 11, 68, 60, 172, 21);

test1.text = "testing";
test2.text = "testing";

This resulted in an SWF file that was 152 bytes. So very close but I think more experimentation needs to be done as this was quite limited and probably not indicative of real world behaviour.

Anyone with further information on this, I would greatly appreciate it if you could share your findings as well.

Cheers,
mark ;)

emergency_pants
04-14-2004, 04:28 AM
Interesting to see the test results. IMO, a text field is a text field... Whether you place it during design time or at runtime. It has very little size until you put some text in it. Judging from the test, the difference is fairly small, unless you intend to have very many fields.

If you have ALOT of text, you might want to do it at runtime, this way keeping the swf size down (no text in the swf file) But text isn't gonna make your swf too big and if you have all your text stored in a seperate file, like a txt file or xml, you still have to import it... which might actually make the screens populate slower (especially xml)..