[Xerte] Re: AS3 Code doesn't work in Xerte?

Tom Reijnders reijnders at tor.nl
Fri Jul 1 15:56:15 BST 2011


If you really, really need AS3, than Xerte 3 is an option. But that is a 
bit of a different beast, (i.e. no templates yet)

Tom

Op 1-7-2011 14:11, Deborah Delin schreef:
> Hi,
>
> I may be duplicating one part of this plea - my previous post didn't 
> seem to come through.
>
> 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?
>
> This is the code:
>
> 1) To attach sound to a movie clip:
>
> /var snd:grey_rod= new grey_rod();
>
> //speaker_grey.addEventListener (MouseEvent.CLICK, soundbutton_Handler);
>
> //function soundbutton_Handler (e:MouseEvent):void {
> //snd.play();
>
> 2) for a drag and drop game:
>
> var objectoriginalX:Number;
> var objectoriginalY:Number;
>
> triangle_mc.buttonMode = true;
> triangle_mc.addEventListener(MouseEvent.MOUSE_DOWN,pickupObject);
> triangle_mc.addEventListener(MouseEvent.MOUSE_UP, dropObject);
>
> function pickupObject(event:MouseEvent):void {
>   event.target.startDrag(true);
>   event.target.parent.addChild(event.target);
>   objectoriginalX = event.target.x;
>   objectoriginalY = event.target.y;
>     response_txt.text = " "
> }
> function dropObject(event:MouseEvent):void {
>   event.target.stopDrag();
>   var matchingTargetName:String = "target" + event.target.name 
> <http://event.target.name>;
>   var matchingTarget:DisplayObject = getChildByName(matchingTargetName);
>   if (event.target.dropTarget != null && 
> event.target.dropTarget.parent == matchingTarget){
>    event.target.removeEventListener(MouseEvent.MOUSE_DOWN, pickupObject);
>    event.target.removeEventListener(MouseEvent.MOUSE_UP, dropObject);
>    event.target.buttonMode = false;
>    event.target.x = matchingTarget.x;
>    event.target.y = matchingTarget.y;
>     response_txt.text = "You did it!"
>   }else {
>    event.target.x = objectoriginalX;
>    event.target.y = objectoriginalY;
>     response_txt.text = "Try again"
>   }
> }
>
> Please help - why might Xerte not like this code?
>
> Deborah
>
>
> 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.
>
> 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.
>
>
> _______________________________________________
> Xerte mailing list
> Xerte at lists.nottingham.ac.uk
> http://lists.nottingham.ac.uk/mailman/listinfo/xerte
>
> 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.
>
> 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.
>
>    

-- 
--

Tom Reijnders
TOR Informatica
Chopinlaan 27
5242HM Rosmalen
Tel: 073 5226191
Fax: 073 5226196


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20110701/0e768e12/attachment-0001.html>


More information about the Xerte mailing list