/* * 1. add starling */ public ApplicationSprite() { this.loaderInfo.uncaughtErrorEvents.uncaughtError += e => { Console.WriteLine("error: " + new { e.errorID, e.error, e } + "\n run in flash debugger for more details!"); }; #region AtInitializeConsoleFormWriter var w = new __OutWriter(); var o = Console.Out; var __reentry = false; var __buffer = new StringBuilder(); w.AtWrite = x => { __buffer.Append(x); }; w.AtWriteLine = x => { __buffer.AppendLine(x); }; Console.SetOut(w); this.AtInitializeConsoleFormWriter = ( Action<string> Console_Write, Action<string> Console_WriteLine ) => { try { w.AtWrite = x => { o.Write(x); if (!__reentry) { __reentry = true; Console_Write(x); __reentry = false; } }; w.AtWriteLine = x => { o.WriteLine(x); if (!__reentry) { __reentry = true; Console_WriteLine(x); __reentry = false; } }; Console.WriteLine("flash Console.WriteLine should now appear in JavaScript form!"); Console.WriteLine(__buffer.ToString()); } catch { } }; #endregion this.InvokeWhenStageIsReady( delegate { Initialize(); var shop = new ShopExperience(this); StarlingGameSpriteWithShop.ShopEnter += ped => { // no go //if (ApplicationSpriteWithConnection.CurrentClient == null) // return; //shop.ShopEnter(ped); }; StarlingGameSpriteWithShop.ShopExit += shop.ShopExit; } ); }
/* * 1. add starling */ public ApplicationSprite() { this.loaderInfo.uncaughtErrorEvents.uncaughtError += e => { Console.WriteLine("error: " + new { e.errorID, e.error, e } +"\n run in flash debugger for more details!"); }; #region AtInitializeConsoleFormWriter var w = new __OutWriter(); var o = Console.Out; var __reentry = false; var __buffer = new StringBuilder(); w.AtWrite = x => { __buffer.Append(x); }; w.AtWriteLine = x => { __buffer.AppendLine(x); }; Console.SetOut(w); this.AtInitializeConsoleFormWriter = ( Action <string> Console_Write, Action <string> Console_WriteLine ) => { try { w.AtWrite = x => { o.Write(x); if (!__reentry) { __reentry = true; Console_Write(x); __reentry = false; } }; w.AtWriteLine = x => { o.WriteLine(x); if (!__reentry) { __reentry = true; Console_WriteLine(x); __reentry = false; } }; Console.WriteLine("flash Console.WriteLine should now appear in JavaScript form!"); Console.WriteLine(__buffer.ToString()); } catch { } }; #endregion this.InvokeWhenStageIsReady( delegate { Initialize(); var shop = new ShopExperience(this); StarlingGameSpriteWithShop.ShopEnter += ped => { // no go //if (ApplicationSpriteWithConnection.CurrentClient == null) // return; //shop.ShopEnter(ped); }; StarlingGameSpriteWithShop.ShopExit += shop.ShopExit; } ); }
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" ); //Error 8 The type 'FlashHeatZeeker.PlayerIOIntegrationBeta2.HTML.Images.FromAssets.Preview' exists in both 'x:\jsc.svn\examples\actionscript\svg\FlashHeatZeeker\packages\Chrome.Web.Server.1.0.0.0\lib\Chrome Web Server.dll' and 'x:\jsc.svn\examples\actionscript\svg\FlashHeatZeeker\FlashHeatZeeker.PlayerIOIntegrationBeta2\bin\staging.AssetsLibrary\FlashHeatZeeker.PlayerIOIntegrationBeta2.AssetsLibrary.dll' X:\jsc.svn\examples\actionscript\svg\FlashHeatZeeker\FlashHeatZeeker.PlayerIOIntegrationBeta2\Application.cs 130 122 FlashHeatZeeker.PlayerIOIntegrationBeta2 //Error 15 The call is ambiguous between the following methods or properties: 'FlashHeatZeeker.PlayerIOIntegrationBeta2.XToMouseCursor.ToMouseCursor(ScriptCoreLib.ActionScript.flash.display.Sprite)' and 'FlashHeatZeeker.PlayerIOIntegrationBeta2.XToMouseCursor.ToMouseCursor(ScriptCoreLib.ActionScript.flash.display.Sprite)' X:\jsc.svn\examples\actionscript\svg\FlashHeatZeeker\FlashHeatZeeker.PlayerIOIntegrationBeta2\ApplicationSprite.cs 83 21 FlashHeatZeeker.PlayerIOIntegrationBeta2 //Error 16 The type 'FlashHeatZeeker.PlayerIOIntegrationBeta2.ActionScript.Images.MyCursor' exists in both 'x:\jsc.svn\examples\actionscript\svg\FlashHeatZeeker\packages\Chrome.Web.Server.1.0.0.0\lib\Chrome Web Server.dll' and 'x:\jsc.svn\examples\actionscript\svg\FlashHeatZeeker\FlashHeatZeeker.PlayerIOIntegrationBeta2\bin\staging.AssetsLibrary\FlashHeatZeeker.PlayerIOIntegrationBeta2.AssetsLibrary.dll' X:\jsc.svn\examples\actionscript\svg\FlashHeatZeeker\FlashHeatZeeker.PlayerIOIntegrationBeta2\ApplicationSprite.cs 83 45 FlashHeatZeeker.PlayerIOIntegrationBeta2 // Error 87 The call is ambiguous between the following methods or properties: // 'FlashHeatZeeker.PlayerIOIntegrationBeta2.XToMouseCursor.ToMouseCursor(ScriptCoreLib.ActionScript.flash.display.Sprite)' and // 'FlashHeatZeeker.PlayerIOIntegrationBeta2.XToMouseCursor.ToMouseCursor(ScriptCoreLib.ActionScript.flash.display.Sprite)' // X:\jsc.svn\examples\actionscript\svg\FlashHeatZeeker\FlashHeatZeeker.PlayerIOIntegrationBeta2\ApplicationSprite.cs 90 21 FlashHeatZeeker.PlayerIOIntegrationBeta2 //Error 88 The type 'FlashHeatZeeker.PlayerIOIntegrationBeta2.ActionScript.Images.MyCursor' exists in both 'x:\jsc.svn\examples\actionscript\svg\FlashHeatZeeker\packages\Chrome.Web.Server.1.0.0.0\lib\Chrome Web Server.dll' and 'x:\jsc.svn\examples\actionscript\svg\FlashHeatZeeker\FlashHeatZeeker.PlayerIOIntegrationBeta2\bin\staging.AssetsLibrary\FlashHeatZeeker.PlayerIOIntegrationBeta2.AssetsLibrary.dll' X:\jsc.svn\examples\actionscript\svg\FlashHeatZeeker\FlashHeatZeeker.PlayerIOIntegrationBeta2\ApplicationSprite.cs 90 45 FlashHeatZeeker.PlayerIOIntegrationBeta2 //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 }); }; } ); }