[Flashcoders] AS3: non-latin characters not displayed
Dear flash coders, I'm porting a small russian card game from AS2 to AS3 and currently struggle with the problem that the playing card (which is a sprite) indices (which are TextFields) do not display cyrillic letters (for jack, queen, king, ace). The digits (7,8,9,10) are displayed just fine. I've searched in internet and reread TextField and TextFormat docs, but can't find a solution. Here is my current code (I have to use embedFonts because the playing cards can be rotated): public class Card extends Sprite { private var index1_txt:TextField, index2_txt:TextField; private static var BLACK:TextFormat = new TextFormat('Arial', 24, 0x00, true); private static var RED:TextFormat = new TextFormat('Arial', 24, 0xFF, true); // static initializer; place 1 closer to 0 in the 10 string { BLACK.letterSpacing = -4; RED.letterSpacing = -4; } public function Card() { . // 2 rank indices in the corners index1_txt = new TextField(); index1_txt.x = 2 - W/2; index1_txt.y = 10 - H/2; index1_txt.width = W/4; index1_txt.height = 22; //index1_txt.defaultTextFormat = BLACK; index1_txt.embedFonts = true; index1_txt.selectable = false; addChild(index1_txt); index2_txt = new TextField(); index2_txt.x = W/2 - 2; index2_txt.y = H/2 - 10; index2_txt.width = W/4; index2_txt.height = 22; index2_txt.rotation = 180; //index2_txt.defaultTextFormat = BLACK; index2_txt.embedFonts = true; index2_txt.selectable = false; addChild(index2_txt); Please help! ;-) Alex ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Frame rate
enter_frame events will cause the plugin to chug quite a lot i'd imagine On Sat, Dec 20, 2008 at 3:46 PM, Cor c...@chello.nl wrote: It depends. Pure AS3, so no timeline at all. If you are using ENTER_FRAME, it is triggered 3 times more often. Otherwise, I guess, it has no effect. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto: flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of e...@hush.com Sent: zaterdag 20 december 2008 16:39 To: flashcoders@chattyfig.figleaf.com Subject: [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 No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 270.9.19/1857 - Release Date: 19-12-2008 10:09 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Frame rate
actually, most browsers won't even allow the flash player to run at a higher rate than 60 (except firefox I think) On Mon, Dec 22, 2008 at 10:43 AM, allandt bik-elliott (thefieldcomic.com) alla...@gmail.com wrote: enter_frame events will cause the plugin to chug quite a lot i'd imagine On Sat, Dec 20, 2008 at 3:46 PM, Cor c...@chello.nl wrote: It depends. Pure AS3, so no timeline at all. If you are using ENTER_FRAME, it is triggered 3 times more often. Otherwise, I guess, it has no effect. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto: flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of e...@hush.com Sent: zaterdag 20 december 2008 16:39 To: flashcoders@chattyfig.figleaf.com Subject: [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 No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 270.9.19/1857 - Release Date: 19-12-2008 10:09 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- M.A. van't Kruis http://www.malatze.nl/ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Frame rate
- Original Message - From: e...@hush.com To: flashcoders@chattyfig.figleaf.com Sent: Saturday, December 20, 2008 3:38 PM Subject: [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. It will presumably vary from little effect to catastrophic slowdown depending on what flash is doing when processing every frame. It's a pretty pointless question if you don't explain why you want to do it and what's going to happen on every frame. I have yet to encounter a project that needs 90FPS and if you do have one then Flash is probably the wrong technology for you. Paul -e ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] cs3 datagrid allow html text from xml doc question
I have an actionscript 3 based datagrid that pulls data from an xml document. All of it is written in as3(no on stage component). I like the as3 version verses the as2 version because of the filter arrays function(I need to allow multiple filters concurrently) but I am having difficulty finding a lot of examples for as3 datagrids. I would like to click on a link to open a web browser. That actually works. The issue I am having is allowing html to render? in the grid. I tried using cdata but I get the entire html (though the link works) ie. url![CDATA[a href=http://www.foo.com;FOO/a]]/url renders in the datagrid as a href=http://www.foo.com;FOO/a I tried looking through as3 documentation to figure out how to use html text in the grid/list but I couldn't find what I needed. Any help would be appreciated. patricia britt ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] cs3 datagrid allow html text from xml doc question
You will have to fool around with creating a cell renderer for your DataGrid instance. Here is something useful that could help you: http://chakramedia.com/blog/2007/11/13/htmltext-with-as3-datagrid/ --- On Mon, 12/22/08, Patricia Britt jeals_...@yahoo.com wrote: From: Patricia Britt jeals_...@yahoo.com Subject: [Flashcoders] cs3 datagrid allow html text from xml doc question To: flashcoders@chattyfig.figleaf.com Date: Monday, December 22, 2008, 4:34 AM I have an actionscript 3 based datagrid that pulls data from an xml document. All of it is written in as3(no on stage component). I like the as3 version verses the as2 version because of the filter arrays function(I need to allow multiple filters concurrently) but I am having difficulty finding a lot of examples for as3 datagrids. I would like to click on a link to open a web browser. That actually works. The issue I am having is allowing html to render? in the grid. I tried using cdata but I get the entire html (though the link works) ie. url![CDATA[a href=http://www.foo.com;FOO/a]]/url renders in the datagrid as a href=http://www.foo.com;FOO/a I tried looking through as3 documentation to figure out how to use html text in the grid/list but I couldn't find what I needed. Any help would be appreciated. patricia britt ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Re: Swf File Use as Interface for Executable
I currently work on an application that is winforms .NET (C#) that the UI is in-part a Flash swf. We use f-in-box (http://www.f-in-box.com/)http://www.f-in-box.com/ as the wrapper and send/receive quite a bit of data between the forms and the swf. We currently have a mixture of using ExternalInterface calls and a socket connection. We implemented the external interface first and found that in some cases it's performance was a bit slow, but it does offer the advantage of synchronous calls, so we (so far) have only migrated performance critical calls to a socket connection. For the most part this scenario works really good and I can easily see doing an entire app this way. Steve On Sun, Dec 21, 2008 at 7:14 PM, Juan Pablo Califano califa010.flashcod...@gmail.com wrote: PS: You might want to check out these links: http://osflash.org/ext_howto http://osflash.org/pipermail/osflash_osflash.org/2005-August/002274.html Cheers Juan Pablo Califano 2008/12/21 Juan Pablo Califano califa010.flashcod...@gmail.com Hi Maybe this helps... Some time ago I run a swf from a .NET app (winforms). I used some wrapper manager code that used C++ code to load a flash player instance. It was an AS 2 swf, though, don't know if it'll work for AS 3. I took the .NET code from a demo posted here, but I just tried the link and it seems to be broken (I'm posting it; maybe it's temporarily down): http://icube.freezope.org/extinter/index.htm Anyway, if you want you can take a look at the code I used. The relevant part is here (the code itself is C#, but I'm sure you'll get the idea): http://code.google.com/p/as2-class-exporter/source/browse/trunk/ASClassExporter/src/EIFlash/EIFlash.cs http://code.google.com/p/as2-class-exporter/source/browse/trunk/ASClassExporter/src/EIFlash/AxShockwaveFlashObjects.cs You can find the .dlls used here: http://code.google.com/p/as2-class-exporter/source/browse/#svn/trunk/AS2_ClassExporter_Front/bin/Release (stdole.dll, ShockwaveFlashObjects.dll, AxShockwaveFlashObjects.dll) Cheers Juan Pablo Califano 2008/12/21 Kelly Snyder ksnyder1...@hotmail.com My intention is to run this from a compiled C++ application on a Windows desktop - so sockets and servers should not come into play. I will look at my options for using COM with C++; if I remember correctly, this was how it used to be done in Actionscript 2. Thanks, Kelly _ Life on your PC is safer, easier, and more enjoyable with Windows Vista(R). http://clk.atdmt.com/MRT/go/127032870/direct/01/___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Flash AS3 debugging
Hi list... I'm getting used to AS3, but debugging isn't updating the stage as I step through. Actually, nothing is rendered at all, even though I'm stopping at a point where things should be on the stage. Am I doing something wrong? Thanks, - Michael M. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Flash AS3 debugging
I'm getting used to AS3, but debugging isn't updating the stage as I step through. Actually, nothing is rendered at all, even though I'm stopping at a point where things should be on the stage. Am I doing something wrong? Yes. (please provide more info, you could be doing ANYTHING wrong, how could we possibly guess? :) ) Jason Merrill Bank of America Instructional Technology Media · GCIB Staff Support LLD Interested in Flash Platform technologies? Join the Bank of America Flash Platform Developer Community Interested in innovative ideas in Learning? Check out the Innovative Learning Blog and subscribe. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Flash AS3 debugging
Does what you expect to appear appear when you just run the code? if not maybe it's your code. Could you make a small example of adding something to the stage and test that? Paul - Original Message - From: Mendelsohn, Michael michael.mendels...@fmglobal.com To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Monday, December 22, 2008 4:22 PM Subject: [Flashcoders] Flash AS3 debugging Hi list... I'm getting used to AS3, but debugging isn't updating the stage as I step through. Actually, nothing is rendered at all, even though I'm stopping at a point where things should be on the stage. Am I doing something wrong? Thanks, - Michael M. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Flash AS3 debugging
[Windows XP, CS3] I stopped it at a point where everything is rendered on the screen. I can see it all fine, then I go back to the debug console, and click step into, and then I alt+tab back to the swf window, and everything has vanished from the stage. Does this situation sound familiar? At the end of renderQuatrants() is where I stop it. - MM private function keyListener(k:KeyboardEvent):void { q = new Quadrants(2880, 864); addChild(q); stage.addEventListener(KeyboardEvent.KEY_UP, q.renderQuadrants); } public function renderQuadrants(k:KeyboardEvent):void { if (k.keyCode == 32) { k.target.stage.removeEventListener(KeyboardEvent.KEY_UP, renderQuadrants); getDataFirst(); // focus is setable after it's all been added to the stage display list. k.target.stage.focus = fields[0]; -DEBUG STOP HERE } } private function getDataFirst():void { dataInputs = new Sprite(); fields = []; var locs:Array = [new Point(900,300), new Point(1500,300), new Point(50,200), new Point(200,200)]; //set up quadrant data inputs var i_debate:TextField = new TextField(); fields.push(i_debate); var i_lead:TextField = new TextField(); fields.push(i_lead); var i_listen:TextField = new TextField(); fields.push(i_listen); var i_support:TextField = new TextField(); fields.push(i_support); for (var i:uint = 0; ifields.length; i++) { fields[i].tabEnabled = true; fields[i].type = TextFieldType.INPUT; fields[i].x = locs[i].x; fields[i].y = locs[i].y; fields[i].width = 100; fields[i].height = 40; fields[i].restrict = 1234567890; fields[i].embedFonts = true; fields[i].defaultTextFormat = tf; fields[i].maxChars = 3; fields[i].border = true; fields[i].borderColor = 0x00FF00; fields[i].background = true; fields[i].backgroundColor = 0x00; dataInputs.addChild(fields[i]); //fields[i].addEventListener(Event.CHANGE, displayInput); } goButton = new QuadrantGoButton(); goButton.x = 500; goButton.y = 500; goButton.addEventListener(MouseEvent.MOUSE_UP, displayData); dataInputs.addChild(goButton); addChild(dataInputs); } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] RE: Flash AS3 debugging
This image might help you visualize what occurs internally with Flash Player AV2M on each frame: http://www.craftymind.com/wp-content/uploads/2008/04/marshalledsliceexport.png And this is the article at length: http://www.craftymind.com/2008/04/18/updated-elastic-racetrack-for-flash-9-and-avm2/ But basically, if you have, for example, a loop in your code that changes the Y position of a bunch of clips and you step line-by-line through your code with the debugger, it will iterate over the clips one by one without anything changing on screen - even though their Y positions are being changed. This is because all code for that one specific frame within your flash movie must first execute before the screen will render any changes. It's a 1-2 process; All code for a frame, then all rendering (drawing) for a frame. This may be what you are talking about. SF. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] RE: Flash AS3 debugging
Thanks, that's a great article...but this is a really weird issue. It might be some sort of Windows bug. I hit a break point, things are rendered on the stage. As soon as I click stepIn in the debug console, the swf window crashes (not responding). - MM ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Custom buttons - radio style
Listers,As an experienced AS2 coder, and a very new AS3 coder, I'm having trouble writing some classes.Since I work with a few Flash designers, I'm hoping that I can create some classes that would automatically add functionality to interactive programs that they are designing.The current project's design calls for a left nav with custom buttons. Each of these buttons (movieclips) have UP, OVER, and DOWN states (as labels). As a button is selected by the user, that button will remain in DOWN state and lose its functionality (via several removeEventListeners). Then as a different button is selected from the left nav, I would like it to enter a DOWN state, and also trigger an event that would make the initial button move to its UP state and gain functionality once again.I have a MainNav class that provides all the functionality for the buttons. My designers would simply name the stage instance to MainNav1_MainLabel1 and link the button movieclips to my class. My class will dissect the instance name to to two items: the button's name and the label that the root should gotoAndStop. I however have yet to figure out how to implement the communication that changes the earlier depressed button back to the UP state when another button is clicked. How should I implement this communication? via the document class? make a event class?Another part of this story is that when the root goes to another label, often times the screen will have subNav buttons which will also work in this custom radio fashion. It would be nice if I could use the same classes.Thanks for your timeany hints or pointers are appreciatedJim _ Life on your PC is safer, easier, and more enjoyable with Windows Vista®. http://clk.atdmt.com/MRT/go/127032870/direct/01/___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Custom buttons - radio style
I'd say you need to wrap the system in a RadioControl class of some sort. This is a group class and knows of all the radio buttons that are affected as part of this group. That was you can have a second group if you need it. This class can have a currentSelection variable which stores whatever is clicked. Right before you change its value though, you first reset its contents Eg: private function onClick(e:MouseEvent):void { if (currentSelection) { currentSelection.mouseEnabled = true; currentSelection.goToAndStop(up); } currentSelection = e.currentTarget; currentSelection.goToAndStop(down); currentSelection.mouseEnabled = false; } I'm not entirely sure how you can connect things from the Flash library. I'd generate the buttons from the group class. However you could put all the buttons into a movieclip and type as the group class. I guess you can then run through the names and assign listeners. THat may not be the best though. Ashim 2008/12/23 jim skolmoski skol...@hotmail.com Listers,As an experienced AS2 coder, and a very new AS3 coder, I'm having trouble writing some classes.Since I work with a few Flash designers, I'm hoping that I can create some classes that would automatically add functionality to interactive programs that they are designing.The current project's design calls for a left nav with custom buttons. Each of these buttons (movieclips) have UP, OVER, and DOWN states (as labels). As a button is selected by the user, that button will remain in DOWN state and lose its functionality (via several removeEventListeners). Then as a different button is selected from the left nav, I would like it to enter a DOWN state, and also trigger an event that would make the initial button move to its UP state and gain functionality once again.I have a MainNav class that provides all the functionality for the buttons. My designers would simply name the stage instance to MainNav1_MainLabel1 and link the button movieclips to my class. My class will dissect the instance name to to two items: the button's name and the label that the root should gotoAndStop. I however have yet to figure out how to implement the communication that changes the earlier depressed button back to the UP state when another button is clicked. How should I implement this communication? via the document class? make a event class?Another part of this story is that when the root goes to another label, often times the screen will have subNav buttons which will also work in this custom radio fashion. It would be nice if I could use the same classes.Thanks for your timeany hints or pointers are appreciatedJim _ Life on your PC is safer, easier, and more enjoyable with Windows Vista(R). http://clk.atdmt.com/MRT/go/127032870/direct/01/___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- The Random Lines My online portfolio www.therandomlines.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3: non-latin characters not displayed
Thanks but neither On Mon, Dec 22, 2008 at 2:18 PM, Cor c...@chello.nl wrote: Change the indexN_txt.defaultTextFormat = BLACK; into indexN_txt.setTextFormat(BLACK); nor Quick guess: set indexN_txt.embedFonts = true; right after the ... NewTextField(); have worked for me. I've ended up putting an invisible TextField at the Stage and embeding the Arial-font in it (the Times New Roman that I actually wanted refused to display russian :-( I've also seen stuff like [Embed(source='ARIAL.TTF' , unicodeRange='U+0410-U+042F , U+0430-U+0451' , fontWeight='normal' , fontStyle='normal')] but it seems to be meant for Flex only? I've put my source code here: http://preferans.de/flash/ - if you click few times you'll see that the russian equivalents for J,Q,K,A won't display Regards Alex ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders