Now save the file. Let's test the movie and see what we've got:
That's better. Just a one more tweak and then we're done (I was planning to cover adding images to text fields in this tutorial but I think that will have to wait for another day).
Our final tweak is to the xml document, so open it up and change the "snake" tags to this:
<span class='snake'>Snake style does not deal in humaneness,
it only deals with delivering quick, maiming or killing strikes.</span>
Remember that we defined snake as a class. We are now using it in the correct way, as a class attribute of another tag (in this case the span tag).
If we test our movie now and scroll down to the bottom this is what we'll see:
Our text about the snake style is now green, as specified by the snake class.
However, you should also note that the
following text about "dragon" style is on the same line.
Your first thought will probably be that we need to change display: inline; to display: block;, but actually that doesn't appear
to be the problem in this case; and nor does it appear to be connected with the order in which our newly
defined tags and snake-class appear in our kungfu.css file
Whilst you may expect display: inline; to force a break, <span> is not designed to be a 'breaking' tag like the <div> or <p> tags and the result is that your content will not begin on a new line.
You can swap the span tag for a paragraph tag if you do want to 'force' the new line, or alternatively don't use a class in situations like this, but instead use a newly created tag (ie as demonstrated with other tags in
this tutorial such as "drunken" and "monkey")
Well, that's all for this tutorial. I'd like to thank Tom Schreck for his suggestions regarding the tag-break problem. I hope this tute has answered some of the questions I'm hearing on the forums.
If you have any suggestions or comments about this or any of my tutorials you can email me at firstname.lastname@example.org and I will do my best to answer them.
Please note that due to the volume of Flash-related emails I get, I now prioritize emails related directly to the tutorials themselves. You may find answers to your questions already posted on Flash forums such as
actionscript.org and were-here.com
This, and other tutorials can be found on nwebb.co.uk