Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

multitouch gesture issue

Explorer ,
Feb 25, 2014 Feb 25, 2014

1046: Type was not found or was not a compile-time constant:transformgestureevent

try to add swipe gesture to scroll_mc but receive error 1046 Type was not found or was not a compile-time constant:TransFormGestureEvent.

why?

package {

          import flash.desktop.NativeApplication;

          import flash.desktop.SystemIdleMode;

          import flash.display.MovieClip;

          import flash.media.Video;

          import flash.net.NetConnection;

          import flash.net.NetStream;

          import flash.events.MouseEvent;

          import flash.events.NetStatusEvent;

          import fl.controls.List

          import flash.events.Event;

                           import flash.ui.Multitouch;

          import flash.ui.MultitouchInputMode;

                    public class Main extends MovieClip {

                    public var song ["hatizmoret.flv","tarnegol.flv","se_ugdi.flv","dag.flv"]

                    public var song_number:String

                    .....

                   public var scroll_mc:MovieClip

                                      public function Main() {

                                      scroll_mc.addChild(A1)

  .........

             A1.x=posX

                                          A1.y=posY

             A1.height=high;

             A1.width=widt;

             A1.addEventListener(MouseEvent.CLICK, next_frame1);

.......

 

          scroll_mc.addEventListener (TransformGestureEvent.GESTURE_SWIPE, fl_SwipeHandler);

                                

                              NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE;

                              netConnection = new NetConnection();

                              netConnection.connect(null);

                              netStream = new NetStream(netConnection);

                              netStream.client = this;

                              netStream.addEventListener(NetStatusEvent.NET_STATUS, statusUpdated);

                              video = new Video();

                              video.attachNetStream(netStream);

                              video.width = 480;

                              video.height = 320;

                              addChildAt(video, 0);

                                                                       

                                                                       

                                                                       

                                                                       

                    }

  ...............

                                                            setupControls();

                                                            trace(VIDEO_URL)

                                                            trace(song_number)

                                                  }

 

 

public function fl_SwipeHandler(event:TransformGestureEvent):void

{

 

          switch(event.offsetX)

          {

                    // swiped right

                    case 1:

                    {

 

                              scroll_mc.x += 20;

 

                              break;

                    }

                    case -1:

                    {

                              scroll_mc.x -= 20;

                              break;

                    }

          }

          switch(event.offsetY)

          {

                    case 1:

                    {

                              scroll_mc.y += 20;

                              break;

                    }

 

                    case -1:

                    {

                              scroll_mc.y -= 20;

                              break;

                    }

          }

}

 

 

 

 

 

 

                    public function hideBtns():void {

                              controls.visible = false;

                              blocker.visible = false;

                    }

                    public function showBtns(btns:Array):void {

                              controls.visible = true;

                              blocker.visible = true;

                              for(var instName:String in controls)

                              {

                                        if(btns.indexOf(instName) != -1)

                                        {

                                                  controls[instName].visible = true;

                                        }

                                        else

                                        {

                                                  controls[instName].visible = false;

                                        }

                              }

                    }

                                                  }

}

TOPICS
ActionScript
450
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 25, 2014 Feb 25, 2014

import it:

import flash.events.TransformGestureEvent;

Translate
Community Expert ,
Feb 25, 2014 Feb 25, 2014
LATEST

import it:

import flash.events.TransformGestureEvent;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines