PDA

View Full Version : MouseOver/Out Animation not completing!!?


Jacques
08-24-2006, 09:37 AM
G'Day!

[First post]

PLEASE HELP with this - the extract below creates a row of navigations links (navbar to be) with mouse rollover actions, which works fine IF you move your mouse fairly slowly. If you drag it across "quickly", some of the "buttons" will get stuck halfway trough the effect (random as far as I can tell).

Am I missing some clean up code to handle events no longer "in focus" or is this simply poorly coded (new to Laszlo) or what? (sure someone can sort this out for me in no time... ;-)

Laszlo 3.3.3 Flash Player 8&9

Thoughts please...

Thanks in advance
j

v START v
----------------------------------------------------
<canvas>

<class name="navbutton" width="80" height="30" onmouseover="msover()" onmouseout="msout()" onclick="click()">
<attribute name="lbl" type="string"/>
<attribute name="clr" type="color" value="0xFF8F8F"/>
<attribute name="trgt" type="string"/>
<method name="msover">
bg.msover.doStart();
</method>
<method name="msovertxt">
txt.setColor(white);
</method>
<method name="msout">
bg.msout.doStart();
</method>
<method name="msouttxt">
txt.setColor(gray);
</method>
<method name="click">
nav(this.trgt);
</method>

<view name="bg" width="${this.parent.width}" height="4" bgcolor="${this.parent.clr}" valign="bottom">
<animatorgroup name="msover" process="simultaneous" duration="400" start="false">
<animator name="msover1" attribute="height" to="30" duration="400" motion="easeout" start="false"/>
<animator name="msover2" attribute="opacity" from="0.1" to="1" duration="200" onstop="this.parent.parent.parent.msovertxt();" start="false"/>
</animatorgroup>
<animatorgroup name="msout" process="simultaneous" duration="800" start="false">
<animator name="msover1" attribute="height" to="4" duration="800" motion="easeout" start="false"/>
<animator name="msover2" attribute="opacity" from="1" to="1" duration="150" onstop="this.parent.parent.parent.msouttxt();" start="false"/>
</animatorgroup>
</view>

<text name="txt" text="${this.parent.lbl}" resize="true" fgcolor="gray" opacity="1" fontstyle="plain" align="center" valign="middle"></text>

</class>


<view id="top_cont" x="120" width="800" height="30">

<simplelayout axis="x" spacing="2"/>

<navbutton name="home" lbl="Home" clr="0xFF8F8F" trgt="home" />
<navbutton name="contact" lbl="Portfolio" clr="0xFF8F8F" trgt="contact" />
<navbutton name="faq" lbl="About me" clr="0xFF8F8F" trgt="faq" />
<navbutton name="contact1" lbl="Sessions" clr="0xFF8F8F" trgt="contact" />
<navbutton name="faq1" lbl="Prices" clr="0xFF8F8F" trgt="faq" />
<navbutton name="contact2" lbl="Contact" clr="0xFF8F8F" trgt="contact" />
<navbutton name="faq2" lbl="FAQ" clr="0xFF8F8F" trgt="faq" />

</view>

</canvas>
--------------------
^ END ^

tester1
09-19-2006, 11:49 AM
are u able to set color of font as white on mouseover?