Example #1
0
 public static void add_textInput(TextField that, Action <TextEvent> value)
 {
     CommonExtensions.CombineDelegate(that, value, TextEvent.TEXT_INPUT);
 }
 public static void add_MessageDirect(Connection that, Action <object> value)
 {
     CommonExtensions.CombineDelegate(that, value, MessageEvent.MESSAGE);
 }
 public static void add_asyncError(LocalConnection that, Action <AsyncErrorEvent> value)
 {
     CommonExtensions.CombineDelegate(that, value, AsyncErrorEvent.ASYNC_ERROR);
 }
Example #4
0
 public static void add_resize(Stage that, Action <Event> value)
 {
     CommonExtensions.CombineDelegate(that, value, Event.RESIZE);
 }
 public static void add_Disconnect(Connection that, Action <object> value)
 {
     CommonExtensions.CombineDelegate(that, value, ConnectionEvent.DISCONNECT);
 }
Example #6
0
 public static void add_netStatus(NetGroup that, Action <NetStatusEvent> value)
 {
     CommonExtensions.CombineDelegate(that, value, NetStatusEvent.NET_STATUS);
 }
Example #7
0
 public static void add_fullScreen(Stage that, Action <FullScreenEvent> value)
 {
     CommonExtensions.CombineDelegate(that, value, FullScreenEvent.FULL_SCREEN);
 }
Example #8
0
 public static void add_addedToStage(DisplayObject that, Action <Event> value)
 {
     CommonExtensions.CombineDelegate(that, value, Event.ADDED_TO_STAGE);
 }
Example #9
0
 public static void add_enterFrame(DisplayObject that, Action <Event> value)
 {
     CommonExtensions.CombineDelegate(that, value, Event.ENTER_FRAME);
 }
Example #10
0
 public static void add_status(Camera that, Action <StatusEvent> value)
 {
     CommonExtensions.CombineDelegate(that, value, StatusEvent.STATUS);
 }
        /// <summary>
        /// Default constructor
        /// </summary>
        public FlashGoogleMapsExample()
        {
            var MyMap = this;

            // lets create a hyperlink
            var powered_by_jsc = new TextField
            {
                x = 72,
                y = 32,

                defaultTextFormat = new TextFormat
                {
                    size = 24
                },
                autoSize   = TextFieldAutoSize.LEFT,
                htmlText   = "<a href='http://jsc.sf.net' target='_blank'>powered by <b>jsc</b></a>",
                selectable = false,
                filters    = new[] { new BlurFilter() },
                textColor  = ColorWhite
            }.AttachTo(this);

            // based on http://code.google.com/p/gmaps-samples-flash/source/browse/trunk/samplecode/com/google/maps/examples/HelloWorld.as


            //MyMap.width = 500;
            //MyMap.height = 400;

            // This key is good for all URLs in this directory:
            // http://jsc.sourceforge.net/
            MyMap.key = "ABQIAAAAP8RnR45oCW_IQn841NsRUxTWTeJzEP4t7om06_BG8dFdNnzkzRSRwPJSLIikpLP_90z2Fvj1rJhFWw";

            CommonExtensions.CombineDelegate(MyMap,

                                             (MapEvent e) =>
            {
                MyMap.setCenter(new LatLng(40.736072, -73.992062), 14, MapType.HYBRID_MAP_TYPE);

                var status = new TextField
                {
                    x               = 64,
                    y               = 164,
                    autoSize        = TextFieldAutoSize.LEFT,
                    background      = true,
                    mouseEnabled    = false,
                    backgroundColor = ColorBlack,
                    textColor       = ColorWhite,
                    filters         = new[] { new GlowFilter(ColorBlack) }
                }.AttachTo(this);

                //MyMap.MapMoveStep += e =>
                //    {
                //        status.text = "move: " + e.latLng.ToString();
                //    };

                //MyMap.MapClick += e =>
                //    {
                //        status.text = "click: " + e.latLng.ToString();
                //    };
                powered_by_jsc.AttachTo(this);
            }

                                             , MapEvent.MAP_READY);



            MyMap.addControl(new ZoomControl());
            MyMap.addControl(new PositionControl());
            MyMap.addControl(new MapTypeControl());


            this.contextMenu = new ContextMenu();
            this.contextMenu.hideBuiltInItems();

            #region powered by jsc



            powered_by_jsc.mouseOver +=

                delegate
            {
                powered_by_jsc.textColor = ColorYellow;
                powered_by_jsc.filters   = new[] { new DropShadowFilter() };
            };

            powered_by_jsc.mouseOut +=
                delegate
            {
                powered_by_jsc.filters   = new[] { new BlurFilter() };
                powered_by_jsc.textColor = ColorWhite;
            };

            #endregion
        }
Example #12
0
 public static void add_activity(Camera that, Action <ActivityEvent> value)
 {
     CommonExtensions.CombineDelegate(that, value, ActivityEvent.ACTIVITY);
 }
 public static void add_channelMessage(ScriptCoreLib.ActionScript.flash.system.MessageChannel that, Action <Event> value)
 {
     CommonExtensions.CombineDelegate(that, value, Event.CHANNEL_MESSAGE);
 }
Example #14
0
 public static void add_menuItemSelect(ContextMenuItem that, Action <ContextMenuEvent> value)
 {
     CommonExtensions.CombineDelegate(that, value, ContextMenuEvent.MENU_ITEM_SELECT);
 }
Example #15
0
 public static void add_sampleData(Sound that, Action <SampleDataEvent> value)
 {
     CommonExtensions.CombineDelegate(that, value, SampleDataEvent.SAMPLE_DATA);
 }
Example #16
0
 public static void add_removed(DisplayObject that, Action <Event> value)
 {
     CommonExtensions.CombineDelegate(that, value, Event.REMOVED);
 }
 public static void add_deactivate(EventDispatcher that, Action <Event> value)
 {
     CommonExtensions.CombineDelegate(that, value, Event.DEACTIVATE);
 }
Example #18
0
 public static void add_removedFromStage(DisplayObject that, Action <Event> value)
 {
     CommonExtensions.CombineDelegate(that, value, Event.REMOVED_FROM_STAGE);
 }
Example #19
0
 public static void add_soundComplete(SoundChannel that, Action <Event> value)
 {
     CommonExtensions.CombineDelegate(that, value, Event.SOUND_COMPLETE);
 }
Example #20
0
 public static void add_render(DisplayObject that, Action <Event> value)
 {
     CommonExtensions.CombineDelegate(that, value, Event.RENDER);
 }
Example #21
0
 public static void add_mouseLeave(Stage that, Action <Event> value)
 {
     CommonExtensions.CombineDelegate(that, value, Event.MOUSE_LEAVE);
 }
Example #22
0
 public static void add_complete(Sound that, Action <Event> value)
 {
     CommonExtensions.CombineDelegate(that, value, Event.COMPLETE);
 }
Example #23
0
        public ApplicationSprite()
        {
            var disable_F9 = false;
            var sb         = new Soundboard();

            this.InvokeWhenStageIsReady(
                delegate
            {
                Security.allowDomain("*");
                Security.allowInsecureDomain("*");


                // we are getting wrong bindings?
                // because of older playerglobal?

                // http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/MouseEvent.html#RIGHT_CLICK
                // X:\jsc.svn\examples\actionscript\svg\FlashSVGCursorExperiment\FlashSVGCursorExperiment\ApplicationSprite.cs
                CommonExtensions.CombineDelegate(
                    this.stage,
                    new System.Action <MouseEvent>(
                        e =>
                {
                    e.preventDefault();
                }
                        )
                    ,
                    "rightClick"
                    );

                new ActionScript.Images.MyCursor().ToMouseCursor();


                var lasterror = 0;

                this.root.loaderInfo.uncaughtErrorEvents.uncaughtError +=
                    e =>
                {
                    if (lasterror == e.errorID)
                    {
                        return;
                    }

                    Console.WriteLine("error: " + new { e.errorID, e.error, e } +"\n run in flash debugger for more details!");

                    lasterror = e.errorID;
                };


                #region keys
                this.stage.keyUp +=
                    e =>
                {
                    if (e.keyCode == (uint)System.Windows.Forms.Keys.F9)
                    {
                        if (disable_F9)
                        {
                            return;
                        }

                        disable_F9 = true;
                        sb.snd_click.play();

                        Abstractatech.ActionScript.ConsoleFormPackage.ConsoleFormPackageExperience.Initialize();
                    }

                    if (e.keyCode == (uint)System.Windows.Forms.Keys.F11)
                    {
                        sb.snd_click.play();

                        this.stage.displayState = ScriptCoreLib.ActionScript.flash.display.StageDisplayState.FULL_SCREEN_INTERACTIVE;
                    }

                    if (e.keyCode == (uint)System.Windows.Forms.Keys.F)
                    {
                        sb.snd_click.play();

                        this.stage.displayState = ScriptCoreLib.ActionScript.flash.display.StageDisplayState.FULL_SCREEN_INTERACTIVE;
                    }
                };
                #endregion
            }
                );


            var lobby = new FlashHeatZeeker.Lobby.ApplicationSprite();
            lobby.AttachTo(this);


            this.InvokeWhenPromotionIsReady(
                delegate
            {
                lobby.StartClicked += delegate
                {
                    if (lobby == null)
                    {
                        return;
                    }

                    sb.snd_click.play();

                    try
                    {
                        // wtf?
                        lobby.ytp.Loader.unloadAndStop(true);
                        //lobby.ytp.pauseVideo();
                    }
                    catch
                    {
                    }
                    lobby.Orphanize();
                    lobby = null;

                    //new ApplicationSpriteContent().AttachTo(this);

                    Initialize();

                    #region F8
                    var CanConnectAndroid = true;
                    this.stage.keyUp     +=
                        e =>
                    {
                        if (e.keyCode == (uint)System.Windows.Forms.Keys.F8)
                        {
                            if (!CanConnectAndroid)
                            {
                                return;
                            }

                            CanConnectAndroid = false;

                            sb.snd_lookingforlongrangecomms.play(
                                loops: 2,
                                sndTransform: new ScriptCoreLib.ActionScript.flash.media.SoundTransform(0.4)
                                );


                            var text       = new ScriptCoreLib.ActionScript.flash.text.TextField().AttachTo(this);
                            text.width     = 800;
                            text.y         = 72;
                            text.textColor = 0xffffff;
                            text.multiline = true;

                            FlashHeatZeeker.TestGamePad.Library.MulticastService.InitializeConnection(
                                StarlingGameSpriteWithTestDriversWithAudio.__keyDown,
                                WriteMode: false,
                                ReadMode: true,
                                text: text,

                                yield_PostMessage:
                                PostMessage =>
                            {
                                StarlingGameSpriteWithTestDriversWithAudio.current_changed +=
                                    g =>
                                {
                                    Action <string> __switchto =
                                        type =>
                                    {
                                        PostMessage(
                                            new XElement(
                                                "switchto",
                                                new XAttribute("type", type),
                                                new XAttribute("syncframeid", "" + g.syncframeid)

                                                ).ToString());
                                    };
                                    if (g.current is PhysicalPed)
                                    {
                                        __switchto("ped");
                                    }
                                    if (g.current is PhysicalTank)
                                    {
                                        __switchto("tank");
                                    }
                                    if (g.current is PhysicalJeep)
                                    {
                                        __switchto("jeep");
                                    }
                                    if (g.current is PhysicalHind)
                                    {
                                        __switchto("hind");
                                    }
                                    if (g.current is PhysicalBunker)
                                    {
                                        __switchto("bunker");
                                    }
                                    if (g.current is PhysicalCannon)
                                    {
                                        __switchto("cannon");
                                    }
                                    if (g.current is PhysicalSilo)
                                    {
                                        __switchto("silo");
                                    }
                                    if (g.current is PhysicalWatertower)
                                    {
                                        __switchto("watertower");
                                    }
                                };
                            }
                                );
                        }
                    };
                    #endregion



                    var shop = new ShopExperience(this);

                    StarlingGameSpriteBeta2.ShopEnter += ped =>
                    {
#if FPLAYERIO
                        // no go
                        if (ApplicationSpriteWithConnection.CurrentClient == null)
                        {
                            return;
                        }

                        shop.ShopEnter(ped);
#endif
                    };

                    StarlingGameSpriteBeta2.ShopExit += shop.ShopExit;


                    // http://www.flare3d.com/support/index.php?topic=1101.0

                    this.addChild(new net.hires.debug.Stats {
                        alpha = 0.7
                    });
                };
            }
                );
        }
Example #24
0
 public static void add_ioError(Sound that, Action <IOErrorEvent> value)
 {
     CommonExtensions.CombineDelegate(that, value, IOErrorEvent.IO_ERROR);
 }
 public static void add_Init(Connection that, Action <object> value)
 {
     CommonExtensions.CombineDelegate(that, value, ConnectionEvent.INIT);
 }
Example #26
0
 public static void add_open(Sound that, Action <Event> value)
 {
     CommonExtensions.CombineDelegate(that, value, Event.OPEN);
 }
        public ApplicationSprite()
        {
            var c = new ActionScript.Images.MyCursor();

            //Error: Error #2071: The Stage class does not implement this property or method.
            //    at Error$/throwError()
            //    at flash.display::Stage/set contextMenu()
            //    at FlashSVGCursorExperiment::ApplicationSprite()[V:\web\FlashSVGCursorExperiment\ApplicationSprite.as:36]

            //this.stage.contextMenu = new ContextMenu();
            this.stage.showDefaultContextMenu = false;


            // http://stackoverflow.com/questions/16896432/mouseevent-right-mouse-down-rightmousedown-doesnt-work-in-flex4-6-web-runs
            this.stage.rightMouseDown +=
                e =>
            {
                c.alpha = 0.3;
            };

            this.stage.rightMouseUp +=
                e =>
            {
                c.alpha = 0.9;
            };


            //public static function remove_rightClick_4ebbe596_06001096(that:InteractiveObject, value:__Action_1):void
            //{
            //    CommonExtensions.RemoveDelegate_4ebbe596_060021d9((EventDispatcher(that)), value, MouseEvent.CLICK);
            //}

            // we are getting wrong bindings?
            // because of older playerglobal?

            // http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/MouseEvent.html#RIGHT_CLICK
            // X:\jsc.svn\examples\actionscript\svg\FlashSVGCursorExperiment\FlashSVGCursorExperiment\ApplicationSprite.cs
            CommonExtensions.CombineDelegate(
                this.stage,
                new System.Action <MouseEvent>(
                    e =>
            {
                e.preventDefault();
            }
                    )
                ,
                "rightClick"
                );


            this.stage.rightClick +=
                e =>
            {
                c.alpha = 1.0;
            };

            // http://stackoverflow.com/questions/377033/remove-the-right-click-menu-in-flash-9

            c.AttachTo(this);



            new ActionScript.Images.MyCursor().ToMouseCursor();
        }
Example #28
0
 public static void add_progress(Sound that, Action <ProgressEvent> value)
 {
     CommonExtensions.CombineDelegate(that, value, ProgressEvent.PROGRESS);
 }
 public static void add_securityError(LocalConnection that, Action <SecurityErrorEvent> value)
 {
     CommonExtensions.CombineDelegate(that, value, SecurityErrorEvent.SECURITY_ERROR);
 }
Example #30
0
 public static void add_scroll(TextField that, Action <Event> value)
 {
     CommonExtensions.CombineDelegate(that, value, Event.SCROLL);
 }