[Flashcoders] AS3 text fitting in variable box
I need to place project-titles in a multiline textfield, wherof the width will be fixed, but sometimes this box might be of less height because of more space used by other displaying project elements. Is there a class that can dynamically regulate the font it's size to fit the loaded text to a certian textfield height of a multile textfield? The project titles are variable in character word length. How is this solvable. Thanks ! Stijn ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Texfield.htmlText + Arial + balise b/b = nothing, keud
Hi I'm using simple Arial font in a dynamic textfield set to html = true. the br balise is understood but nothing happen for the bold one anyidea why ?? thx L ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Texfield.htmlText + Arial + balise b/b = nothing, keud
H so nice :) Thank you L Glen Pike a écrit : Hi, If you want Bold text, you have to embed the font in bold too - if you are using a font symbol in the library, you will have to create another in bold, etc. Same with Italic. Glen laurent wrote: Hi I'm using simple Arial font in a dynamic textfield set to html = true. the br balise is understood but nothing happen for the bold one anyidea why ?? thx L ___ 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
Re: [Flashcoders] AS3 text fitting in variable box
Sounds like a bad design decision to make titles of the same category various sizes. But I think you can just set the .width property, then set the .scaleY equal to the .scaleX or visa versa depending on which dimension is more important. On Wed, Nov 12, 2008 at 9:40 AM, Latcho [EMAIL PROTECTED] wrote: I need to place project-titles in a multiline textfield, wherof the width will be fixed, but sometimes this box might be of less height because of more space used by other displaying project elements. Is there a class that can dynamically regulate the font it's size to fit the loaded text to a certian textfield height of a multile textfield? The project titles are variable in character word length. How is this solvable. Thanks ! Stijn ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- --Joel ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Texfield.htmlText + Arial + balise b/b = nothing, keud
Hi, If you want Bold text, you have to embed the font in bold too - if you are using a font symbol in the library, you will have to create another in bold, etc. Same with Italic. Glen laurent wrote: Hi I'm using simple Arial font in a dynamic textfield set to html = true. the br balise is understood but nothing happen for the bold one anyidea why ?? thx L ___ 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] ComboBox + Custom Cursor , AS3
Karim, Try adding the following line of code to your MOUSE_MOVE event listener function: stage.addChildAt(customCursor, stage.numChildren); Of course, you must substitute your custom cursor's instance name for 'customCursor'. HTH Regards, -Keith http://keithreinfeld.home.comcast.net ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] ComboBox + Custom Cursor , AS3
Some other way... but will look into CursorManager Thanks Karim -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Hall Sent: 12 November 2008 13:01 To: Flash Coders List Subject: Re: [Flashcoders] ComboBox + Custom Cursor , AS3 Are you using CursorManager or adding the cursor in some other way? Peter On Wed, Nov 12, 2008 at 12:42 PM, Karim Beyrouti [EMAIL PROTECTED] wrote: Hello All - I am a little stumped by this one. I am using a custom cursor ( added to the stage ), one of my loaded SWF's has a drop down comboBox - The problem: The List gets added to the stage and goes over the custom mouse cursor. Do you guys know of any fixes for this one? Regards Karim Beyrouti ___ 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
Re: [Flashcoders] AS3 text fitting in variable box
I'm talking about font size, not stretching a container. Increasing / decreasing font size to get an optimal fill of a box which will have a fixed width and a certain height which can only be determined during load time. I could increase the font size of a textfield in a loop and measure it's height on every point increase; when it overflows my wanted box-height I take the font size of the previous step. Is there an easier way ? Stijn Joel Stransky wrote: Sounds like a bad design decision to make titles of the same category various sizes. But I think you can just set the .width property, then set the .scaleY equal to the .scaleX or visa versa depending on which dimension is more important. On Wed, Nov 12, 2008 at 9:40 AM, Latcho [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I need to place project-titles in a multiline textfield, wherof the width will be fixed, but sometimes this box might be of less height because of more space used by other displaying project elements. Is there a class that can dynamically regulate the font it's size to fit the loaded text to a certian textfield height of a multile textfield? The project titles are variable in character word length. How is this solvable. Thanks ! Stijn ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com mailto:Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- --Joel ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] ComboBox + Custom Cursor , AS3
Hello All - I am a little stumped by this one. I am using a custom cursor ( added to the stage ), one of my loaded SWF's has a drop down comboBox - The problem: The List gets added to the stage and goes over the custom mouse cursor. Do you guys know of any fixes for this one? Regards Karim Beyrouti ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Masks when Zooming in I.E. 7
I'm still looking for an anwer to this -- has anybody encountered this before? I created a swf that has several layers of translucent clouds moving beneath masks. The masks are assigned via ActionScript 2.0 and the cloud motion is also scripted. When this movie is zoomed 150% or larger in I.E. 7, the clouds become nearly opaque. Anyone know what it is about zooming in I.E. 7 that would cause masked translucent objects to become nearly opaque? TIA, Marc ___ 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] Texfield.htmlText + Arial + balise b/b = nothing, keud
Try to create a second textfield, invisible, with bold checked. Flash engine uses it to get embedded fonts, even you don't use it. I don't know if my workaround is a quite dirty, but it works =) Best Pinatti On Wed, Nov 12, 2008 at 12:47 PM, laurent [EMAIL PROTECTED] wrote: Hi I'm using simple Arial font in a dynamic textfield set to html = true. the br balise is understood but nothing happen for the bold one anyidea why ?? thx L ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Fábio Pinatti :: web.developer www.pinatti.com.br :: 19. 9184.3745 / 3342.1130 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 text fitting in variable box
Is there an important distinction between scaling a TextField object and changing the font size? Perhaps you are storing the formatting or there are visual rendering implications or anything?? Otherwise, it seems like Joel's solution would work nicely to achieve what you want. -jonathan On Wed, Nov 12, 2008 at 6:18 PM, Latcho [EMAIL PROTECTED] wrote: I'm talking about font size, not stretching a container. Increasing / decreasing font size to get an optimal fill of a box which will have a fixed width and a certain height which can only be determined during load time. I could increase the font size of a textfield in a loop and measure it's height on every point increase; when it overflows my wanted box-height I take the font size of the previous step. Is there an easier way ? Stijn Joel Stransky wrote: Sounds like a bad design decision to make titles of the same category various sizes. But I think you can just set the .width property, then set the .scaleY equal to the .scaleX or visa versa depending on which dimension is more important. On Wed, Nov 12, 2008 at 9:40 AM, Latcho [EMAIL PROTECTED] mailto: [EMAIL PROTECTED] wrote: I need to place project-titles in a multiline textfield, wherof the width will be fixed, but sometimes this box might be of less height because of more space used by other displaying project elements. Is there a class that can dynamically regulate the font it's size to fit the loaded text to a certian textfield height of a multile textfield? The project titles are variable in character word length. How is this solvable. Thanks ! Stijn ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com mailto:Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- --Joel ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- -jonathan howe ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] automatically declared stage instances and loaded .swf's
My movie is working, I just don't understand why exactly. At gotoandlearn.com, Lee Brimelow makes the case of using a container .swf to load content due to document classes and the classes it references to be compiled into frame 1. http://gotoandlearn.com/play?id=85 Cool, fair enough. But this basically means that your container has to work as a content manager as well. That's not such a big deal since I was used to making my as2 main movies handle both tasks. The first issue that arose however is the #1056 errors I started getting when content movies contained stage instances. Depending on your Automatically declare stage instances setting, an .fla will make stage children with instance names available to the document class. But when this same .swf is loaded into a parent, you'll get the error message Cannot create property instance name on document class. I'll get to the work around in a sec. In Flash CS3, under File - Publish Settings - Flash - ActionScript Version - Settings - Stage, Automatically declare stage instances is checked by default. This basically means you'll be able to reference those instances through variables of the same name automatically. Unchecked, you'll have to declare a *public* var of your instance name in the document class. For example: //if you have a movie clip on the stage named myClip your document class will look like package{ import flash.display.MovieClip; public class MyDocumentClass extends MovieClip{ public var myClip:MovieClip; // must use the public keyword public function MyDocumentClass(){ } } } The issue is, if you plan on loading your .swf's into a parent movie, you must declare that variable regardless of your Automatically declare stage instances setting. Colin Moock recommends the unchecked method. Just remember, if checked and manually declared, you'll only be able to run the movie when loaded into a parent. So my advice there is to always uncheck. My question then, why exactly do you have to declare a stage instance in a content movie as public manually? I know it has something to do with who's display list it is on but I don't quite understand how that heirarchy forces this issue. Sorry so long winded. -- --Joel stranskydesign.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] ComboBox + Custom Cursor , AS3
Oh yes sorry, it's Flex. Peter On Wed, Nov 12, 2008 at 1:26 PM, Karim Beyrouti [EMAIL PROTECTED] wrote: Did not find it in Docs, so googled it - and it's a Flex thing no?... Using flash CS3... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Hall Sent: 12 November 2008 13:01 To: Flash Coders List Subject: Re: [Flashcoders] ComboBox + Custom Cursor , AS3 Are you using CursorManager or adding the cursor in some other way? Peter On Wed, Nov 12, 2008 at 12:42 PM, Karim Beyrouti [EMAIL PROTECTED] wrote: Hello All - I am a little stumped by this one. I am using a custom cursor ( added to the stage ), one of my loaded SWF's has a drop down comboBox - The problem: The List gets added to the stage and goes over the custom mouse cursor. Do you guys know of any fixes for this one? Regards Karim Beyrouti ___ 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 mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Fwd: Re: [Flashcoders] AS3 text fitting in variable box]
Hi Joel, Jonathan anf Dave for your answers Dave could you explain what you mean with a binary search ? Stijn David Hershberger wrote: Text flow of variable-width fonts with word-wrapping is inherently messy... there's no way to compute the number of lines with some nice math, you just have to run the text-flow machinery and measure the result, which is exactly what you have suggested. I'm pretty certain there is nothing built into flash or flex to choose a font size for you automatically. My only suggestion is a speed optimization: use a binary search instead of trying every font size. Dave On 11/12/08, *Latcho* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I'm talking about font size, not stretching a container. Increasing / decreasing font size to get an optimal fill of a box which will have a fixed width and a certain height which can only be determined during load time. I could increase the font size of a textfield in a loop and measure it's height on every point increase; when it overflows my wanted box-height I take the font size of the previous step. Is there an easier way ? Stijn Joel Stransky wrote: Sounds like a bad design decision to make titles of the same category various sizes. But I think you can just set the .width property, then set the .scaleY equal to the .scaleX or visa versa depending on which dimension is more important. On Wed, Nov 12, 2008 at 9:40 AM, Latcho [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I need to place project-titles in a multiline textfield, wherof the width will be fixed, but sometimes this box might be of less height because of more space used by other displaying project elements. Is there a class that can dynamically regulate the font it's size to fit the loaded text to a certian textfield height of a multile textfield? The project titles are variable in character word length. How is this solvable. Thanks ! Stijn ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com mailto:Flashcoders@chattyfig.figleaf.com mailto:Flashcoders@chattyfig.figleaf.com mailto:Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- --Joel ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com mailto: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
[Fwd: Re: [Flashcoders] AS3 text fitting in variable box]
Joel, Jonathan and Dave: thanks for your answers Dave could you explain what you mean with a binary search ? I haven't got a clue. Stijn David Hershberger wrote: Text flow of variable-width fonts with word-wrapping is inherently messy... there's no way to compute the number of lines with some nice math, you just have to run the text-flow machinery and measure the result, which is exactly what you have suggested. I'm pretty certain there is nothing built into flash or flex to choose a font size for you automatically. My only suggestion is a speed optimization: use a binary search instead of trying every font size. Dave On 11/12/08, *Latcho* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I'm talking about font size, not stretching a container. Increasing / decreasing font size to get an optimal fill of a box which will have a fixed width and a certain height which can only be determined during load time. I could increase the font size of a textfield in a loop and measure it's height on every point increase; when it overflows my wanted box-height I take the font size of the previous step. Is there an easier way ? Stijn Joel Stransky wrote: Sounds like a bad design decision to make titles of the same category various sizes. But I think you can just set the .width property, then set the .scaleY equal to the .scaleX or visa versa depending on which dimension is more important. On Wed, Nov 12, 2008 at 9:40 AM, Latcho [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I need to place project-titles in a multiline textfield, wherof the width will be fixed, but sometimes this box might be of less height because of more space used by other displaying project elements. Is there a class that can dynamically regulate the font it's size to fit the loaded text to a certian textfield height of a multile textfield? The project titles are variable in character word length. How is this solvable. Thanks ! Stijn ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com mailto:Flashcoders@chattyfig.figleaf.com mailto:Flashcoders@chattyfig.figleaf.com mailto:Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- --Joel ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com mailto: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] AS3 text fitting in variable box
No problem. A binary search is an order log(N) method for finding something in an ordered list of elements, as compared to linear search, which is order N. (N is the number of elements, in this case, font sizes you are willing to use.) You have a sequence of font sizes. For each size, it either makes the TextField too tall, or it doesn't. You want to find the biggest size which isn't too tall. The linear approach is to start from one end of the font size list or the other and try sizes one by one until the TextField height crosses the threshold. The binary approach is to try both ends first, say 1 and 50. If 1 is too big or 50 is too small, you already have your answer. If not, try the middle: 25. If 25 is too big, move your idea of biggest down to 25, and try the middle between 25 and 1: 13. Maybe 13 is too small, so change your idea of smallest to 13. Then try the middle between 13 and 25: 19, and so on. Once the two ends (smallest and biggest) are adjacent elements (say one point difference in font size), the one marked smallest is your answer. Binary search is only a little more complicated than a linear search to implement, and if you are searching over a large number of font sizes, the savings can be significant. If it's just 4 or 5 font sizes it's probably not worth the trouble. Binary search is a very classic computer science algorithm, so I'm sure you can find good descriptions on the web. Dave On 11/12/08, Latcho [EMAIL PROTECTED] wrote: Hi Joel, Jonathan anf Dave for your answers Dave could you explain what you mean with a binary search ? Stijn David Hershberger wrote: Text flow of variable-width fonts with word-wrapping is inherently messy... there's no way to compute the number of lines with some nice math, you just have to run the text-flow machinery and measure the result, which is exactly what you have suggested. I'm pretty certain there is nothing built into flash or flex to choose a font size for you automatically. My only suggestion is a speed optimization: use a binary search instead of trying every font size. Dave On 11/12/08, Latcho [EMAIL PROTECTED] wrote: I'm talking about font size, not stretching a container. Increasing / decreasing font size to get an optimal fill of a box which will have a fixed width and a certain height which can only be determined during load time. I could increase the font size of a textfield in a loop and measure it's height on every point increase; when it overflows my wanted box-height I take the font size of the previous step. Is there an easier way ? Stijn Joel Stransky wrote: Sounds like a bad design decision to make titles of the same category various sizes. But I think you can just set the .width property, then set the .scaleY equal to the .scaleX or visa versa depending on which dimension is more important. On Wed, Nov 12, 2008 at 9:40 AM, Latcho [EMAIL PROTECTED] mailto: [EMAIL PROTECTED] wrote: I need to place project-titles in a multiline textfield, wherof the width will be fixed, but sometimes this box might be of less height because of more space used by other displaying project elements. Is there a class that can dynamically regulate the font it's size to fit the loaded text to a certian textfield height of a multile textfield? The project titles are variable in character word length. How is this solvable. Thanks ! Stijn ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com mailto:Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- --Joel ___ 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] Regions of JPEG into BitmapData
You have to use the clipRect parameter and pass a Rectangle specifying what area you want to copy. Cheers Juan Pablo Califano 2008/11/12, John Giotta [EMAIL PROTECTED]: I'm trying to figure out how grab specified regions of a JPEG and draw a Bitmap from them. So if the user outlines a rectanglur area of the JPEG at say x=100, y= 35, width=90, height=20; I want to duplicate it into a Bitmap object. I thought (but obviously wrong) that I use Matrix to translate position. ___ 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] Regions of JPEG into BitmapData
I'm trying to figure out how grab specified regions of a JPEG and draw a Bitmap from them. So if the user outlines a rectanglur area of the JPEG at say x=100, y= 35, width=90, height=20; I want to duplicate it into a Bitmap object. I thought (but obviously wrong) that I use Matrix to translate position. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 text fitting in variable box
The distinction is that wordwrapping should be optimal, as you know when you increase / decrease a fontsize, the wordwrapping changes. jonathan howe wrote: Is there an important distinction between scaling a TextField object and changing the font size? Perhaps you are storing the formatting or there are visual rendering implications or anything?? Otherwise, it seems like Joel's solution would work nicely to achieve what you want. -jonathan On Wed, Nov 12, 2008 at 6:18 PM, Latcho [EMAIL PROTECTED] wrote: I'm talking about font size, not stretching a container. Increasing / decreasing font size to get an optimal fill of a box which will have a fixed width and a certain height which can only be determined during load time. I could increase the font size of a textfield in a loop and measure it's height on every point increase; when it overflows my wanted box-height I take the font size of the previous step. Is there an easier way ? Stijn Joel Stransky wrote: Sounds like a bad design decision to make titles of the same category various sizes. But I think you can just set the .width property, then set the .scaleY equal to the .scaleX or visa versa depending on which dimension is more important. On Wed, Nov 12, 2008 at 9:40 AM, Latcho [EMAIL PROTECTED] mailto: [EMAIL PROTECTED] wrote: I need to place project-titles in a multiline textfield, wherof the width will be fixed, but sometimes this box might be of less height because of more space used by other displaying project elements. Is there a class that can dynamically regulate the font it's size to fit the loaded text to a certian textfield height of a multile textfield? The project titles are variable in character word length. How is this solvable. Thanks ! Stijn ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com mailto:Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- --Joel ___ 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] automatically declared stage instances and loaded .swf's
Hi, I ran into this issue the other day with the base class linkage ID too. Finally got my head around the base class idea - I was working on the principle that my custom super class should be the base class to my specific custom classes - in a polymorphic kind of way, but finally realised that base class was at the top of my class parentage - a bit dumb of me, but I guess this fact may be a bit ambiguous. Anyway, I was trying to get my instances of clips placed at author-time wired up automatically at run-time in my custom class, but was torn between the declare or not-declare method. Eventually it was forced on me and I encountered the same error as you when trying to declare them as private in AS... I don't mind declaring my stage instances in AS, but the problem I have is making them public. I am trying to work in an OOP way and encapsulate my clip properties and methods, therefore it should be none of any other class's damn business what is contained within my clip if I don't want to tell. My point is, whether I drop my objects on stage, or create them in AS, I should be able to make them private. I also don't understand why they have to be public and would like to know. Until then, I am probably going to have to workaround it... Not much help to you, but fuel for the fire... Glen My question then, why exactly do you have to declare a stage instance in a content movie as public manually? I know it has something to do with who's display list it is on but I don't quite understand how that heirarchy forces this issue. Sorry so long winded. -- Glen Pike 01326 218440 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] ComboBox + Custom Cursor , AS3
Did not find it in Docs, so googled it - and it's a Flex thing no?... Using flash CS3... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Hall Sent: 12 November 2008 13:01 To: Flash Coders List Subject: Re: [Flashcoders] ComboBox + Custom Cursor , AS3 Are you using CursorManager or adding the cursor in some other way? Peter On Wed, Nov 12, 2008 at 12:42 PM, Karim Beyrouti [EMAIL PROTECTED] wrote: Hello All - I am a little stumped by this one. I am using a custom cursor ( added to the stage ), one of my loaded SWF's has a drop down comboBox - The problem: The List gets added to the stage and goes over the custom mouse cursor. Do you guys know of any fixes for this one? Regards Karim Beyrouti ___ 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
Re: [Flashcoders] AS3 text fitting in variable box
Text flow of variable-width fonts with word-wrapping is inherently messy... there's no way to compute the number of lines with some nice math, you just have to run the text-flow machinery and measure the result, which is exactly what you have suggested. I'm pretty certain there is nothing built into flash or flex to choose a font size for you automatically. My only suggestion is a speed optimization: use a binary search instead of trying every font size. Dave On 11/12/08, Latcho [EMAIL PROTECTED] wrote: I'm talking about font size, not stretching a container. Increasing / decreasing font size to get an optimal fill of a box which will have a fixed width and a certain height which can only be determined during load time. I could increase the font size of a textfield in a loop and measure it's height on every point increase; when it overflows my wanted box-height I take the font size of the previous step. Is there an easier way ? Stijn Joel Stransky wrote: Sounds like a bad design decision to make titles of the same category various sizes. But I think you can just set the .width property, then set the .scaleY equal to the .scaleX or visa versa depending on which dimension is more important. On Wed, Nov 12, 2008 at 9:40 AM, Latcho [EMAIL PROTECTED] mailto: [EMAIL PROTECTED] wrote: I need to place project-titles in a multiline textfield, wherof the width will be fixed, but sometimes this box might be of less height because of more space used by other displaying project elements. Is there a class that can dynamically regulate the font it's size to fit the loaded text to a certian textfield height of a multile textfield? The project titles are variable in character word length. How is this solvable. Thanks ! Stijn ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com mailto:Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- --Joel ___ 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] automatically declared stage instances and loaded .swf's
Cool. Good to know I'm not way off base here. After reading Colin's The Charges Against Actionscript 3.0http://www.insideria.com/2008/07/the-charges-against-actionscri.htmlarticle I realized there are some arguably distasteful things about it. I'm still getting my as3 dev speed back to where it was in as2 so I've yet to try and perfect common practices aside from building on the GoAsap engine. On Wed, Nov 12, 2008 at 4:56 PM, Glen Pike [EMAIL PROTECTED]wrote: Hi, I ran into this issue the other day with the base class linkage ID too. Finally got my head around the base class idea - I was working on the principle that my custom super class should be the base class to my specific custom classes - in a polymorphic kind of way, but finally realised that base class was at the top of my class parentage - a bit dumb of me, but I guess this fact may be a bit ambiguous. Anyway, I was trying to get my instances of clips placed at author-time wired up automatically at run-time in my custom class, but was torn between the declare or not-declare method. Eventually it was forced on me and I encountered the same error as you when trying to declare them as private in AS... I don't mind declaring my stage instances in AS, but the problem I have is making them public. I am trying to work in an OOP way and encapsulate my clip properties and methods, therefore it should be none of any other class's damn business what is contained within my clip if I don't want to tell. My point is, whether I drop my objects on stage, or create them in AS, I should be able to make them private. I also don't understand why they have to be public and would like to know. Until then, I am probably going to have to workaround it... Not much help to you, but fuel for the fire... Glen My question then, why exactly do you have to declare a stage instance in a content movie as public manually? I know it has something to do with who's display list it is on but I don't quite understand how that heirarchy forces this issue. Sorry so long winded. -- Glen Pike 01326 218440 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- --Joel ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] AS3 - problem with sound object
Hi guys, I am working on a mp3 player that receives a javascript call with the name of the file to be loaded. On the first call from JS, it plays fine, but if another file is selected it fails. It only works once, in other words. I tried putting the new Sound() and new SoundChannel() inside of my playAudioA function, but then I just get endless layers of audio, AND my other functions that reference the Sound and the SoundChannel die. Can someone take a look and tell me where I'm going wrong? ExternalInterface.addCallback(playAudio,playAudioA); var s:Sound = new Sound(); var sc:SoundChannel = new SoundChannel(); function playAudioA(audioPath, audioImage, trackid):void { try { s.close(); } catch (error:IOError) { } var req:URLRequest = new URLRequest(audioPath); s.load(req); s.addEventListener(ProgressEvent.PROGRESS, loadProgress); s.addEventListener(Event.COMPLETE, loadDone); sc = s.play(); } Thank you! -- Carl Welch http://www.carlwelch.com http://www.jointjam.com [EMAIL PROTECTED] 805.403.4819 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] ComboBox + Custom Cursor , AS3
Are you using CursorManager or adding the cursor in some other way? Peter On Wed, Nov 12, 2008 at 12:42 PM, Karim Beyrouti [EMAIL PROTECTED] wrote: Hello All - I am a little stumped by this one. I am using a custom cursor ( added to the stage ), one of my loaded SWF's has a drop down comboBox - The problem: The List gets added to the stage and goes over the custom mouse cursor. Do you guys know of any fixes for this one? Regards Karim Beyrouti ___ 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] Regions of JPEG into BitmapData
I've tried: bmd.draw(o_art, null, null, null, new Rectangle(10, 5, 90, 20)); Which I assumed would set my selection 10 pixels left, 5 pixels down, 90x20, but instead I get a rectangle of the right shape, but 10 pixels to the left and 5 of the top is white. - John G ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] ComboBox + Custom Cursor , AS3
Perfect - thank you ! it seems a little odd that the ComboBox adds the List to the stage and not one of its own children. Maybe memory/resource managment. h. On 12 Nov 2008, at 16:26, Keith Reinfeld wrote: Karim, Try adding the following line of code to your MOUSE_MOVE event listener function: stage.addChildAt(customCursor, stage.numChildren); Of course, you must substitute your custom cursor's instance name for 'customCursor'. HTH Regards, -Keith http://keithreinfeld.home.comcast.net ___ 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] Regions of JPEG into BitmapData
The solution is Matrix.tx and Matrix.ty. var mat:Matrix = new Matrix(); mat.tx = 10 * -1; mat.ty = 5 * - 1; bmd.draw(art, mat); ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Regions of JPEG into BitmapData
You're right, it's a bit tricky or at least, it doesn't work in the most intuitive way. To get what you want, you have to use both a Matrix and a Rectangle. Leave the rectangle x and y in 0 and set the width and height to match the size of the cropped image. Then use the matrix.translate() with the x and y you want, but inverted. It's like before copying the data, you were first moving the original sprite to make it's 0,0 point match the point you want to start copying from. Something like this: var bmd:BitmapData = new BitmapData(90,20); var mat:Matrix = new Matrix(); mat.translate(-10,-5); var rect:Rectangle = new Rectangle(0,0,90,20); bmd.draw(src_mc,mat,null,null,rect); Cheers Juan Pablo Califano 2008/11/12, John Giotta [EMAIL PROTECTED]: I've tried: bmd.draw(o_art, null, null, null, new Rectangle(10, 5, 90, 20)); Which I assumed would set my selection 10 pixels left, 5 pixels down, 90x20, but instead I get a rectangle of the right shape, but 10 pixels to the left and 5 of the top is white. - John G ___ 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] ComboBox + Custom Cursor , AS3
This might be a bit cumbersome but less processor intensive. Instead of using MOUSE_MOVE, create two Sprites on the stage. One as a content pane and other as a custom cursor pane. Then add all content including the combo box to the content pane and the cursor to the cursor pane. I can't say for sure if the combo box will still display on top but may be worth a shot if you're big on freeing up resources. On Wed, Nov 12, 2008 at 5:47 PM, karim beyrouti [EMAIL PROTECTED] wrote: Perfect - thank you ! it seems a little odd that the ComboBox adds the List to the stage and not one of its own children. Maybe memory/resource managment. h. On 12 Nov 2008, at 16:26, Keith Reinfeld wrote: Karim, Try adding the following line of code to your MOUSE_MOVE event listener function: stage.addChildAt(customCursor, stage.numChildren); Of course, you must substitute your custom cursor's instance name for 'customCursor'. HTH Regards, -Keith http://keithreinfeld.home.comcast.net ___ 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 -- --Joel ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Stage instances, nested clips frames (AS3)
Hello, I've got a situation where animators hand me a clip that has a bunch of frame labels, each representing an animation sequence. At each frame label, I've got labelled MovieClips inside the clip. So, for example, on each frame I have a clip called character_mc, talkbubble_mc, hitarea_mc. The reason for the setup like this is that the animators position the key clips in different ways depending on the state of the character (walking, running, etc.). They like it all in one clip so they can make sure the transitions between the states are smooth. So, the problem I have is that in AS3, I'll tell the parent clip to go to a frame, and the value of character_mc will return null ... sometimes. This never used to happen in AS2; it always seemed that as soon as I executed gotoAndStop on a parent clip, the stage instances of that parent clip were available to me on the very next line of code. [OR, perhaps I was fooled into thinking this because of AS2's permissive ways (i.e. I was actually calling operations on a null instance)?] What I find strange is that character_mc is not null the line before the gotoAndStop execution. Almost as if the parent clip is in a halfway state ... So my question is, how can I make sure that the instances on the stage are initialized, defined and ready to access? Is there a way to force this? Do I have to create a deferred part of the code and add an ENTER_FRAME event every time I want to access the clip? Or to get away from this, do I really have to convert all of the animators' clips into a structure that doesn't rely on the parent clip's timeline? -jonathan -- -jonathan howe ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders