Author: ben
Date: 2007-07-08 11:28:42 -0700 (Sun, 08 Jul 2007)
New Revision: 5617

Modified:
   sandbox/ben/smush/main.lzx
   sandbox/ben/smush/resources.lzx
Log:
improving match/nomatch

Modified: sandbox/ben/smush/main.lzx
===================================================================
--- sandbox/ben/smush/main.lzx  2007-07-08 17:45:59 UTC (rev 5616)
+++ sandbox/ben/smush/main.lzx  2007-07-08 18:28:42 UTC (rev 5617)
@@ -68,7 +68,6 @@
                 var imageGuid = this.currentImageSelection.guid.text;
                 if (titleGuid == imageGuid) {
                   gResult.showResult(true); 
-                  this.reset();
                 } else {
                   gResult.showResult(false);
                 }
@@ -94,36 +93,34 @@
         
     </view>
     
-    <view id="floatview" bgcolor="0xb10db3"  visible="false" >
-        <view name="shadow" bgcolor="0x000000" x="2" y="2" 
width="${parent.width}" height="${parent.height}" opacity=".5" />
-        <view name="bg" bgcolor="red" width="${parent.width}" 
height="${parent.height}" />
-        <view name="image"  width="${parent.width-3}" 
height="${parent.height-3}" stretches="both"/>
+    <view id="floatview" visible="false" > <!-- bgcolor="0xb10db3" -->
+        <view name="shadow" bgcolor="0x000000" x="3" y="3" 
width="${parent.width}" height="${parent.height}" opacity=".5" />
+        <view name="image" width="${parent.width}" height="${parent.height}" 
stretches="both"/>
         <method name="setTarget" args="v" >
-            this.movingView = v; 
-            this.setX( v.getAttributeRelative('x',canvas) );
-            this.setY( v.getAttributeRelative('y',canvas) );
-            this.setWidth(v.width);
-            this.setHeight(v.height);  
-            this.image.setSource(v.urlText.text);
-            this.setVisible( true );
-            animSlide.doStart(); 
-        </method>     
-        <animatorgroup name="animSlide" start="false" process="simultaneous" >
-            <animator attribute="y" to="160" duration="1000" />             
-            <animator attribute="x" to="260" duration="1000" />                
         
-            <method event="onstop">
-                gDetails.showImage(floatview.movingView);               
-                floatview.setVisible(false);
-            </method>
+        this.movingView = v; 
+        this.setX( v.getAttributeRelative('x',canvas) );
+        this.setY( v.getAttributeRelative('y',canvas) );
+        this.setWidth(v.width);
+        this.setHeight(v.height); 
+        this.image.setSource(v.urlText.text);
+        this.setVisible( true );
+        animSlide.doStart(); 
+        </method> 
+        <animatorgroup name="animSlide" start="false" duration="500" 
process="simultaneous" >
+        <animator attribute="y" to="191" motion="easein" /> 
+        <animator attribute="x" to="245" motion="easeout" /> 
+        <method event="onstop">
+        gDetails.showImage(floatview.movingView); 
+        floatview.setVisible(false);
+        </method>
         </animatorgroup>
-        
+
         <method name="setColor" args="c" >
-            this.bg.setBGColor( c);
+        this.bg.setBGColor( c);
         </method>
     </view>
     
-    
-    <view id="gResult"  x="0" y="150" width="320" height="100"  >
+    <view id="gResult"  x="2" y="157" width="316" height="100"  >
         <attribute name="matched" value="false" type="boolean" />
         <method name="showResult" args="match">
             this.matched = match;
@@ -134,33 +131,40 @@
         </method>
         <method name="showMatch">
             this.nomatch.setVisible(false);            
-            this.txt.setText("match!");
+            this.capsule.txt.setText("MATCH");
             this.showResultAnim.doStart();
         </method>
         <method name="showMismatch">
             this.nomatch.setVisible(true);
-            this.txt.setText("no match");
+            this.capsule.txt.setText("NO MATCH");
             this.showResultAnim.doStart();
         </method>
         
-        <view name="film" width="$once{parent.width}" 
height="$once{parent.height}" bgcolor="0x000000" opacity="0" />
-        
-        <text name="txt" x="5" width="${parent.width-10}" fgcolor="0xFFFFFF" 
fontsize="48" />
+        <view name="film" width="${parent.width}" 
height="$once{parent.height}" bgcolor="0x000000" opacity="0"/>
+
+        <view name="capsule">
+            <view name="capsule" bgcolor="0xFFFFFF" x="100" y="25" width="113" 
height="37" />
+            <view name="capl" x="${parent.capsule.x - 14}" 
height="${parent.capsule.height}" y="25" resource="circle" />
+            <view name="capr" x="${parent.capsule.x + parent.capsule.width - 
19}" height="${parent.capsule.height}" y="25" resource="circle" />            
+            <text name="txt" x="110" y="27" width="${parent.width-10}" 
fontsize="22" />
+        </view>
         <!-- click to dismiss --> 
         <method event="onclick">
             this.hideResultAnim.doStart();
-            gMoreInfo.show();
+            if (this.matched) {
+                this.nomatch.setVisible(false);                
+                gDetails.reset();
+                gMoreInfo.show();
+            }
         </method>
         
         <animatorgroup name="showResultAnim" process="simultaneous" 
start="false">
             <animator            
-                attribute="opacity" to="1" start="false" duration="500" 
target="gResult.film"/>            
-            <method event="onstart">
-                parent.txt.setVisible(true);
-            </method>
-                
+                attribute="opacity" to="0.5" start="false" duration="200" 
target="gResult.film"/>            
+            <animator            
+                attribute="opacity" to="1" start="false" duration="200" 
target="gResult.capsule"/>            
+
             <method event="onstop">
-                parent.txt.setVisible(true);
                 if (!gResult.matched) {
                     gResult.hideResultAnim.doStart();
                 }
@@ -169,14 +173,17 @@
         
         <animatorgroup name="hideResultAnim" process="simultaneous" 
start="false">
             <animator            
-                attribute="opacity" to="0" start="false" duration="500" 
target="gResult.film"/>            
-            <method event="onstart">
-                parent.txt.setVisible(false);
-            </method>
+                attribute="opacity" to="0" start="false" duration="1000" 
target="gResult.film"/>            
+            <animator            
+                attribute="opacity" to="0" start="false" duration="1000" 
target="gResult.capsule"/>            
+                
         </animatorgroup>
         
-        <view id="gMismatch" name="nomatch" resource="nomatchicon" x="198" 
y="25" width="38" height="38"
-            visible="false" />
+        <view id="gMismatch" name="nomatch"  x="203" y="27" width="38" 
height="38"
+            visible="false" >
+            <view name="nmc" x="-7" resource="circle" height="38" width="38"/> 
           
+            <view name="nmi" resource="nomatchicon" y="6" height="38" 
width="38" /> 
+        </view>
     </view> 
     
     <view id="gMoreInfo" width="$once{parent.width}" 
height="$once{parent.height}" bgcolor="0x007700"

Modified: sandbox/ben/smush/resources.lzx
===================================================================
--- sandbox/ben/smush/resources.lzx     2007-07-08 17:45:59 UTC (rev 5616)
+++ sandbox/ben/smush/resources.lzx     2007-07-08 18:28:42 UTC (rev 5617)
@@ -1,6 +1,7 @@
 <library>
     <resource name="headerbkgnd" src="header-bkgnd.png" />
     <resource name="logo" src="logo.png" />
-    <resource name="nomatchicon" src="no-icon.png" />    
+    <resource name="nomatchicon" src="no-icon-8.png" />    
+    <resource name="circle" src="circle-white.png" />        
 </library>
 <!-- Copyright 2007 Laszlo Systems --> 


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to