Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function updatePuffleWidget()
- {
- trace("INTERFACE:updatePuffleWidget");
- var active_puffle_id = getActivePuffle();
- var swf_art_mc = PUFFLE_WIDGET.art_mc;
- var active_puffle = SHELL.getMyPuffleById(active_puffle_id);
- var hunger_swf_frame_step = Math.round(active_puffle.hunger / 10);
- var health_swf_frame_step = Math.round(active_puffle.health / 10);
- var rest_swf_frame_step = Math.round(active_puffle.rest / 10);
- var happy_value = active_puffle.happy;
- trace("puffle happy: " + active_puffle.happy + " puffle name: " + active_puffle.name);
- if(happy_value > 75)
- {
- var happy_swf_frame_step = 1;
- }
- else if(happy_value > 50)
- {
- happy_swf_frame_step = 2;
- }
- else if(happy_value > 25)
- {
- happy_swf_frame_step = 3;
- }
- else
- {
- happy_swf_frame_step = 4;
- }
- swf_art_mc.paper_mc.gotoAndStop(active_puffle.typeID + 1);
- swf_art_mc.paper_mc.art_mc.gotoAndStop(happy_swf_frame_step);
- swf_art_mc.name_txt.text = active_puffle.name;
- swf_art_mc.stats_mc.gotoAndStop(shell.getLocalizedFrame());
- swf_art_mc.stats_mc.hunger_mc.gotoAndStop(hunger_swf_frame_step);
- swf_art_mc.stats_mc.health_mc.gotoAndStop(health_swf_frame_step);
- swf_art_mc.stats_mc.rest_mc.gotoAndStop(rest_swf_frame_step);
- swf_art_mc.tab_btn.onRelease = openPuffleWidgetTab;
- swf_art_mc.play_btn.onRelease = function()
- {
- sendPufflePlay();
- closeHint();
- };
- swf_art_mc.play_btn.onRollOver = function()
- {
- showHint(this,"play_puffle_hint");
- };
- swf_art_mc.play_btn.onRollOut = closeHint;
- swf_art_mc.rest_btn.onRelease = function()
- {
- sendPuffleRest();
- closeHint();
- };
- swf_art_mc.rest_btn.onRollOver = function()
- {
- showHint(this,"rest_puffle_hint");
- };
- swf_art_mc.rest_btn.onRollOut = closeHint;
- swf_art_mc.feed_btn.onRelease = function()
- {
- openPuffleWidgetTab();
- closeHint();
- };
- swf_art_mc.feed_btn.onRollOver = function()
- {
- showHint(this,"feed_puffle_hint");
- };
- swf_art_mc.feed_btn.onRollOut = closeHint;
- swf_art_mc.walk_btn.onRelease = function()
- {
- sendPuffleWalk();
- closeHint();
- };
- swf_art_mc.walk_btn.onRollOver = function()
- {
- showHint(this,"walk_puffle_hint");
- };
- swf_art_mc.walk_btn.onRollOut = closeHint;
- swf_art_mc.close_btn.onRelease = closePuffleWidget;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement