Date: Mon, 14 Apr 1997 10:09:08 +0000 From: jbaker@mail.mailbox.co.uk (julian baker) http://www.mailbox.co.uk/flatearthThe forecolor property used on field cast members (say, combined with the random function) is great for shockwave movies except that it only works when the monitor is set to 256 colours (8 bit), higher bit depths produce only various shades of dark blue. (1 bit paint or quickdraw members don't suffer from this problem)
Please note that it is field cast members and not text cast members, text members are converted to 8 bit bitmaps in a projector or a shocked movie to allow for antialiasing, and are treated as such during run-time. If you try to change the forecolor of a text sprite nothing will happen - it's treated as 8bit. If you want to use lingo on 'text' (even if it's not user editable) make sure it's a field cast member. Furthermore applying more media specific lingo (ie fontSize or scrollByLine) to a text cast member a "Cast member not found" error occurs - a wrong media type error would be more helpful. Even though antialising is lost there are other advantages. A movie consisting of 20 text cast members containing "Hello World" after burning weighs in at 24k while the same movie using fields is 5k. The pay-off is speed, fields handle s-l-o-w-l-y.
Since the colordepth property is disabled in shockwave, and changing the monitor depth means restarting under windows or risking a crash on the mac with netscape, it poses a bit of a problem if the user hits your movie with a higher monitor depth.
The way round this is to use a field castmember containing a character set to the forecolor for each colour you wish to use, and then use these characters as a reference rather than setting the forecolor directly.
It's also useful if you want to reference particular sets of non-sequential colours. (This is easily achieved with a list under non-web conditions)
Example lingo is as follows: (take É to mean the continuation operator, sorry there's no html for it)
set the forecolor of member "name" to É
the forecolor of char (random(256)) of member "colourField"
In this example change "name" to the name of your field cast
member you want to affect (since we're affecting the cast member and not
the sprite there's no need to puppet), the random number to (the number
of chars in field "colourField") and lastly "colourField" to the name
of your field cast member containing the coloured text or it's cast number.
Since it's a bit of a pain generating each coloured character by hand why not automate the task with this script:
on ColourInTheNumbers
put "" into field "colourField"
repeat with i = 1 to 256
put "X" after field "colourField"
set the forecolor of char i of field "colourField" to (i-1)
end repeat
end
It will seem like your machines crashed - don't worry it just takes a
long time for Director to chug through this much text! Personally I
like to use a bullet point instead of "X", it doesn't matter what
character you use but once again there's no html for decent bullets.
Incidentally, you can use the forecolor property on 8 bit cast members to cause colour cycling on one particular sprite rather than the whole screen as the score option does, using this lingo:
set the forecolor of sprite n = the forecolor of sprite n + 1What actually happens is the palette is 'forced up' one so that colour 1 becomes colour 2 etc, and the sprite is remapped to the new colour scheme.
URL: