Ratings Button

SuperCard 4.5 & 4.6 projects (.zip archives only please).

Ratings Button

Postby JoeKoomen2011 » Thu Mar 07, 2013 6:07 am

SuperCard is great for databases/lists. I’ve made projects to track fictional characters in long book series, and comic characters for a role-playing game I run with my kids. My current project is a compilation of book reviews. On thing I added to it is a rating for each book reviewed. This project is just a snippet of the larger project that I thought I’d share, because I think it’s cool.

It’s just a graphic that you can click on to make a rating on a card, the same way the 5-star ratings work in iTunes.

The main script is in the button, and the rating is stored in a hidden background field (but you could keep it in a user property instead). I like to sort the cards based on the ‘rating’ field instead of the title so the I can progress from best to worst.

You can copy the graphic to any project and it will work as long as the hidden field goes with it (located off the right side of the card). The graphics for the stars are in the resources folder, but they can easily be imported into the resource fork of your project.

You’ll want to set the graphic and field in the ‘new card’ script of your project and there is also a line of script in the ‘open card’ script to reset the graphic as you move from card to card.

That’s about all you need.

Joe
Attachments
Ratings.zip
Button for adding 5-star ratings to your cards
(522.14 KiB) Downloaded 315 times
Joe Koomen
>> Random! ...Damn near killed 'em! <<
User avatar
JoeKoomen2011
 
Posts: 464
Joined: Thu Mar 12, 2009 1:38 pm

Re: Ratings Button

Postby Dan_Kelleher » Mon Mar 11, 2013 6:33 am

Hi Joe,
Thank you.
The project is a good example of how to access image data from a resource folder external to the project, as well as other neat stuff.

you mentioned,
"....a graphic that you can click on to make a rating on a card...."
and
"The main script is in the button..."

But I don't see a btn in the project or a way tp actually make a rating.
Did you intend that that be in this snippet of your larger project ?
I like it as is, just clarifying,
-Dan
Daniel.Kelleher@umassmed.edu
SC4.7.3 OSX 10.7.2 Mac Pro
User avatar
Dan_Kelleher
 
Posts: 438
Joined: Sun Jul 06, 2008 2:45 pm
Location: Worcester (wouster as in would) Massachusetts USA

Re: Ratings Button

Postby JoeKoomen2011 » Tue Mar 12, 2013 10:10 am

Sorry, the main script is in the Graphic itself, not a button. It works like a button with the mouseStillDown message.

If you run the project, clicking on the stars and dragging will highlight the stars as the mouse moves.
Joe Koomen
>> Random! ...Damn near killed 'em! <<
User avatar
JoeKoomen2011
 
Posts: 464
Joined: Thu Mar 12, 2009 1:38 pm

Re: Ratings Button

Postby Dan_Kelleher » Tue Mar 12, 2013 12:12 pm

Ah! Nice!
Very smooth. So all one needs is a NewCard mechanism of their choosing.
Thank you Joe.
Daniel.Kelleher@umassmed.edu
SC4.7.3 OSX 10.7.2 Mac Pro
User avatar
Dan_Kelleher
 
Posts: 438
Joined: Sun Jul 06, 2008 2:45 pm
Location: Worcester (wouster as in would) Massachusetts USA

Re: Ratings Button

Postby JoeKoomen2011 » Wed Mar 13, 2013 12:19 pm

New card and open card if the image is on the background (to update it from page to page). You could put the graphic on the card layer, but then there would need to be and image on each card which could greatly inflate the size of your project over time...
Joe Koomen
>> Random! ...Damn near killed 'em! <<
User avatar
JoeKoomen2011
 
Posts: 464
Joined: Thu Mar 12, 2009 1:38 pm

Re: Ratings Button

Postby Dan_Kelleher » Thu Mar 14, 2013 12:46 pm

Thank you Joe.
That's actually educational for me in particular because I don't think I've ever used SuperCard to build databases on a big "stack of Cards", although I realize that, for historical reasons, many people ("out there") think "that's what SC does".
-Dan
Daniel.Kelleher@umassmed.edu
SC4.7.3 OSX 10.7.2 Mac Pro
User avatar
Dan_Kelleher
 
Posts: 438
Joined: Sun Jul 06, 2008 2:45 pm
Location: Worcester (wouster as in would) Massachusetts USA

Re: Ratings Button

Postby JoeKoomen2011 » Fri Mar 15, 2013 11:26 am

Big Stacks of Cards is what I do most.I have lots of sort routines so I can do multiple sorts and output a short list of exactly what I want. SuperCard is really fast so this works out for me since it looks a lot nicer and is easier to work with than real databases.

For example, I have a project with 1035 cards for fictional characters in a book series that spans 21 novels. I can sort the project for characters appearing in volume 5 and then resort for females, and then sort again on occupation to find that there was 1 female cop mentioned in book 5.

Handy stuff for other projects too.
Joe Koomen
>> Random! ...Damn near killed 'em! <<
User avatar
JoeKoomen2011
 
Posts: 464
Joined: Thu Mar 12, 2009 1:38 pm


Return to Sample & Demo Projects

Who is online

Users browsing this forum: No registered users and 1 guest

cron