Paul - I've knocked up a quick example of moving a masked movieclip which
contains textfields populated by xml data. It should work with any length
clue and demonstrates how to get a list of clues/textfields to autoscroll to
a position - and resizes the highlight to match height of clue textfield.
Just click on the numbers to get it to move.

It's not pretty and the code is a bit rough (and in AS2) - but it
demonstrates the principle. You may be well ahead of this by now - but I
fancied a fiddle!

You can grab it here. www.flowdigital.co.uk/download/crosswordclues.zip


Kev.


-----Original Message-----
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul Steven
Sent: 21 May 2009 08:44
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

Thanks Kerry

Yes I do have the "Advanced Lingo for Games" book that has a crossword
puzzle example which has proven very helpful for the main engine behind the
crossword. I also have "ActionScript 3.0 Game Programming University" but
that only has a word search.

My main problem is being able to highlight individual clues and ensure they
are visible within the scrollable area. I need to be able to put a highlight
over the entire clue (which can be one or more lines long). If I put all the
clues in one text field, the scrolling works fine - I am just not sure how
to determine how high the highlight should be - especially as this will
change if the text size is toggled. If someone clicks on a word on the
crossword, if the corresponding clue is not currently visible (due to the
need to scroll to get to it) I need to adjust the scroll to ensure this clue
is visible and then also highlight the clue. So I effectively need to know
what the scroll position is to display each clue and also how to determine
the top and bottom of this clue. The highlight will extend the entire width
of the clue text field so there is no need to work out widths.

Any suggestions most welcome.

Thanks

Paul





-----Original Message-----
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kerry
Thompson
Sent: 20 May 2009 20:11
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Advice on creating dynamic crossword cluesth
resize function

Paul Steven wrote:

> I am creating a crossword where the words and clues are read in from an
xml
> file. I need to be able to display the clues in a small area hence these
> will need to scroll. I also need to highlight a particular clue if the
word
> on the crossword is clicked. Problem is that some clues will be on more
than
> one line so I am not sure how best to approach this and would appreciate
> some advice. Also I need to include a function to toggle the text between
> small and large. Btw I am programming this in Flash 8 with AS2.<snip>
> Any advice on how best to deal with this would be really appreciated.

Gary Rosenzweig has a really good book, "Macromedia Flash MX ActionScript
for Fun and Games". I'm pretty sure it has the source for a crossword game
in it, and it's AS2. It's pretty cheap--around a dollar on Amazon. He also
has an updated book with AS3 code, "ActionScript 3.0 Game Programming
University".

I haven't used this book, but I did use a similar book he had for Director,
and I adapted his crossword code for the now defunct Learning Network. It's
pretty good code, and easy to adapt. My version might even still be up on
Family Education Network (www.fen.com). I haven't checked, but they
inherited everything from Learning Network.

Cordially,

Kerry Thompson

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to