Multitouch with movieclip on stage

Hello:
Is possible to rotate, zoom,etc with multitouch class using a movieclip on stage?
I have put this code, but not response at all, can you tell me what I do wrong? thank you:
import flash.display.StageDisplayState;
import flash.display.StageScaleMode;
import flash.display.StageAlign;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.display.Sprite;
import flash.events.TransformGestureEvent;
import flash.ui.Multitouch;
import flash.ui.MultitouchInputMode;
Multitouch.inputMode = MultitouchInputMode.GESTURE;
afoto.addEventListener(TransformGestureEvent.GESTURE_ROTATE , onRotate);
function onRotate (e:TransformGestureEvent):void{
              myImage_mc.rotation += e.rotation;
My movieclip  myImage_mc is on the stage.

Excuse me I made a mistake, this is the code:
import flash.display.StageDisplayState;
import flash.display.StageScaleMode;
import flash.display.StageAlign;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.display.Sprite;
import flash.events.TransformGestureEvent;
import flash.ui.Multitouch;
import flash.ui.MultitouchInputMode;
Multitouch.inputMode = MultitouchInputMode.GESTURE;
myImage_mc.addEventListener(TransformGestureEvent.GESTURE_ROTATE , onRotate); 
function onRotate (e:TransformGestureEvent):void{
              myImage_mc.rotation += e.rotation;

Similar Messages

  • Using modular functions with movieclips

    hi guys, this morning i was looking a tutorial that shows how to make modular functions, the user only used numbers, i was wandering if there is a way to use this with movieclips or childs.
    The example was:
    function addNumber(num1:Number,  num2:Number,  num3:Number):void
    trace(num1+num2*num3);
    addNumber(3, 4, 7);
    i tried using a movieclip called cuadro and triying to move on the x axis, but it didnt work out:
    function mObj(obj1:MovieClip,  num1:Number):void
    obj1.x = num1;
    addNumber(cuadro, 50);
    any sugestion?
    thnks in advance

    oh sorry my bad, i was trying another stuff
    i know that the last line must say
    mObj(cuadro, 50);
    what im trying to do is use the function with some objects in the stage, and for example when i press the first button, it will write mObj(cuadro1, 50) , button2  mObj(cuadro2, 80), so i can use the same function for diferents objects

  • Stop all movieclips on stage and it's nested movieclips

    Looking for a way to stop all movieclips both are the stage and that are children of the ones on the stage.
    I toyed with looping thru stage's children so I can first target clips on the stage. But I am getting error. Any help?
    for (var i:int = 0; i < this.numChildren; i++)
         if (this.getChildAt(i) is MovieClip)
                        this.getChildAt(i).stop

    You will get a different error if that was just a typo... a 1119 is a property error, a 1061 is a method error, which is what you should have been getting if you just had a typo in your posting and not in your code.    In any case, try casting the object to be a MovieClip and that should solve the probem...
    if (this.getChildAt(i) is MovieClip){
         MovieClip(this.getChildAt(i)).stop();

  • Manipulating with movieClips in array

    Hello,
    I want to dynamicly add images from XML to movieClips and
    then add event listeners to these movieClips. What is the best
    solution? Could you please help?
    XMl loads correctly, it also add 2 movieclips on stage, but
    it throws errors when I try to add event listeners to movieClips.
    How could I do that? I want to go to different frames on release of
    some movieClips. How can I please recognise each movieClip and
    manipulate with that movieClip ? (resizing,...)
    I attached part of my code

    :
    function onComplete (evt:Event):void{
    var mc:MovieClip=MovieClip(evt.target.content)
    arrayMC.push(mc);
    addChild(mc);
    mc.addEventListener(MouseEvent.CLICK,whateverfunction);
    function whateverfunction(e:Event){
    }

  • Cannot add movieclip to stage

    Hi, I cannot add movieclip to stage. Here's the code:
    package
        import flash.display.*;
        public class Game extends MovieClip
            private var s1:ScrollPlatform = new ScrollPlatform();
            public function main()
                addChild(s1);
                s1.x = 0;
    I have this in the first frame in the timeline:
    var game:Game = new Game();
    game.main();
    Please help. I am a newbie.

    You class Game has no contractor. You must have:
    public function Game():void {
    Perhaps your function main() is meant to be Game()
    Then either set Game as your document class (Game becomes your main timeline), or create an instance and add to the stage:
    var game:Game = new Game();
    addChild(game);

  • The sound  with movieclip loaded from outside

    Hi.everybody...I have a probelm with sound working with
    movieclip loaded from outside. this movieclip is just working fine
    alone..but after being loaded to the other movie..the sound doesnt
    play any more.
    by the way,I loaded this movieclip with loadclip and also add
    listener on it.
    any suggestion,,please..thank u .

    try adding
    yourHolder._lockroot = true; //yourHolder would be the
    instance name of the holder MovieClip

  • Working with PRIOR XY stage and Piezo stage

    Hi,
    I'm having a problem working with my XY stage and piezo stage of PRIOR.
    I have the 'Top-Level' example.
    As I was told from PRIOR I have to daizy-chaned the 2 controllers. I try to work with the piezo stae with automatic initiation but I gen an error.
    Does someone know how to work this out?
    Thank you
    Yoli

    Hi Marti,
    Thank you for replaying.
    Im trying to open the Piezo z with active x  using automation Open vi of LabView. The same as in top level forIZOpen but instead Im using PRIORLib.IPiezo.
    The error I'm getting is  3005:
    Automation Open: Object specified is not creatable in IPiezoOpen.vi 
    IPiezoOpen is the name I gave to the vi. (Attached ).
    As I was instructed the piezoZ controller in connected to the XY in daisy chained. So running top level, there is no problem controlling the XY stage. My problem is to activate and control the piezo.
    Also attached is the top level vi
    Thank you
    Attachments:
    piezoZ.doc ‏24 KB
    TopLevel.vi ‏117 KB

  • Dynamically loaded swf to communicate with MovieClip on the stage

    I have a heck of time here with an issue. I have an xml document that when a certain button on the stage is clicked it loads it's corresponding external swf into an empty movieclip on the stage. This empty movie clip is a holder for all external swfs.
    So what I'm trying to do is when an external swf is loaded that has buttons on it, I need those buttons to communicate with the main timeline and remove a mc that is on the Stage. I need the currently loaded swf(s) to be able to do this. So whatever the currently loaded external swf is that's loaded, I need it to talk to the main timeline. (I have quite a few external swfs that need to do this) So I imagine I need to somehow target the currently loaded external swf to get it to talk to the main timeline.
    The code below in summary doesn't work but it doesn't give errors either. I don't pretend to know what I'm doing and I haven't been successful in searching for a solution to this particular issue. If someone could give me guidance or direct me to a solution. I'd so much appreciate it.
    // main timeline object
    var index:Object=this;
    function loadComplete (e:Event) {
            TweenMax.to(index.mcholder,1, {alpha: .5});
    // add the current module to the mcholder movieclip by using addChild
            index.mcholder.addChild(e.currentTarget.content);
           (e.currentTarget.content as MovieClip).addEventListener("eventTriggered", startListener);
    function startListener(e:Event):void {
    var ext_swf:MovieClip;
    ext_swf = e.currentTarget.content as MovieClip;
    trace("external swf");
    ext_swf.button1.addEventListener(MouseEvent.CLICK, talktomainswf);
    function talktomainswf():void {
    TweenMax.to(index.mc_thatsonthestage, 1, {x:1000});
    // now we have the first load we set firstLoad to false
            index.firstLoad = false;
        function loadError (e:Event) {
            trace("error");

    You can use the event dispatcher to communicate between external swfs and a main timeline,
    like so:
    //in an external swf
    //Once loaded
    function onLoadComplete(event:Event):void
         //dispatch an event in the form of a string
         dispatchEvent(new Event("Talk to Main Timeline")); 
    //On the Main timeline
    //listen for "Talk to Main Timeline"
    stage.addEventListener("Talk to Main Timeline", listenForCallsFromExternalFiles, true);
    //if the event is heard, do this:
    function listenForCallsFromExternalFiles(e:Event):void
         trace("I heard ya, now do stuff...");
    That's the basic idea anyways, I use it all the time.
    hope that helps,
    ~chipleh

  • Reposition a movieclip on stage with coordinates from an xml

    Hello i am new to this forum, and kinda a beginner with actionscript. what i'm trying to do is reposition a movieclip already with the coordinates that will be in an XML file on my server. But so far no luck.
    This is what i have for AS3
    var my_x:Number;
    var my_y:Number;
    var myCoord:XML;
    sample_mc.x = my_x;
    sample_mc.y = my_y;
    var myXMLLoader:URLLoader = new URLLoader();
    myXMLLoader.load(new URLRequest("coords.xml"));
    myXMLLoader.addEventListener(Event.COMPLETE, processXML);
    function processXML (e:Event):void{
    var myXML:XML = new XML(e.target.data);
    myCoord = myXML.position.pos1;
    my_x = myCoord.@XPOSITION;
    my_y = myCoord.@YPOSITION;
    And the XML file
    < position>
    < pos1 XPOSITION="100" YPOSITION="55">
    < /pos1>
    < /position>
    let me know if anyone can correct what i'm doing wrong, please.

    still no prevail, this is now what i got so far
    AS3
    var my_x:Number;
    var my_y:Number;
    var myCoord:XML;
    var myXMLLoader:URLLoader = new URLLoader();
    myXMLLoader.load(new URLRequest("coords.xml"));
    myXMLLoader.addEventListener(Event.COMPLETE, processXML);
    function processXML (e:Event):void{
        var myXML:XML = new XML(e.target.data);
        myCoord = myXML.pos1;
        sample_mc.x = my_x = Number(myCoord.@XPOSITION);
        sample_mc.y = my_y = Number(myCoord.@YPOSITION);
    and the XML
    < position>
    < pos1 XPOSITION="100" YPOSITION="55">< /pos1>
    < /position>
    i know i'm just a beginner with AS but i really thought this was something simple. do i have obvious errors.

  • How do I attach a class to a movieclip on stage?

    Hi all,
    I have a Flash movie that is to be the navigation for a web
    site, and am using Flash CS3. I have exported it from Photoshop and
    have turned the buttons into movieclips on the import. Upon import,
    I have several named movieclips on the stage. I want to be able to
    attach custom classes to these movieclips so that they have
    functionality but haven't figured out how to do this.
    My Flash file has a root document class called 'Nav'. I have
    a file named 'nav.as' in the same directory as my FLA file. I have
    a button onstage named apples_logo, which is an instance of the
    library item named ApplesLogo, which is set up for linkage with a
    Class Name of ApplesLogo and a base class of
    flash.display.MovieClip. Clicking on the "validate class
    definition" button in the linkage window indicates that Flash is
    finding the actionscript file for this class fine (which is named
    'ApplesLogo.as').
    When I execute the Flash file, though, I get the error: 1046:
    type was not found or was not a compile-time constant: ApplesLogo.
    What is going on? I'm expecting the ApplesLogo contstructor method
    to be called from my ApplesLogo class. My Nav class is in an
    unnamed package and if I create a folder named 'nav' and put my
    ApplesLogo.as file into that folder (to try to build my package
    structure), I get a message from the class definition validator
    button in the Linkage window that says it no longer finds the
    ApplesLogo class and will create an empty one for me. I figure one
    way or the other this should work, but neither is. What am I
    missing?
    Thanks for any help you can provide. My very simple source
    code is below.

    Hello there,
    I tried playing around with your code on my machine and like
    you I came across the same error you mention above. After some
    experimenting I found that if you add the package definition to
    your ApplesLogo.as file it works (well, for me it did). Both trace
    statements come thru.
    Both actionscript classes were in the same folder as the FLA
    See if this helps!

  • Air 3.0 distorts movieclip on stage

    Since switching to AIR 3.0, has anyone noticed differences in the way their mobile app looks when run in the FB4.5 environment compared to a mobile device like an iPhone 4?
    I have a simple AS3 Mobile project built in Air 2.7 which was working fine.
    I tried to compile using Air 3.0 and now a movieClip on the stage is  distorting. Hard to describe what it's doing. Essentially the y position is about 220 pixels off of the screen, and the bottom is distorted/stretched.
    The weird thing is that it only does it in the Flash Builder environment, it looks fine when the ipa is run on an iphone 4.
    Some background:
    <aspectRatio>portrait</aspectRatio>
    <autoOrients>true</autoOrients>
    <fullScreen>true</fullScreen>
    <renderMode>gpu</renderMode>

    I'm having the same result when running the AIR debug launcher (ADL) from withing Flash CS 5.5.  I downloaded and overlaid AIR 3.0 SDK per the instructions (http://kb2.adobe.com/cps/908/cpsid_90810.html).  I have a graphics-heavy FLA with the following settings:
    Publish Settings
    Player: AIR for iOS
    Script: ActionScript 3.0
    Hardware acceleration: Level 2 - GPU
    AIR for iOS Settings
    Aspect ratio: Landscape
    Full screen
    Auto orientation
    Rendering: GPU
    Device: iPhone and iPad
    Resolution: High
    Things were fine with AIR 2.7 overlaid, but since switching to 3.0 whenever I click Control > Test Movie > In AIR Debug Launcher (Mobile) I get the same display issue as noted above - the display objects are all pushed up so that the bottom edge is about 200 pixels from the top of the frame, with the last row of pixels stretched down to the bottom of the frame (ends up looking like vertical lines of color).  The buttons that are normally along the bottom, are now partially off frame at the top, however, the mouse clicks for them still register as if they were at the bottom where they're supposed to be.
    I cycled through all the different AIR for iOS Settings and it seems that having the Rendering set to GPU is the culprit.  Everything's fine in ADL unless it's set to GPU.
    I recall a similar problem with AIR 2.6/2.7 but it was eventually fixed though I don't think Adobe announced it as a bug fix, they just replaced the AIR SDK downloader quietly in the night.
    Argh!!!

  • Help with movieclips

    Hi,
    I use Flash cc for interactive music education content and I need help with this:
    Let´s say I have several sets of movieclips in my library. Each movieclip contains audio and animation (two bars). What I want to do is put several buttons on the stage so the user can click two of them to choose which movieclips are goinge to be loaded from the library and then click PLAY and listen and see the first movieclip and immediately after that will listen and see the second movie clip. Like choosing the pieces (bars) of a song and then playing the song.
    The problem is that the ammount of combinations is so huge that I need to find how to do it this way.

    Here's the skeleton of what you're after. Filling it in will be left as an exercise to the reader, but basically...
    Have a Queue area onstage that shows the current queue of loaded items to play. Show the list of possible movieclips below it and each one clicked in that area adds it to the queue. A click on a movieclip in the queue area deletes it from the queue. There's a play button somewhere beside the queue.
    Programming-wise, you will have an array (let's say it's called queueArray). Each movieclip will need a unique instance name, and as it is clicked you will Array.push it onto the queueArray (or delete it of the queueArray if they click it when it's already on there). When they click play, it simply plays queueArray[0] and then queueArray[1].

  • AIR - Major Bug (?) with MovieClip class

    Hello all,
    We are a team of developers working on ActionScript 3.0 project using Adobe AIR SDK and Adobe Flex SDK.  During the development we discovered what seems to be a major problem with getting MovieClip instances to play correctly. More specifically,  the problem has to do with the gotoAndStop method. If, using the gotoAndStop method, you perform a for loop over all MovieClip frames (from the 1st frame to the last one) and go back to the 1st frame again, then, after adding MovieClip to the Stage, the 1st frame won't be set, contrary to what's expected. Instead, the MovieClip selects the last frame, which messes things up.  Are there any solutions to the described problem, other than switching to the right frame after the object has been added to Stage?
    This seems like a 'no way out' situation - any help would be much appreciated.
    A note: MovieClip itself is being imported from the 'swc' file.

    Thanks for the heads up and I'm sorry you guys have run into this issue.  Is this is new to AIR 3.x?
    Could you please open a new bug report on this over at bugbase.adobe.com, including a brief description and sample code/app to help us easily reproduce the problem.  Please post back with the URL so that others affected can add their comments and votes.
    Thanks,
    Chris

  • Referencing a MovieClip on stage through XML

    Hello.
    I have a swf with several MovieClip instances on the stage at
    authoring time. For example, say I have mBuilding that contains
    mFloor, that in turn contains mAppartment.
    I have an xml file that contains data so the swf knows what
    to do with the MovieClips.
    I've been trying different things, but I'm still stumped. Can
    anyone give me some advice?
    Thanks in advance.

    still no prevail, this is now what i got so far
    AS3
    var my_x:Number;
    var my_y:Number;
    var myCoord:XML;
    var myXMLLoader:URLLoader = new URLLoader();
    myXMLLoader.load(new URLRequest("coords.xml"));
    myXMLLoader.addEventListener(Event.COMPLETE, processXML);
    function processXML (e:Event):void{
        var myXML:XML = new XML(e.target.data);
        myCoord = myXML.pos1;
        sample_mc.x = my_x = Number(myCoord.@XPOSITION);
        sample_mc.y = my_y = Number(myCoord.@YPOSITION);
    and the XML
    < position>
    < pos1 XPOSITION="100" YPOSITION="55">< /pos1>
    < /position>
    i know i'm just a beginner with AS but i really thought this was something simple. do i have obvious errors.

  • Help with movieclip position/layers

    Hello. i am building simple game using as3. I am using AS3 Code to create objects on the stage (by creating a movieclip in the library and linkage them to actionscript and then call them with addChild). i have 2 movieClips the first is need to be in the front of the stage and the second on the back, the user need to click the second movieclip with the mouse click but because the first movieclip is in the front (and in the width of the stage) the second movieclip is not response to the mouse clicks. The first movieclip must be in front. any idea how to solve that issue???

    maybe you can post some example?
    this is my code
    this.addEventListener(MouseEvent.CLICK, kill)
    function kill(event:MouseEvent):void
    this_xml = <Motion duration="5" xmlns="fl.motion.*" xmlns:geom="flash.geom.*" xmlns:filters="flash.filters.*">
    <source>
    <Source frameRate="30" x="-213.2" y="465.85" scaleX="1" scaleY="1" rotation="0" elementType="movie clip" symbolName="closeCartWheel">
    <dimensions>
    <geom:Rectangle left="-144" top="-214" width="290.1" height="238"/>
    </dimensions>
    <transformationPoint>
    <geom:Point x="0.504825922095829" y="0.8930672268907563"/>
    </transformationPoint>
    </Source>
    </source>
    <Keyframe index="0" tweenSnap="true" tweenSync="true">
    <tweens>
    <SimpleEase ease="0"/>
    </tweens>
    </Keyframe>
    <Keyframe index="4" scaleX="0.208" scaleY="0.208">
    <color>
    <Color alphaMultiplier="0"/>
    </color>
    </Keyframe>
    </Motion>;
    this_animator = new Animator(this_xml, this);
    this_animator.play();
    this_animator.addEventListener(MotionEvent.MOTION_END, die);

Maybe you are looking for

  • Tickets with respect to following and the solutions.

    Hi, Please send me the solution to following topics in SD. 1)material determination/product selection. 2)Creation of Customer Master Record and Customer Account Group. 3)Material Listing and Exclusion. Please email me at [email protected] Looking for

  • How do I set up a password

    How do I set up a password for my airport extreme network?

  • Stuck with the basics..

    Hi! this is not a programming problem, but it seems that i am stuck with the basic , i am trying to implement my custom  PushBufferDataSource and a PushBufferStream, but i am not able to understand that how the      read(Buffer buffer) method and the

  • ABAP/4 processor: ASSERTION_FAILED

    Hi BW Experts, When we transport one of our Billing DSO and update rules linked to it from Dev to Quality the transport is failing with the below error message. 09/24/2007  18:35:02  Job started 09/24/2007  18:35:02  Step 001 started (program RDDEXEC

  • Problem with BPM workspace - Failed to compile JSP /bpmHome.jsff

    Hi I have instaled SOA Suite 11gR1 (11.1.1.5.0). All console woks, except bpm workspace. I have following error after login Incident Id: 3 Incident Source: SYSTEM Create Time: Thu Sep 22 09:21:36 CEST 2011 Problem Key: BEA-101017 [HTTP][weblogic.serv