<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Animate draw objects?</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1597" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=437152815-31082007><FONT face=Arial
color=#0000ff size=2>Thanks, Julian.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=437152815-31082007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=437152815-31082007><FONT face=Arial
color=#0000ff size=2>I was close: the object rb2 is referring to an
empty graphic icon, my use of createEmptyMovieClip seemed to be the problem.
When I removed that, along with the object name it created, the code I was using
worked.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=437152815-31082007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=437152815-31082007><FONT face=Arial
color=#0000ff size=2>Paul</FONT></SPAN></DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> xerte-bounces@lists.nottingham.ac.uk
[mailto:xerte-bounces@lists.nottingham.ac.uk] <B>On Behalf Of </B>Tenney
Julian<BR><B>Sent:</B> Friday, August 31, 2007 12:08 AM<BR><B>To:</B> Xerte
discussion list<BR><B>Subject:</B> RE: [Xerte] Animate draw
objects?<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr align=left><SPAN class=572190107-31082007><FONT face=Verdana
color=#0000ff size=2>You need to draw into an icon, and then animate the icon
you draw into. animate is a method of the ICON class that all icons inherit
from. ICON itself inherits from MovieClip.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=572190107-31082007><FONT face=Verdana
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=572190107-31082007><FONT face=Verdana
color=#0000ff size=2>So, add an empty graphic to a page, give it an ID, say
myIcon.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=572190107-31082007><FONT face=Verdana
color=#0000ff size=2>In script under the graphic, use the ID to draw into the
icon:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=572190107-31082007><FONT face=Verdana
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=572190107-31082007><FONT face=Verdana
color=#0000ff size=2>myIcon.beginFill(0xFF0000,100);</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=572190107-31082007><FONT face=Verdana
color=#0000ff size=2>myIcon.drawRect(0,0,100,100);</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=572190107-31082007><FONT face=Verdana
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=572190107-31082007><FONT face=Verdana
color=#0000ff size=2>then you can animate it:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=572190107-31082007><FONT face=Verdana
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=572190107-31082007><FONT face=Verdana
color=#0000ff
size=2>myIcon.animate(300,300,10,'linearTween');</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=572190107-31082007><FONT face=Verdana
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=572190107-31082007><FONT face=Verdana
color=#0000ff size=2>Julian</FONT></SPAN></DIV><BR>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> xerte-bounces@lists.nottingham.ac.uk
[mailto:xerte-bounces@lists.nottingham.ac.uk] <B>On Behalf Of </B>Paul
Swanson<BR><B>Sent:</B> 30 August 2007 23:26<BR><B>To:</B> Xerte discussion
list<BR><B>Subject:</B> [Xerte] Animate draw objects?<BR></FONT><BR></DIV>
<DIV></DIV><!-- Converted from text/rtf format --><BR>
<P><FONT face=Arial size=2>Is there a way to animate an object created with
the drawRect() method? If I draw a box with:</FONT> </P>
<P><FONT face=Arial size=2>rb2.createEmptyMovieClip("red_box", 0);</FONT>
<BR><FONT face=Arial size=2>rb2.red_box.lineStyle(2, 0xFF0000, 80);</FONT>
<BR><FONT face=Arial size=2>rb2.red_box.drawRect(190, 42, 170, 19,
0);</FONT> </P>
<P><FONT face=Arial size=2>… I would expect that rb2.red_box.animate(190,
62, 10, 'linearTween'); would work, but it doesn't. The box is created, but
doesn't animate. animate() works fine moving the contents of a text icon
around.</FONT></P>
<P><FONT face=Arial size=2>Not a big deal, just wondering if there is a way
...</FONT> </P>
<P><FONT face="Courier New" color=#808080
size=2>_____________________________</FONT> </P>
<P><FONT face="Courier New" color=#808080 size=2><B> Paul
Swanson</B></FONT> <BR><FONT face="Courier New" color=#808080
size=2> Instructional Designer</FONT> <BR><FONT face="Courier New"
color=#808080 size=2> Harland Financial Solutions</FONT> <BR><FONT
face="Courier New" color=#808080 size=2>_____________________________</FONT>
</P></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>