RE: Flash Q&A Thread 4 (Full Version)

All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy



Message


EragonZZZZ -> RE: Flash Q&A Thread 4 (1/1/2008 12:16:55)

Wait do you want fade in or just plain typing?




biG frend -> RE: Flash Q&A Thread 4 (1/1/2008 12:26:54)

Plain typing.




EragonZZZZ -> RE: Flash Q&A Thread 4 (1/1/2008 12:44:52)

Done.
This code goes on the main timeline.
Imageshack seems to think this is malicious code so I can't upload an example

var Message:String = "Your message goes here";
var typeInterval:Number = 1000; // How many milliseconds between text appearing
var letterPointer:Number = 0;
txtField.autoSize = true; // txtField is the name of the textbox I drew on the stage.


function addLetters()
{
	txtField.text = txtField.text + Message.charAt(letterPointer);
	letterPointer++;
	
	if(letterPointer >= Message.length)
	{
		clearInterval(Interval);
	}
}

var Interval:Number = setInterval(this,"addLetters",typeInterval);





Taerzik -> RE: Flash Q&A Thread 4 (1/1/2008 13:52:13)

Alright, simple problem but, here it is, how do I get a text box to display a scrollbar? It's a multi-user app with chat and the chat box needs to scroll. From what I can tell I need to incorporate a commponent, but... I don't know how.




biG frend -> RE: Flash Q&A Thread 4 (1/1/2008 14:08:06)

Wow thanks very much Eragon you've helped me very much
is there anyway to make a line brake though?




EragonZZZZ -> RE: Flash Q&A Thread 4 (1/1/2008 14:16:33)

Like

That ^

Like make a blank line in between?

just put \n anywhere in the quote where you want a line break.
MAKE SURE ITS INSIDE THE STRING:
like

var Message:String = "OMG THERE'S A LINE \n BREAK"
makes it print:
OMG THERE'S A LINE
BREAK




flsg -> RE: Flash Q&A Thread 4 (1/1/2008 17:32:22)

dam it, I should be th eone giving that code, just wanted to wait until big frend asks >_<
Taerzik: use the flash build-in component, there's a scrollbar in it




biG frend -> RE: Flash Q&A Thread 4 (1/1/2008 17:33:47)

Is there a way to make it change font/Size/Colour as well?




EragonZZZZ -> RE: Flash Q&A Thread 4 (1/1/2008 18:30:48)

As you're inputting the letters or before they're input?
Either way, I'll be nice and let flsg take that one :D
ahahahah




biG frend -> RE: Flash Q&A Thread 4 (1/1/2008 18:37:05)

Like Say I want the Title to be Size 4 Bold But the Rest of the text after a linebrake or whatever too be a Different colour/Size/Font and Type.




EragonZZZZ -> RE: Flash Q&A Thread 4 (1/1/2008 20:45:13)

The only reason I'm giving you this code constantly is because it's fun. :D
And I'm technically affiliated with the project too xD

var Message:String = "OMG The letterz are typing themselves on the screen! And they're in color!";
var typeInterval:Number = 50;
var letterPointer:Number = 0;
txtField.autoSize = true;

var format:TextFormat = new TextFormat();
format.color = 0xFF0000; //color you want
format.bold = true; //true for bold, false for no bold
format.italic = true; // true for italic, false for no italic
format.underline = true; // true for underline, false for no underline
format.size = 12; // size you want to change to
format.font = "Tahoma"; // font you want to change to

var shiftPosition = 52;

function addLetters()
{
	txtField.text = txtField.text + Message.charAt(letterPointer);
	letterPointer++;
	
	txtField.setTextFormat(shiftPosition,Message.length,format);
	
	if(letterPointer >= Message.length)
	{
		clearInterval(Interval);
	}
}

var Interval:Number = setInterval(this,"addLetters",typeInterval);






Taerzik -> RE: Flash Q&A Thread 4 (1/2/2008 9:23:57)

[:D]!!!

Ok, it's not a fixed chat box, but it's still a big improvemnt... no more walking of the edge off the map! I added that code and the code for impassable tiles early this morning. I've done the tests and it looks to be all working. (Except that I still don't know if anyone can actually reach the game server [8|]). I'm going to alter my sig. to my syte advertisement and it'll take you to it if you click on it. So, if anyone wants to try it out... be my guest, just click the sig banner below. Once at the syte, click the half-moon icon. Feel free to leave commentary in the syte forum or drop me an e-mail... or just comment here.

Next objective - working chatbox. (Note, it IS working BUT it only does so for 5 lines and then ... no more chatter. I have to add the scrollbar still. sorry.)




flsg -> RE: Flash Q&A Thread 4 (1/2/2008 13:51:56)

eragon: XD
wouldn't it be easier to set the textto htmltext? This way just use html code to change the size, color and the font




EragonZZZZ -> RE: Flash Q&A Thread 4 (1/2/2008 15:41:20)

lol that is true but I wasn't aware of that capability having just taught myself to do this sort of texty stuff.
Actually I learned it as I made it...because he asked how to do it xD

Gotta love my learning style 0_o




biG frend -> RE: Flash Q&A Thread 4 (1/2/2008 15:47:15)

Well thanks much both of you, I'll try both ways and see whats the easiest and most efficient way. You've helped me a great deal :D.




Taerzik -> RE: Flash Q&A Thread 4 (1/3/2008 1:34:06)

Alright, can someone tell me how to get a scroll bar to move to it's maximum position whenever a new item is added to it's target object? Thanks.




mathus the seconth -> RE: Flash Q&A Thread 4 (1/4/2008 14:43:56)

I improved the turn-based battle engine, and created a much neater one. It has a couple more things, and improvements that the tutorial does not provide. the swf is here, and the .fla is here. I would love to see what modifications people do to this to make it better.




EragonZZZZ -> RE: Flash Q&A Thread 4 (1/4/2008 19:28:01)


quote:

ORIGINAL: mathus the seconth

I improved the turn-based battle engine, and created a much neater one. It has a couple more things, and improvements that the tutorial does not provide. the swf is here, and the .fla is here. I would love to see what modifications people do to this to make it better.


Welcome back, sir, from your post history you've been gone a LONG time.




mathus the seconth -> RE: Flash Q&A Thread 4 (1/5/2008 2:07:30)


quote:

ORIGINAL: EragonZZZZ


quote:

ORIGINAL: mathus the seconth

I improved the turn-based battle engine, and created a much neater one. It has a couple more things, and improvements that the tutorial does not provide. the swf is here, and the .fla is here. I would love to see what modifications people do to this to make it better.


Welcome back, sir, from your post history you've been gone a LONG time.


Thank you. Yes, It's been a VERY long time, but I'm back! So what did you think of my modified battle system? I did it in AS2 because I cant find any decent AS3 video tutorials. It seems much harder than AS2, but I really want to learn it.




Sephiroth12 -> RE: Flash Q&A Thread 4 (1/5/2008 2:14:31)

Lol well, I'm stumped when it comes to battles :P I tried downloading the battle mathus just posted but it said unexpected file format :( And the tut dosn't help either... :( And how do you make the empty dynamic text actually show your hp...? Besides giving it the instance of HP and then adding _root.HP = 100; ... I NEED HELP!!! T.T lol




mathus the seconth -> RE: Flash Q&A Thread 4 (1/5/2008 3:16:24)

Well, what version of flash are you using? I'm pretty sure it even works with AS1.

EDIT: I made a new version. I corrected a bug or two in this version.
Flash-8 friendly download here.

Let me know if this works for you, Sephiroth.

Also, it is a little of a bad habit to use _root, Rather than this
So instead of using _root.HP = 100; Try using this.HP = 100;
If you are presented with a case in which you are not in scene1, then that is when you may use _root.

I learnt this a long time ago when I had Flash MX. I have seen several tutorial sites recommending this method, because it makes your code cleaner, without _ here, and _ there, and all over the place.




Taerzik -> RE: Flash Q&A Thread 4 (1/5/2008 4:16:34)

Ok, sorry to disrupt things agian here but I'd appreciate it if some of you kind folks would do a little testing for me.

Please follow this link: -> LINK <-

It should take you directly to my flash file (without the website). When the file loads it will say "connecting..." at first, after a moment or three it should switch over to a sign-in, just type in a name and go. Controls are your arrow keys. The chat isn't yet working but up to 5 lines of text will be readable. That's all assuming that you don't get a page error and that you can actually connect.

Anyway, please ley me know what happens (or doesn't happen). Thanks!




Sephiroth12 -> RE: Flash Q&A Thread 4 (1/5/2008 4:19:13)

I'm using MX, but it said the same for another file in MX that I've downloaded before... :P




mathus the seconth -> RE: Flash Q&A Thread 4 (1/5/2008 4:29:12)

In fact... here is something I found about avoiding _root:

quote:

Avoiding _root

There are several ways to target instances that let you avoid using _root; these are discussed later in this section. Avoid using _root in ActionScript because it can cause SWF files that load into other SWF files to not work correctly. The _root identifier targets the base SWF file that is loading, not the SWF file using relative addressing instead of _root. This issue limits code portability in SWF files that are loaded into another file, and, particularly, in components and movie clips. You can help resolve problems using _lockroot, but only use _lockroot when necessary (such as when you are loading a SWF file but do not have access to the FLA file). For more information on using _lockroot, see Using _lockroot.

Use this, this._parent, or _parent keywords rather than _root, depending on where your ActionScript is located. The following example shows relative addressing:

myClip_mc.onRelease = function() {
trace(this._parent.myButton_btn._x);
};

All variables must be scoped, except for variables that are function parameters and local variables. Scope variables relative to their current path whenever possible, using relative addressing, such as the this keyword. For more information on using the this keyword, see this in Flash ActionScript Language Reference.


Taerzik: It just says "Connecting..." and nothing.

Also... Does anybody know how to save an fla as Flash MX in CS3? Thanks.




Burning Raven -> RE: Flash Q&A Thread 4 (1/5/2008 7:05:43)

I think you can only save as a flash 8 in CS3 sorry :(
but what do I know! I bet theres a way!
~Raven




Page: <<   < prev  20 21 [22] 23 24   next >   >>

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition
0.140625