Announcement

Collapse
No announcement yet.

How im going to do this on flash

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    How im going to do this on flash

    Ok so im trying to make the https://api.unrealengine.com/udk/Thr...Interface.html interface work with my GFxMovie of AS2,
    the thing looks simple an external call that leads to the GFxClass but i have a problem the function
    Code:
    import flash.external.ExternalInterface;
    
    // Hide normal "Windows" pointer.
    Mouse.hide();
    
    var mouseListener:Object = new Object();
    
    trace(" FROM Movie i begin to play");
    
    mouseListener.onMouseMove = function() {
     // Set the cursor instance position to the mouse position.
     multipurposemouse._x = _root._xmouse;
     multipurposemouse._y = _root._ymouse;
     trace(" FROM Movie updating mouse position");
     // Pass Unrealscript the new mouse coordinates
     ExternalInterface.call("UpdateMousePosition", _root._xmouse, _root._ymouse);
    
     updateAfterEvent();
    };
    
    multipurposemouse.addListener(mouseListener);
    does not get called at all,

    i place it here on the mouse symbol actions but
    ExternalInterface.call("UpdateMousePosition", _root._xmouse, _root._ymouse); gets called every frame, and that's expensive

    Code:
    onClipEvent(enterFrame){
    import flash.external.ExternalInterface;
    
    Mouse.hide(); this._x=_root._xmouse; this._y=_root._ymouse;
    ExternalInterface.call("UpdateMousePosition", _root._xmouse, _root._ymouse);
    }
    1 questions are, is there any way to make the first function work in actions?

    2 second is there any function in the symbol actions like a begin frame or something ( so that gets called the very first ), in the mouse symbol, like OnClipEvent( begin ) ?

    thanks in advance.

    Some cool unreal projects you may like!


    Developer of GOTA - Survivalism Gladiatorial game Buy the game google gladiators of the arena steam https://store.steampowered.com/app/7..._Of_The_Arena/

    Download the demo Download the demo
    external link Dropbox DropBox

    Become a c++ Professional now C++ Networking Tutorial

    #2
    Pls help guys nathaniewel someone : S ?
    nathan you know it with your RTS like game himeko
    Some cool unreal projects you may like!


    Developer of GOTA - Survivalism Gladiatorial game Buy the game google gladiators of the arena steam https://store.steampowered.com/app/7..._Of_The_Arena/

    Download the demo Download the demo
    external link Dropbox DropBox

    Become a c++ Professional now C++ Networking Tutorial

    Comment


      #3
      Hi Neongho. This is how I did it in Himeko Sutori:

      ActionScript 3
      Code:
      function handleMouseMove( e:MouseEvent ):void
      {
          mCursor.x = e.stageX;
          mCursor.y = e.stageY;
          ExternalInterface.call("UpdateMouse",mCursor.x,mCursor.y);
      }
      
      stage.addEventListener( MouseEvent.MOUSE_MOVE, handleMouseMove, false, 0, true );
      (By the way, mCursor is a symbol in my Flash document. It's just a custom cursor.)

      Then I exported the movie as a swf and imported it into the game editor. Then I made an UnrealScript class...

      UnrealScript
      Code:
      class GFxMoviePlayer_HUD extends GFxMoviePlayer;
      
      function UpdateMouse(int x, int y)
      {
          // Code for handling mouse movement
      }
      I hope that helps.
      Check out Himeko Sutori, the upcoming tactical RPG where you control armies of over 100 unique characters.

      Comment


        #4
        ok ok , well we in different world i do as 2 and me as 3 well thanks for the aid. i hope that the loop of import external…. won't cause memory leaks or worse
        Some cool unreal projects you may like!


        Developer of GOTA - Survivalism Gladiatorial game Buy the game google gladiators of the arena steam https://store.steampowered.com/app/7..._Of_The_Arena/

        Download the demo Download the demo
        external link Dropbox DropBox

        Become a c++ Professional now C++ Networking Tutorial

        Comment

        Working...
        X