Adobe Dreamweaver Forums



Last 10 THreads :         Re: IPhone (Last Post : MiLSaN99 - Replies : 0 - Views : 1 )           »          Re: IPhone (Last Post : MiLSaN99 - Replies : 0 - Views : 1 )           »          Re: IPhone (Last Post : MiLSaN99 - Replies : 0 - Views : 1 )           »          Re: IPhone (Last Post : MiLSaN99 - Replies : 0 - Views : 1 )           »          Pop up window using AS3 (Last Post : kglad - Replies : 2 - Views : 3 )           »          more about pop ups - epic fail (Last Post : retsnomrev - Replies : 0 - Views : 1 )           »          Custom cursor flickers like a short-circuiting LED. (Last Post : Chosin Won - Replies : 5 - Views : 7 )           »          can't get rid of the space at the top of my page! (Last Post : mixmasterdsr04 - Replies : 0 - Views : 1 )           »          CS4 - annoying help system (Last Post : Rothrock - Replies : 9 - Views : 10 )           »          My bullets dont work in my game >.< (Last Post : kglad - Replies : 1 - Views : 4 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Macromedia Software > Director > Lingo
 
Tags:



Reply
  #1 (permalink)  
Old 11-10-2008, 10:34 AM
temes
 
Posts: n/a
Diggs:
Default Continuous control of text sprite

I have a database project and database values are shown in text sprites.
However, empty entries in database are shown as "null" text in sprites, and I'd
like to remove that. Currently I have done that with enterframe function (which
checks the values in text sprites and removes "null" texts). It works, but the
"null" texts blinks for a second in the sprites before they're removed. Is
there a way that I could control text sprites all the time, and remove "null"
texts immediately?



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-10-2008, 12:54 PM
Rob Dillon
 
Posts: n/a
Diggs:
Default Re: Continuous control of text sprite's text

It sounds like you're testing for null after the text is updated. You want to find the place in your code where the new value from the DB is set into text. Test for null there.
Reply With Quote
  #3 (permalink)  
Old 11-10-2008, 12:54 PM
openspark
 
Posts: n/a
Diggs:
Default Re: Continuous control of text sprite's text

How, when and where does your code add the "null" entry to the text sprite?
That's the moment to check the value of the entry. Here's some pseudo-code:

if myDatabaseEntry = "null" then
myTextMember.text = ""
else
myTextMember.text = myDatabaseEntry
end if

Reply With Quote


  #4 (permalink)  
Old 11-18-2008, 01:54 PM
temes
 
Posts: n/a
Diggs:
Default Re: Continuous control of text sprite's text

The values are entered in enterframe and I can build the value checking to the
phase when the database value is put to the text member. I was just wondering
if there is some simple option, because I have 50 text sprites each with
separate "enter this database value to this sprite" code.

Reply With Quote
  #5 (permalink)  
Old 11-19-2008, 07:55 AM
Chunick
 
Posts: n/a
Diggs:
Default Re: Continuous control of text sprite's text

start learning about behaviors, scope, OOP programming and how Director handles
OOP, and then you'll see the benefits to attaching behaviors to sprites, parent
scripts and movie scripts. To note, the text property does not belong to the
sprite, but rather to the member so if you had a text member, created many
sprites on the stage from that member and changed the text in one of them then
that change will be reflected in all the text member's sprites.

The reason why a frame script is a bad idea (if you're using frame scripts or
even if you're using on enterframe handler in a behavior script) is that if you
looped on that frame or the playhead passed over that frame then the code would
be called again unless a conditional was put in place to control that... in
which case I would then think to myself there's probably a better way to do
this... the type of code you want to put in an on enterframe or frame script is
code that typically needs to be updated every frame such as moving a sprite on
the stage or changing it's colour, or checking the status of some sprite
property, for instance... what you want to use is a movie script or a parent
script with some behavior scripts attached to your text sprites as listeners...
so, your movie or parent script would do all the difficult database stuff and
then it would send the appropriate message and data to the text sprites.

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 07:07 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Cheap Car Insurance - Compare Motor Insurance
Endsleigh Car Insurance Natwest Car Insurance
More Than Car Insurance Norwich Union Car Insurance
Prudential Car Insurance Zurich Car Insurance
Inactive Reminders By Mished.co.uk