<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Dave Burnett has already answered your question - you can't use AS3 with Xerte 2. It's AS2 only. If you're using pageTemplates you could use the New Window page to load your swf in a new chromeless window or obviously just link to it normally.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>HTH<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Ron<o:p></o:p></span></p><p class=MsoNormal><a name="_MailEndCompose"><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></a></p><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> xerte-bounces@lists.nottingham.ac.uk [mailto:xerte-bounces@lists.nottingham.ac.uk] <b>On Behalf Of </b>Deborah Delin<br><b>Sent:</b> 01 July 2011 13:11<br><b>To:</b> xerte@lists.nottingham.ac.uk<br><b>Subject:</b> [Xerte] AS3 Code doesn't work in Xerte?<o:p></o:p></span></p></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Hi,<br clear=all><o:p></o:p></p><div><p class=MsoNormal>I may be duplicating one part of this plea - my previous post didn't seem to come through.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I have to use Actionscript 3 for a particular exercise and the code, which works fine in the SWF, doesn't work in Xerte. Is there a problem with Xerte and AS3?<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>This is the code:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>1) To attach sound to a movie clip:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><div><p class=MsoNormal>/var snd:grey_rod= new grey_rod();<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>//speaker_grey.addEventListener (MouseEvent.CLICK, soundbutton_Handler);<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>//function soundbutton_Handler (e:MouseEvent):void {<o:p></o:p></p></div><div><p class=MsoNormal>//snd.play();<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>2) for a drag and drop game:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><div><p class=MsoNormal>var objectoriginalX:Number;<o:p></o:p></p></div><div><p class=MsoNormal>var objectoriginalY:Number; <o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>triangle_mc.buttonMode = true; <o:p></o:p></p></div><div><p class=MsoNormal>triangle_mc.addEventListener(MouseEvent.MOUSE_DOWN,pickupObject); <o:p></o:p></p></div><div><p class=MsoNormal>triangle_mc.addEventListener(MouseEvent.MOUSE_UP, dropObject);<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>function pickupObject(event:MouseEvent):void { <o:p></o:p></p></div><div><p class=MsoNormal> event.target.startDrag(true); <o:p></o:p></p></div><div><p class=MsoNormal> event.target.parent.addChild(event.target); <o:p></o:p></p></div><div><p class=MsoNormal> objectoriginalX = event.target.x; <o:p></o:p></p></div><div><p class=MsoNormal> objectoriginalY = event.target.y; <o:p></o:p></p></div><div><p class=MsoNormal> response_txt.text = " "<o:p></o:p></p></div><div><p class=MsoNormal>} <o:p></o:p></p></div><div><p class=MsoNormal>function dropObject(event:MouseEvent):void { <o:p></o:p></p></div><div><p class=MsoNormal> event.target.stopDrag(); <o:p></o:p></p></div><div><p class=MsoNormal> var matchingTargetName:String = "target" + <a href="http://event.target.name">event.target.name</a>; <o:p></o:p></p></div><div><p class=MsoNormal> var matchingTarget:DisplayObject = getChildByName(matchingTargetName); <o:p></o:p></p></div><div><p class=MsoNormal> if (event.target.dropTarget != null && event.target.dropTarget.parent == matchingTarget){ <o:p></o:p></p></div><div><p class=MsoNormal> event.target.removeEventListener(MouseEvent.MOUSE_DOWN, pickupObject); <o:p></o:p></p></div><div><p class=MsoNormal> event.target.removeEventListener(MouseEvent.MOUSE_UP, dropObject); <o:p></o:p></p></div><div><p class=MsoNormal> event.target.buttonMode = false; <o:p></o:p></p></div><div><p class=MsoNormal> event.target.x = matchingTarget.x; <o:p></o:p></p></div><div><p class=MsoNormal> event.target.y = matchingTarget.y;<o:p></o:p></p></div><div><p class=MsoNormal> response_txt.text = "You did it!"<o:p></o:p></p></div><div><p class=MsoNormal> }else { <o:p></o:p></p></div><div><p class=MsoNormal> event.target.x = objectoriginalX; <o:p></o:p></p></div><div><p class=MsoNormal> event.target.y = objectoriginalY; <o:p></o:p></p></div><div><p class=MsoNormal> response_txt.text = "Try again"<o:p></o:p></p></div><div><p class=MsoNormal> <o:p></o:p></p></div><div><p class=MsoNormal> }<o:p></o:p></p></div><div><p class=MsoNormal>}<o:p></o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Please help - why might Xerte not like this code?<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Deborah<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div></div></div><p class=MsoNormal><o:p> </o:p></p><p>This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. <o:p></o:p></p><p>This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. <o:p></o:p></p></div></body></html>