[Flashcoders] custom contextual menu
Hey everyone, I'm getting an error here on this line: _customMenuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, function() { menuItemSelected(event:ContextMenuEvent, _i:uint) } ); here is the code ... any ideas? package com.Browser { import flash.display.Sprite; import flash.events.ContextMenuEvent; import flash.net.URLRequest; import flash.net.navigateToURL; import flash.ui.ContextMenu; import flash.ui.ContextMenuItem; public class ContextualMenu extends Sprite { private var _menuItemLabels:Array = ["Google", "Yahoo", "Ask"]; private var _menuItemURLs:Array = ["http://www.google.com";, "http://www.yahoo.com";, "http://www.ask.com";]; private var _contextualMenu:ContextMenu; public function ContextualMenu() { _contextualMenu = new ContextMenu(); _contextualMenu.hideBuiltInItems(); for (var _i:uint = 0; _i < _menuItemLabels.length; _i++) { var _customMenuItem:ContextMenuItem = new ContextMenuItem(_menuItemLabels[_i]); _customMenuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, function() { menuItemSelected(event:ContextMenuEvent, _i:uint) } ); _contextualMenu.customItems.push(_customMenuItem); } this.contextMenu = _contextualMenu; } private function menuItemSelected(evt:ContextMenuEvent, URLArrayPosition:uint):void { var _req:URLRequest = new URLRequest(_menuItemURLs[URLArrayPosition]); navigateToURL(_req, '_blank'); } } } -- Click to become a master chef, own a restaurant and make millions. http://tagline.hushmail.com/fc/PnY6qxtWo9EITXxhgoD6rzH9gpAnEse9ndywh4dJme1GA94J7kAGr/ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Frame rate
In a pure AS3 project with a very small file size, what is the effect of a frame rate of 90 or above versus the standard 30. Size, performance, "look", etc. Thanks everyone. -e -- Free information on becoming a Graphic Designer. Click Now! http://tagline.hushmail.com/fc/PnY6qxunKhpGlY7xU2RLPWl9oeVffVk6oqkFlKDEWccoIaJ1UeB8T/ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Preloader not showing up
Any idea why there are no errors but my preloader does not show up on the stage? I have commented out the call to remove it and addChild the main website for testing purposes ... package { // Flash Classes import flash.display.*; import flash.events.*; import flash.net.*; [SWF(backgroundColor="#58585A", width="1000", height="600", frameRate="30", quality="HIGH")] public class preloader extends Sprite { private var _loader:Loader; private var _preloader:Sprite; private var _request:URLRequest; private var _main:* = null; // Preload External SWF with a Preloader Bar public function preloader() { _preloader = new Sprite(); _preloader.graphics.beginFill(0x00, 1); _preloader.graphics.drawRect(0, 0, 400, 1); _preloader.graphics.endFill(); _preloader.x = (stage.stageWidth - _preloader.width) / 2; _preloader.y = (stage.stageHeight - _preloader.height) / 2; _preloader.scaleX = 0; _loader = new Loader(); _request = new URLRequest("main.swf"); addChild(_preloader); _loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError); _loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress); _loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete); try { _loader.load(_request); } catch (error:SecurityError) { trace(error); } } // Display Load Progress private function loadProgress(event:ProgressEvent):void { var percentLoaded:Number = event.bytesLoaded/event.bytesTotal; _preloader.scaleX = percentLoaded; } // Loading is Complete private function loadComplete(event:Event = null):void { _main = _loader.content; initMain(); } // Main Post-Load Function private function initMain():void { //removeChild(_preloader); //addChild(_main); } private function ioError(event:IOErrorEvent):void { trace(event); } } } -- Click for free info on getting an MBA, $200K/ year potential. http://tagline.hushmail.com/fc/PnY6qxsZwUO5pG5CVtxb0vjaqHc2pQZU8KxeuZzCNRjEbyMa6YniX/ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Embedding bitmap/pixel fonts with pure AS3
It is a non-bold 8 pixel bitmap font. Here is my code. package { // Flash Packages import flash.display.Sprite; import flash.display.StageScaleMode; import flash.events.*; import flash.text.TextField; import flash.text.TextFormat; import flash.text.StyleSheet; // Setup the SWF Properties [SWF(backgroundColor="#FF", frameRate="30", width="1000", height="600", quality="HIGH")] public class EmbedFont extends Sprite { // Embed Silkscreen Bitmap Font [Embed(source="assets/fonts/silkscreen.ttf", fontName="mySilkscreen", mimeType="application/x-font-truetype")] private var mySilkscreen:Class; private var _mySilkscreenFormat:TextFormat; private var _myEmbedBitmapText:TextField; private var _container:Sprite; public function EmbedFont() { stage.scaleMode = StageScaleMode.NO_SCALE; _mySilkscreenFormat = new TextFormat(); _mySilkscreenFormat.font = "mySilkscreen"; _mySilkscreenFormat.size = 8; _myEmbedBitmapText = new TextField(); _myEmbedBitmapText.text = "this is silkscreen"; _myEmbedBitmapText.setTextFormat(_mySilkscreenFormat); addChild(_myEmbedBitmapText); } } } -- Write, shoot, direct, edit your own movies. Click here to request information. http://tagline.hushmail.com/fc/PnY6qxsZP8W6bEoKKL58CZrfALeP0WmZbBPYJmUoSCkIf4C5fyeFh/ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Embedding bitmap/pixel fonts with pure AS3
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'm using: http://pastebin.com/ded811b0 to embed my pixel font, but no errors and not working, displays as an ugly little default font. Any ideas? Purely AS3 please, no asset linking in flash please? :p - -e -BEGIN PGP SIGNATURE- Charset: UTF8 Version: Hush 3.0 Note: This signature can be verified at https://www.hushtools.com/verify wpwEAQMCAAYFAklAZkQACgkQJz1LFzHW7Hok5QP/S/O/a7Gootk/mzWssvOXanJeRmDA 1lgnvytjA2B2sThaFWe+eB7z+LTXhLzO7sTqLEUGRfxkKRxCmysS6pDbsrudgsiY/wv5 z/gARWKlHTR2WT1YQ1AB5Hfn3o3Z9ZZgzN1gRYCCu7iEPcBwRNTcRb68TRMJF2DyMfrX go9dJf4= =KCtY -END PGP SIGNATURE- -- Start a rewarding Medical Transcriptionist career. Click to find affordable and flexible programs. http://tagline.hushmail.com/fc/PnY6qxthN5Ots8FkC7r4DaavDyptQf0YLvzhvWezaFYyk9EIodogX/ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Simple ActionScript Project OOP Question
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I have a package that I know works. It displays an Audio Player on the stage. I moved it from src/ to a folder for packages. The project builds no sweat. However, I do not see the AudioPlayer on the stage. The package is AudioBuilder. Here is my AS for my Actionscript Project. Any idea why I do not see my AudioPlayer? package { // Flash Packages import flash.display.Sprite; import flash.events.*; import flash.display.StageScaleMode; // My Packages import com.Audio.AudioPlayer; // Setup the SWF Properties [SWF(backgroundColor="#FF", frameRate="30", width="1000", height="600", quality="HIGH")] public class Website extends Sprite { public function Website():void { stage.scaleMode = StageScaleMode.NO_SCALE; var _container:Sprite = new Sprite(); var _MusicPlayer:AudioPlayer = new AudioPlayer(); stage.addChild(_MusicPlayer); } } } -BEGIN PGP SIGNATURE- Charset: UTF8 Version: Hush 3.0 Note: This signature can be verified at https://www.hushtools.com/verify wpwEAQMCAAYFAklAJxkACgkQJz1LFzHW7HpRCQP+OqxWLDrJ3OBDVm/nfuUexyHpoCN3 xNGytacO4NAjtycIhjOSXDQTMIG1Huak4Ye10MSLyyJlhbC4oRos8NmGfcaXHZ+bjkmq 1egeHEE9WSXT3VJLzb4umK9helGnRSTRSNA6zNFGFwIr2doI6iT6P9QKMTlCtTskX//e FEWZfS4= =BOSf -END PGP SIGNATURE- -- Are you a natural healer? Refine your skills at a Massage Therapy School. http://tagline.hushmail.com/fc/PnY6qxsbdbPOZlDS30YvRgc8GfTxoU9Etj5SAYR8nGU6U26brfkNB/ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders