Home  | Login  | Register  | Help  | Play 

RE: Flash Q&A Thread 4

 
Logged in as: Guest
  Printable Version
All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy >> RE: Flash Q&A Thread 4
Page 22 of 30«<2021222324>»
Forum Login
Message << Older Topic   Newer Topic >>
1/1/2008 12:16:55   
EragonZZZZ
Member

Wait do you want fade in or just plain typing?
AQ  Post #: 526
1/1/2008 12:26:54   
biG frend
Member

Plain typing.
AQ DF MQ  Post #: 527
1/1/2008 12:44:52   
EragonZZZZ
Member

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);

AQ  Post #: 528
1/1/2008 13:52:13   
Taerzik
Member

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.
Post #: 529
1/1/2008 14:08:06   
biG frend
Member

Wow thanks very much Eragon you've helped me very much
is there anyway to make a line brake though?
AQ DF MQ  Post #: 530
1/1/2008 14:16:33   
EragonZZZZ
Member

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
AQ  Post #: 531
1/1/2008 17:32:22   
flsg
Member

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
AQ  Post #: 532
1/1/2008 17:33:47   
biG frend
Member

Is there a way to make it change font/Size/Colour as well?
AQ DF MQ  Post #: 533
1/1/2008 18:30:48   
EragonZZZZ
Member

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
AQ  Post #: 534
1/1/2008 18:37:05   
biG frend
Member

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.
AQ DF MQ  Post #: 535
1/1/2008 20:45:13   
EragonZZZZ
Member

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);


AQ  Post #: 536
1/2/2008 9:23:57   
Taerzik
Member

!!!

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

< Message edited by Taerzik -- 1/2/2008 9:37:38 >
Post #: 537
1/2/2008 13:51:56   
flsg
Member

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
AQ  Post #: 538
1/2/2008 15:41:20   
EragonZZZZ
Member

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
AQ  Post #: 539
1/2/2008 15:47:15   
biG frend
Member

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.
AQ DF MQ  Post #: 540
1/3/2008 1:34:06   
Taerzik
Member

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.
Post #: 541
1/4/2008 14:43:56   
mathus the seconth
Member

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.
AQ  Post #: 542
1/4/2008 19:28:01   
EragonZZZZ
Member


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.
AQ  Post #: 543
1/5/2008 2:07:30   
mathus the seconth
Member


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.
AQ  Post #: 544
1/5/2008 2:14:31   
Sephiroth12
Member

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
AQ  Post #: 545
1/5/2008 3:16:24   
mathus the seconth
Member

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.

< Message edited by mathus the seconth -- 1/5/2008 4:25:29 >
AQ  Post #: 546
1/5/2008 4:16:34   
Taerzik
Member

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!

< Message edited by Taerzik -- 1/5/2008 4:18:03 >
Post #: 547
1/5/2008 4:19:13   
Sephiroth12
Member

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

_____________________________


"Don't believe in yourself. Believe in the me believing in you."
AQ  Post #: 548
1/5/2008 4:29:12   
mathus the seconth
Member

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.

< Message edited by mathus the seconth -- 1/5/2008 4:47:19 >
AQ  Post #: 549
1/5/2008 7:05:43   
Burning Raven
Member
 

I think you can only save as a flash 8 in CS3 sorry :(
but what do I know! I bet theres a way!
~Raven
AQ  Post #: 550
Page:   <<   < prev  20 21 [22] 23 24   next >   >>
All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy >> RE: Flash Q&A Thread 4
Page 22 of 30«<2021222324>»
Jump to:






Icon Legend
New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts




Forum Content Copyright © 2018 Artix Entertainment, LLC.

"AdventureQuest", "DragonFable", "MechQuest", "EpicDuel", "BattleOn.com", "AdventureQuest Worlds", "Artix Entertainment"
and all game character names are either trademarks or registered trademarks of Artix Entertainment, LLC. All rights are reserved.
PRIVACY POLICY


Forum Software © ASPPlayground.NET Advanced Edition