[Flashcoders] Question on variable init in a for loop
I have the following case: var l:Array = [{},{}] function test():void{ for each(var i:Object in l){ var id:String;// = null; trace(1 ,id); id = test + Math.random().toString(); trace(2 ,id); } } I seems that 'id' is not resetted to null on every iteration as I would expect. I have to explicitly set the id to null myself! Does some know why this is, or are my expectations just wrong. Jiri ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] [worked around] flvplayback fullscreen button
hi i've replaced the other instances of the flvplayback (that don't require controls) with standard netstream / netconnection / video players and it solved the problem. Not really sure what was happening but i suppose that all of the flvplayback instances were trying to go fullscreen On 3 August 2010 19:14, allandt bik-elliott (thefieldcomic.com) alla...@gmail.com wrote: hi folks i'm having a really wierd error when i hit the fullscreen button for my flvplayback implementation TypeError: Error #1009: Cannot access a property or method of a null object reference. at fl.video::UIManager/ http://www.adobe.com/2007/flash/flvplayback/internal::enterFullScreenTakeOver() at fl.video::UIManager/ http://www.adobe.com/2007/flash/flvplayback/internal::handleFullScreenEvent() at flash.display::Stage/set displayState() at fl.video::UIManager/enterFullScreenDisplayState() at fl.video::UIManager/ http://www.adobe.com/2007/flash/flvplayback/internal::dispatchMessage() at fl.video::UIManager/ http://www.adobe.com/2007/flash/flvplayback/internal::handleMouseUp() has anyone seen anything like this before? i've tried recreating the conditions that created this error (i have an older version of the application running the fullscreen button just fine - this was before i had added a caption button and reskinned the fullscreen button). I've tried removing the captioning button and reverting to a stock fullscreen button with no success. i add the fullscreen button by waiting for a frame so all of the assets can initialise themselves and then using the following line: _video.fullScreenButton = _mcControls.getChildByName(fullscreenBtn) as MovieClip; i have several other flvplayback objects in the application and if i remove them, the fullscreen button works properly again (although the other instances of flvplayback don't implement any controls of any sort, including a fullscreen button) thanks in advance for your help best a ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] [SOLVED] flvplayback fullscreen button
i've just found out what the problem was i've reverted to my previous version of the cut down players (that use the flvplayback component) and set fullscreentakeover to false (as it is in the main player) and it fixed the problem - apparently when the fullscreen state is called, all of the flvplayback instances will try to react to it in their own way and if they are set to take over the screen, they will fight the player we actually want to use if it doesn't. ouch - 2 hours i'll never get back a On 4 August 2010 10:48, allandt bik-elliott (thefieldcomic.com) alla...@gmail.com wrote: hi i've replaced the other instances of the flvplayback (that don't require controls) with standard netstream / netconnection / video players and it solved the problem. Not really sure what was happening but i suppose that all of the flvplayback instances were trying to go fullscreen On 3 August 2010 19:14, allandt bik-elliott (thefieldcomic.com) alla...@gmail.com wrote: hi folks i'm having a really wierd error when i hit the fullscreen button for my flvplayback implementation TypeError: Error #1009: Cannot access a property or method of a null object reference. at fl.video::UIManager/ http://www.adobe.com/2007/flash/flvplayback/internal::enterFullScreenTakeOver() at fl.video::UIManager/ http://www.adobe.com/2007/flash/flvplayback/internal::handleFullScreenEvent() at flash.display::Stage/set displayState() at fl.video::UIManager/enterFullScreenDisplayState() at fl.video::UIManager/ http://www.adobe.com/2007/flash/flvplayback/internal::dispatchMessage() at fl.video::UIManager/ http://www.adobe.com/2007/flash/flvplayback/internal::handleMouseUp() has anyone seen anything like this before? i've tried recreating the conditions that created this error (i have an older version of the application running the fullscreen button just fine - this was before i had added a caption button and reskinned the fullscreen button). I've tried removing the captioning button and reverting to a stock fullscreen button with no success. i add the fullscreen button by waiting for a frame so all of the assets can initialise themselves and then using the following line: _video.fullScreenButton = _mcControls.getChildByName(fullscreenBtn) as MovieClip; i have several other flvplayback objects in the application and if i remove them, the fullscreen button works properly again (although the other instances of flvplayback don't implement any controls of any sort, including a fullscreen button) thanks in advance for your help best a ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Question on variable init in a for loop
no that's correct but id should be declared outside of your loop - as3 will actually give you a duplicate variable error for putting it inside the loop. you can also refer to your iterator (i) after the loop is done i'd rewrite your function like this var arObj:Array = [{},{}] function test():void { var id:String; for each(var i:Object in arObj) { trace(1 ,id); id = test + Number(Math.random()).toString(); trace(2 ,id); } trace(i); } best a On 4 August 2010 10:45, Jiri jiriheitla...@googlemail.com wrote: I have the following case: var l:Array = [{},{}] function test():void{ for each(var i:Object in l){ var id:String;// = null; trace(1 ,id); id = test + Math.random().toString(); trace(2 ,id); } } I seems that 'id' is not resetted to null on every iteration as I would expect. I have to explicitly set the id to null myself! Does some know why this is, or are my expectations just wrong. Jiri ___ 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] Question on variable init in a for loop
In actionscript you have only local and global scope. Meaning a variable can be declared as local to the function or in the class that contains it. Other languages allow for creating further scopes. In Java, C, C++, C#, for instance, you can do something like this: int i = 0; {// this creates a new scope int i = 8; } And you will get 2 different variables. Obviously, naming both the same is not the smartest move, but it's legal (at least in C#, if I recall correctly). Also when you write a loop, the counter var will be local if declared in the loop. I mean this: for(int i = 0; i 10; i++) { // do something with i } //this is invalid, i doesn not exist here... i = 20; Now, in Actionscript this is not possible. You can declare a variable wherever you like. The compiler ends up moving the variable to the top of the scope when generating the bytecode (I think this is called hoisting). So this: var l:Array = [{},{}] function test():void{ for each(var i:Object in l){ var id:String;// = null; trace(1 ,id); id = test + Math.random().toString(); trace(2 ,id); } } Is equivalent to writting this: var l:Array = [{},{}] function test():void{ var id:String;// = null; for each(var i:Object in l){ trace(1 ,id); id = test + Math.random().toString(); trace(2 ,id); } } id will be declared (and initialized to null) only once, before you access it in your code. So you only have one variable, really and that's the reason for the behavior you observed. Cheers Juan Pablo Califano 2010/8/4 Jiri jiriheitla...@googlemail.com I have the following case: var l:Array = [{},{}] function test():void{ for each(var i:Object in l){ var id:String;// = null; trace(1 ,id); id = test + Math.random().toString(); trace(2 ,id); } } I seems that 'id' is not resetted to null on every iteration as I would expect. I have to explicitly set the id to null myself! Does some know why this is, or are my expectations just wrong. Jiri ___ 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] Question on variable init in a for loop
Hope to add some value to this. The duplicate variable error is only due to the fact that String is a native object (don't know the correct name for this) of Flash AS3. So you don't have to use the new key word for it. Like this would work OK: var arObj:Array = [{},{}] function test():void { for each(var i:Object in arObj) { var id:MovieClip = new MovieClip() trace(1 ,id); id.name = test + Number(Math.random()).toString(); trace(2 ,id); } trace(i); } -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of allandt bik-elliott (thefieldcomic.com) Sent: woensdag 4 augustus 2010 12:12 To: Flash Coders List Subject: Re: [Flashcoders] Question on variable init in a for loop no that's correct but id should be declared outside of your loop - as3 will actually give you a duplicate variable error for putting it inside the loop. you can also refer to your iterator (i) after the loop is done i'd rewrite your function like this var arObj:Array = [{},{}] function test():void { var id:String; for each(var i:Object in arObj) { trace(1 ,id); id = test + Number(Math.random()).toString(); trace(2 ,id); } trace(i); } best a On 4 August 2010 10:45, Jiri jiriheitla...@googlemail.com wrote: I have the following case: var l:Array = [{},{}] function test():void{ for each(var i:Object in l){ var id:String;// = null; trace(1 ,id); id = test + Math.random().toString(); trace(2 ,id); } } I seems that 'id' is not resetted to null on every iteration as I would expect. I have to explicitly set the id to null myself! Does some know why this is, or are my expectations just wrong. Jiri ___ 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 Geen virus gevonden in het binnenkomende-bericht. Gecontroleerd door AVG - www.avg.com Versie: 9.0.851 / Virusdatabase: 271.1.1/3049 - datum van uitgifte: 08/03/10 16:22:00 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Create your own t-shirt
Does anyone know where I might find an AS2 (preferably) or AS3 create your own t-shirt tutorial or any advice on one that is made and for sale? Does your t-shirt maker also have to have sharks and lasers? I had no luck on google, but I may not be searching for the right key phrase. Try this search: Flash Tutorial T-Shirt Maker Sharks Lasers Seriously though, you're thinking about this the wrong way - looking for an EXTREMELY specific example. You need to not think about the specific result you want (because it's extremely unlikely you'll find a tutorial on it), and instead ask questions and find tutorials on knowledge gaps in Actionscript and Flash related to the problem you are trying to solve. For example: How do I detect when two graphics are overlapping? How would I go about allowing the user to draw on the screen? How can I send graphics to a printer? Is there a tutorial out there on loading XML? etc. By asking for a tutorial very specific to your project, it seems like you just want something to show you everything you should do for your project, instead of learning the Flash/Actionscript things you need to learn to tackle any project. So I would advise you to learn to fish instead of ask for a fish. Sorry if that sounds harsh, I don't mean it to be - it's just the best advice I can give you. Jason Merrill Instructional Technology Architect Bank of America Global Learning Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (Note: these resources are only available for Bank of America associates) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Semi-OT: Alchemy
Ah, that sounds vaguely familiar now that you mention it. Strange they keep it up on Labs - maybe for bragging rights or just so people can make limited use of it or something. Thanks Jason Merrill Instructional Technology Architect Bank of America Global Learning Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (Note: these resources are only available for Bank of America associates) -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Steve Mathews Sent: Wednesday, August 04, 2010 12:30 AM To: Flash Coders List Subject: Re: [Flashcoders] Semi-OT: Alchemy I really wish I could provide a link for this info but... I remember it being said that no further Alchemy development would happen. In other words, it is a dead project. If I can remember where I got the info I will pass it on. On Tue, Aug 3, 2010 at 7:41 AM, Merrill, Jason jason.merr...@bankofamerica.com wrote: With Gerry's post last night on his Fast Fourier Transforms question and that Alchemy won't cut it, it makes me curious why Alchemy is still in Adobe Labs. I saw the first preview back at Max 2007 and it's still in beta three years later... wonder if it's some technical hurdles they haven't been able to overcome to make it complete, if Adobe's just not very committed to it, if they are legal issues, a combination of these, or something else. Too bad, it would open up a lot of code libraries to us. If Alchemy is really becoming a dead end for Adobe, it's kind of ironic that alchemy in a historical sense was actually a failed attempt to create precious metals from raw metals (like turning lead into gold). Anyone know anything more about the status of the behind the scenes work on Alchemy? Jason Merrill Instructional Technology Architect Bank of America Global Learning Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (Note: these resources are only available for Bank of America associates) ___ 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] Create your own t-shirt
Well, I did say I'd purchase it. But I hear your point. I know how to do all those things, but needed this in somewhat of a hurry and was seeing if I could find a fish instead of congering one out of mid air. So to speak. But thank you for your response. No harm no foul. Best, Karl Sent from losPhone On Aug 4, 2010, at 8:55 AM, Merrill, Jason jason.merr...@bankofamerica.com wrote: Does anyone know where I might find an AS2 (preferably) or AS3 create your own t-shirt tutorial or any advice on one that is made and for sale? Does your t-shirt maker also have to have sharks and lasers? I had no luck on google, but I may not be searching for the right key phrase. Try this search: Flash Tutorial T-Shirt Maker Sharks Lasers Seriously though, you're thinking about this the wrong way - looking for an EXTREMELY specific example. You need to not think about the specific result you want (because it's extremely unlikely you'll find a tutorial on it), and instead ask questions and find tutorials on knowledge gaps in Actionscript and Flash related to the problem you are trying to solve. For example: How do I detect when two graphics are overlapping? How would I go about allowing the user to draw on the screen? How can I send graphics to a printer? Is there a tutorial out there on loading XML? etc. By asking for a tutorial very specific to your project, it seems like you just want something to show you everything you should do for your project, instead of learning the Flash/Actionscript things you need to learn to tackle any project. So I would advise you to learn to fish instead of ask for a fish. Sorry if that sounds harsh, I don't mean it to be - it's just the best advice I can give you. Jason Merrill Instructional Technology Architect Bank of America Global Learning Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (Note: these resources are only available for Bank of America associates) ___ 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] Create your own t-shirt
Hi, Learn more on Adobe Scene 7. This might help you. Warm Regards Deepanjan Das http://deepanjandas.wordpress.com/ On Wed, Aug 4, 2010 at 7:56 PM, Karl DeSaulniers k...@designdrumm.comwrote: Well, I did say I'd purchase it. But I hear your point. I know how to do all those things, but needed this in somewhat of a hurry and was seeing if I could find a fish instead of congering one out of mid air. So to speak. But thank you for your response. No harm no foul. Best, Karl Sent from losPhone On Aug 4, 2010, at 8:55 AM, Merrill, Jason jason.merr...@bankofamerica.com wrote: Does anyone know where I might find an AS2 (preferably) or AS3 create your own t-shirt tutorial or any advice on one that is made and for sale? Does your t-shirt maker also have to have sharks and lasers? I had no luck on google, but I may not be searching for the right key phrase. Try this search: Flash Tutorial T-Shirt Maker Sharks Lasers Seriously though, you're thinking about this the wrong way - looking for an EXTREMELY specific example. You need to not think about the specific result you want (because it's extremely unlikely you'll find a tutorial on it), and instead ask questions and find tutorials on knowledge gaps in Actionscript and Flash related to the problem you are trying to solve. For example: How do I detect when two graphics are overlapping? How would I go about allowing the user to draw on the screen? How can I send graphics to a printer? Is there a tutorial out there on loading XML? etc. By asking for a tutorial very specific to your project, it seems like you just want something to show you everything you should do for your project, instead of learning the Flash/Actionscript things you need to learn to tackle any project. So I would advise you to learn to fish instead of ask for a fish. Sorry if that sounds harsh, I don't mean it to be - it's just the best advice I can give you. Jason Merrill Instructional Technology Architect Bank of America Global Learning Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (Note: these resources are only available for Bank of America associates) ___ 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 -- Warm Regards Deepanjan Das W: http://deepanjandas.wordpress.com Think of the environment before printing this email ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Question on variable init in a for loop
Juan Pablo Califano wrote: In actionscript you have only local and global scope. Meaning a variable can be declared as local to the function or in the class that contains it. That's true, and relevant to the OP's problem. Juan Pablo is rignt on the money, so I'm going to pick up where he left off and talk about private, protected, and public vars, even though it will lead us a bit OT. A private variable is available only to the class that declares it. A protected variable is available to that class and all derived classes. Of course, you can make any variable accessible with a getter or setter method. In OOP AS3, only public variables are truly global. If you don't declare a variable to be private or protected, it is global by default. Cordially, Kerry Thompson ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Create your own t-shirt
This may be helpful for allowing interactive selecting/scaling/rotating/moving: http://www.greensock.com/transformmanageras3/ There's an AS2 flavor as well. Both accommodate scaling multiple selections even if each object is rotated at a different angle. Transformations can be exported and imported as XML to make it easy to save and reload the state. I know several t-shirt making apps use it. Good luck. Jack -Original Message- From: Karl DeSaulniers [mailto:k...@designdrumm.com] Sent: Wednesday, August 04, 2010 9:27 AM To: Flash Coders List Cc: Flash Coders List Subject: Re: [Flashcoders] Create your own t-shirt Well, I did say I'd purchase it. But I hear your point. I know how to do all those things, but needed this in somewhat of a hurry and was seeing if I could find a fish instead of congering one out of mid air. So to speak. But thank you for your response. No harm no foul. Best, Karl Sent from losPhone On Aug 4, 2010, at 8:55 AM, Merrill, Jason jason.merr...@bankofamerica.com wrote: Does anyone know where I might find an AS2 (preferably) or AS3 create your own t-shirt tutorial or any advice on one that is made and for sale? Does your t-shirt maker also have to have sharks and lasers? I had no luck on google, but I may not be searching for the right key phrase. Try this search: Flash Tutorial T-Shirt Maker Sharks Lasers Seriously though, you're thinking about this the wrong way - looking for an EXTREMELY specific example. You need to not think about the specific result you want (because it's extremely unlikely you'll find a tutorial on it), and instead ask questions and find tutorials on knowledge gaps in Actionscript and Flash related to the problem you are trying to solve. For example: How do I detect when two graphics are overlapping? How would I go about allowing the user to draw on the screen? How can I send graphics to a printer? Is there a tutorial out there on loading XML? etc. By asking for a tutorial very specific to your project, it seems like you just want something to show you everything you should do for your project, instead of learning the Flash/Actionscript things you need to learn to tackle any project. So I would advise you to learn to fish instead of ask for a fish. Sorry if that sounds harsh, I don't mean it to be - it's just the best advice I can give you. Jason Merrill Instructional Technology Architect Bank of America Global Learning Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (Note: these resources are only available for Bank of America associates) ___ 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] Question on variable init in a for loop
Kerry Thompson wrote: In OOP AS3, only public variables are truly global. If you don't declare a variable to be private or protected, it is global by default. Public static properties are the only thing that can be compared with a global. Note the word static. And public is not the default, internal is. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Question on variable init in a for loop
Henrik Andersson wrote: Public static properties are the only thing that can be compared with a global. Note the word static. And public is not the default, internal is. You're right, Henrick. Internal is the default, not public. My bad. I think we're splitting hairs on public vs. public static. A public variable, static or otherwise, is available to any caller. Technically, you are probably right, because a public variable isn't available until an object is intantiated from the class. A public static variable belongs to the class, not the instance, though, so it is available without instantiating an object. In fact, I use public static variables for my custom messages--I have a CustomMessage class specifically for that purpose. Nonetheless, once instantiated, and public variable is global whether it is static or not. That fits my concept of global. Cordially, Kerry Thompson ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Create your own t-shirt
And you need to find out how to send a ByteArray back to a backend service to save said t-shirt as an image file. With that and Jack's TransformManager, those are the two main building blocks. On Wed, Aug 4, 2010 at 10:10 AM, Jack Doyle j...@greensock.com wrote: This may be helpful for allowing interactive selecting/scaling/rotating/moving: http://www.greensock.com/transformmanageras3/ There's an AS2 flavor as well. Both accommodate scaling multiple selections even if each object is rotated at a different angle. Transformations can be exported and imported as XML to make it easy to save and reload the state. I know several t-shirt making apps use it. Good luck. Jack -Original Message- From: Karl DeSaulniers [mailto:k...@designdrumm.com] Sent: Wednesday, August 04, 2010 9:27 AM To: Flash Coders List Cc: Flash Coders List Subject: Re: [Flashcoders] Create your own t-shirt Well, I did say I'd purchase it. But I hear your point. I know how to do all those things, but needed this in somewhat of a hurry and was seeing if I could find a fish instead of congering one out of mid air. So to speak. But thank you for your response. No harm no foul. Best, Karl Sent from losPhone On Aug 4, 2010, at 8:55 AM, Merrill, Jason jason.merr...@bankofamerica.com wrote: Does anyone know where I might find an AS2 (preferably) or AS3 create your own t-shirt tutorial or any advice on one that is made and for sale? Does your t-shirt maker also have to have sharks and lasers? I had no luck on google, but I may not be searching for the right key phrase. Try this search: Flash Tutorial T-Shirt Maker Sharks Lasers Seriously though, you're thinking about this the wrong way - looking for an EXTREMELY specific example. You need to not think about the specific result you want (because it's extremely unlikely you'll find a tutorial on it), and instead ask questions and find tutorials on knowledge gaps in Actionscript and Flash related to the problem you are trying to solve. For example: How do I detect when two graphics are overlapping? How would I go about allowing the user to draw on the screen? How can I send graphics to a printer? Is there a tutorial out there on loading XML? etc. By asking for a tutorial very specific to your project, it seems like you just want something to show you everything you should do for your project, instead of learning the Flash/Actionscript things you need to learn to tackle any project. So I would advise you to learn to fish instead of ask for a fish. Sorry if that sounds harsh, I don't mean it to be - it's just the best advice I can give you. Jason Merrill Instructional Technology Architect Bank of America Global Learning Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (Note: these resources are only available for Bank of America associates) ___ 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] Question on variable init in a for loop
Public variables, static or otherwise do NOT classify as global variables. http://en.wikipedia.org/wiki/Global_variable A global variable is something that is accessible everywhere without any scope whatsoever. By having to call MyClass.variable or myClassInstance.variable, it is quite apparent that the property variable is not global, because you have to explicitly call MyClass or a MyClass instance to access it. Now, some developers might imitate global variables in AS3 by doing something like making a class called Global, and accessing static variables such as Global.variable1, Global.variable2, etc. Taka On Wed, Aug 4, 2010 at 11:15 AM, Kerry Thompson al...@cyberiantiger.bizwrote: Henrik Andersson wrote: Public static properties are the only thing that can be compared with a global. Note the word static. And public is not the default, internal is. You're right, Henrick. Internal is the default, not public. My bad. I think we're splitting hairs on public vs. public static. A public variable, static or otherwise, is available to any caller. Technically, you are probably right, because a public variable isn't available until an object is intantiated from the class. A public static variable belongs to the class, not the instance, though, so it is available without instantiating an object. In fact, I use public static variables for my custom messages--I have a CustomMessage class specifically for that purpose. Nonetheless, once instantiated, and public variable is global whether it is static or not. That fits my concept of global. Cordially, Kerry Thompson ___ 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] Question on variable init in a for loop
Kerry Thompson wrote: Nonetheless, once instantiated, and public variable is global whether it is static or not. That fits my concept of global. My definition of a global variable is: * One single value per application * Can be accessed by any code A public property only satisfies the second condition. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Create your own t-shirt
WOW, thanks guys. Looks like I will have to roll my own on this one, but all your suggestions have put me in the right direction. Thank you all. Karl On Aug 4, 2010, at 1:32 PM, Taka Kojima wrote: And you need to find out how to send a ByteArray back to a backend service to save said t-shirt as an image file. With that and Jack's TransformManager, those are the two main building blocks. On Wed, Aug 4, 2010 at 10:10 AM, Jack Doyle j...@greensock.com wrote: This may be helpful for allowing interactive selecting/scaling/rotating/moving: http://www.greensock.com/transformmanageras3/ There's an AS2 flavor as well. Both accommodate scaling multiple selections even if each object is rotated at a different angle. Transformations can be exported and imported as XML to make it easy to save and reload the state. I know several t-shirt making apps use it. Good luck. Jack -Original Message- From: Karl DeSaulniers [mailto:k...@designdrumm.com] Sent: Wednesday, August 04, 2010 9:27 AM To: Flash Coders List Cc: Flash Coders List Subject: Re: [Flashcoders] Create your own t-shirt Well, I did say I'd purchase it. But I hear your point. I know how to do all those things, but needed this in somewhat of a hurry and was seeing if I could find a fish instead of congering one out of mid air. So to speak. But thank you for your response. No harm no foul. Best, Karl Sent from losPhone On Aug 4, 2010, at 8:55 AM, Merrill, Jason jason.merr...@bankofamerica.com wrote: Does anyone know where I might find an AS2 (preferably) or AS3 create your own t-shirt tutorial or any advice on one that is made and for sale? Does your t-shirt maker also have to have sharks and lasers? I had no luck on google, but I may not be searching for the right key phrase. Try this search: Flash Tutorial T-Shirt Maker Sharks Lasers Seriously though, you're thinking about this the wrong way - looking for an EXTREMELY specific example. You need to not think about the specific result you want (because it's extremely unlikely you'll find a tutorial on it), and instead ask questions and find tutorials on knowledge gaps in Actionscript and Flash related to the problem you are trying to solve. For example: How do I detect when two graphics are overlapping? How would I go about allowing the user to draw on the screen? How can I send graphics to a printer? Is there a tutorial out there on loading XML? etc. By asking for a tutorial very specific to your project, it seems like you just want something to show you everything you should do for your project, instead of learning the Flash/Actionscript things you need to learn to tackle any project. So I would advise you to learn to fish instead of ask for a fish. Sorry if that sounds harsh, I don't mean it to be - it's just the best advice I can give you. Jason Merrill Instructional Technology Architect Bank of America Global Learning Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (Note: these resources are only available for Bank of America associates) ___ 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 Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Question on variable init in a for loop
That's an over simplification of the scope chain properties of AS3, and global isn't the right word there (though I know what you meant). To clarify the scope chain issue, keep in mind that you can nest function scopes to create a hierarchy of scopes with a closure (usually this is difficult for new devs in ECMAScript languages like AS3 and Javascript to grasp). So global really just refers to the top of the scope chain. Additionally, there are also as file level scopes. For example, in a file named getURL.as: package { function getURL() { trace(topScopeVar); } } var topScopeVar:String = Hello world!; That topScopeVar is only accessible from within that as file, because it is at the top of that file's individual scope chain. A function or class in a different as file would not have access to that variable, and this class has no access to other seemingly global scopes either, like the timeline, or other as files. functions and classes defined in root packages, and available in the class path, those are global, and you can define a property on those (static var on a class for example) - that's about as close as you get to a global in AS3. Kevin N. On 8/4/10 9:21 AM, Juan Pablo Califano wrote: In actionscript you have only local and global scope. Meaning a variable can be declared as local to the function or in the class that contains it. Other languages allow for creating further scopes. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Question on variable init in a for loop
Henrik Andersson wrote: My definition of a global variable is: * One single value per application * Can be accessed by any code A public property only satisfies the second condition. Again, I think we're talking about a purely semantic difference, not a functional one. Actually, Taka has a point--AS3 may not have true globals at all. I think he may be right, as long as we are using OOP. Consider this, though. Creat a new .fla, put a dynamic text field on stage, call it myText, then put this code in the first frame: var greeting:String = Hello. Am I global?; myText.text = greeting stop(); That's very AS2-ish code, but it works as an AS3 .fla. Is it a global? But, to your point about one single value per application, myObject.myPublicVar can have only one value. True, the class can be instantiated many times, but a non-static variable doesn't have a value until its class is instantiated. Even with these conditions, when you start using namespaces, you can have exactly the same variable in different name spaces. In that case, you could have myClass.myStaticPublicVar in two or more name spaces. That puts it in kind of the same category as public variables, doesn't it? A lot of us here came from Director, myself included, and we're used to Lingo's concept of a global namespace. I've programmed in many other languages--C, C++, COBOL, Forrtran, and others--and AS3 is the first I've used that doesn't really have a global namespace. Cordially, Kerry Thompson ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Question on variable init in a for loop
It's not a global because if you have a MovieClip called testMC on the stage and are inside testMC and try to do trace(greeting), you will get an error. To access that property you have to do parent.greeting, therefore because you have to be aware of the scope to access it, it is not global. On Wed, Aug 4, 2010 at 2:30 PM, Kerry Thompson al...@cyberiantiger.bizwrote: Henrik Andersson wrote: My definition of a global variable is: * One single value per application * Can be accessed by any code A public property only satisfies the second condition. Again, I think we're talking about a purely semantic difference, not a functional one. Actually, Taka has a point--AS3 may not have true globals at all. I think he may be right, as long as we are using OOP. Consider this, though. Creat a new .fla, put a dynamic text field on stage, call it myText, then put this code in the first frame: var greeting:String = Hello. Am I global?; myText.text = greeting stop(); That's very AS2-ish code, but it works as an AS3 .fla. Is it a global? But, to your point about one single value per application, myObject.myPublicVar can have only one value. True, the class can be instantiated many times, but a non-static variable doesn't have a value until its class is instantiated. Even with these conditions, when you start using namespaces, you can have exactly the same variable in different name spaces. In that case, you could have myClass.myStaticPublicVar in two or more name spaces. That puts it in kind of the same category as public variables, doesn't it? A lot of us here came from Director, myself included, and we're used to Lingo's concept of a global namespace. I've programmed in many other languages--C, C++, COBOL, Forrtran, and others--and AS3 is the first I've used that doesn't really have a global namespace. Cordially, Kerry Thompson ___ 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] Latest advances in Automated Flash/Flex Testing - learn more tomorrow (Aug 5, 11a PDT)
Hi there, Thought you'd like to know that Sauce Labs has bundled Flash/Flex Testinghttp://saucelabs.com/flashsupport with Sauce IDE (Sauce's value distribution of Selenium). If you are interested in automating the testing your Flash/Flex components along with the rest of your browsers, and find the existing tools (FlexMonkey / Flash Selenium / Selenium Flex API) limiting: There is a webinar http://saucelabs.com/about/webinars#webinar-flex on *August 5, 2010 at 11 am PST* to show you everything you need to know. Checkhttp://www.timeanddate.com/worldclock/fixedtime.html?month=8day=5year=2010hour=11min=0sec=0p1=224your time zone here. Adam Christian (co-creator of Flex Pilot and Windmill) will walk you through the steps of creating tests for your Flash/Flex components; running these tests in Java, Python, Ruby, php; and executing your tests in the cloud on Sauce OnDemand http://saucelabs.com/ondemand against different browsers and OSs. Register for the webinar now at: http://saucelabs.com/about/webinars#webinar-flex Until now, most QA rely on manual testing for Flash and Flex. With the speed this system is capable of, continuous integration with Hudson is snap, and your need for developers to rewrite hooks for automated testing will be drastically reduced. Feel free to spread the word and hope to see you at the webinar! -- Grace Law Follow us on twitter.com/saucelabs ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Question on variable init in a for loop
Agreed, that was over simplified. I probably should have said clearly I was using global in a rather loose way -- as opposed to function local; that's why I put the quotes. I just wanted to point out what the problem was in the original question, in a simple way, without getting into activation objects and other stuff. Thanks for your clarifications. Cheers Juan Pablo Califano 2010/8/4 Kevin Newman capta...@unfocus.com That's an over simplification of the scope chain properties of AS3, and global isn't the right word there (though I know what you meant). To clarify the scope chain issue, keep in mind that you can nest function scopes to create a hierarchy of scopes with a closure (usually this is difficult for new devs in ECMAScript languages like AS3 and Javascript to grasp). So global really just refers to the top of the scope chain. Additionally, there are also as file level scopes. For example, in a file named getURL.as: package { function getURL() { trace(topScopeVar); } } var topScopeVar:String = Hello world!; That topScopeVar is only accessible from within that as file, because it is at the top of that file's individual scope chain. A function or class in a different as file would not have access to that variable, and this class has no access to other seemingly global scopes either, like the timeline, or other as files. functions and classes defined in root packages, and available in the class path, those are global, and you can define a property on those (static var on a class for example) - that's about as close as you get to a global in AS3. Kevin N. On 8/4/10 9:21 AM, Juan Pablo Califano wrote: In actionscript you have only local and global scope. Meaning a variable can be declared as local to the function or in the class that contains it. Other languages allow for creating further scopes. ___ 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] Create your own t-shirt
And you need to find out how to send a ByteArray back to a backend service to save said t-shirt as an image file. With that and Jack's TransformManager, those are the two main building blocks. Having created quite a few online designers / product customisation tools, I'd add that for print resolution imagery involving bitmaps you certainly -don't- want to be transferring large amounts of pixel data back to the server, compression or not (unless you don't mind long waits or low resolution output affecting your customer abandonment rates). Better to keep all high resolution processing (and files) on the server and to essentially only transfer user interaction data back to the server to render out the print ready, high resolution final format there, while keeping the whole process snappy. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Create your own t-shirt
But Guys, I appreciate all of your suggestions, but I guess none of them will allows blennding of text or image on your wrinkled t-shirt. Thats what is there in the demo shown. Cheers Deepanjan Das http://deepanjandas.wordpress.com/ On Thu, Aug 5, 2010 at 5:50 AM, Mike Duguid mike.dug...@gmail.com wrote: And you need to find out how to send a ByteArray back to a backend service to save said t-shirt as an image file. With that and Jack's TransformManager, those are the two main building blocks. Having created quite a few online designers / product customisation tools, I'd add that for print resolution imagery involving bitmaps you certainly -don't- want to be transferring large amounts of pixel data back to the server, compression or not (unless you don't mind long waits or low resolution output affecting your customer abandonment rates). Better to keep all high resolution processing (and files) on the server and to essentially only transfer user interaction data back to the server to render out the print ready, high resolution final format there, while keeping the whole process snappy. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Warm Regards Deepanjan Das W: http://deepanjandas.wordpress.com Think of the environment before printing this email ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Create your own t-shirt
Actually I've seen one that let's you turn pixels transparent when uploading your image. Like white pixels. But were not printing the tshirt from what you create, that is just the example for us to go by. So it doesn't need that effect IMO. Karl Sent from losPhone On Aug 4, 2010, at 9:32 PM, Deepanjan Das deepanjan@gmail.com wrote: But Guys, I appreciate all of your suggestions, but I guess none of them will allows blennding of text or image on your wrinkled t-shirt. Thats what is there in the demo shown. Cheers Deepanjan Das http://deepanjandas.wordpress.com/ On Thu, Aug 5, 2010 at 5:50 AM, Mike Duguid mike.dug...@gmail.com wrote: And you need to find out how to send a ByteArray back to a backend service to save said t-shirt as an image file. With that and Jack's TransformManager, those are the two main building blocks. Having created quite a few online designers / product customisation tools, I'd add that for print resolution imagery involving bitmaps you certainly -don't- want to be transferring large amounts of pixel data back to the server, compression or not (unless you don't mind long waits or low resolution output affecting your customer abandonment rates). Better to keep all high resolution processing (and files) on the server and to essentially only transfer user interaction data back to the server to render out the print ready, high resolution final format there, while keeping the whole process snappy. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Warm Regards Deepanjan Das W: http://deepanjandas.wordpress.com Think of the environment before printing this email ___ 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