Re: [Flashcoders] Is this error prone? [loading multiple images]
I think I see a problem with this. I don't know how often GarbageCollection runs, but if the loader you create has no references to it, and the only event listener to it is set to have a weakReference, then the loader could get discarded before it finishes, unless the act of loading doesn't allow it to be removed. Otherwise, as far as I know, that looks like it should be fine to get reference to the loader again and remove the event listener. ? Ktu On Tue, Jul 7, 2009 at 12:50 PM, Joel Stransky j...@stranskydesign.comwrote: I'm wondering if I can use a for loop to create local Loader objects, assign listeners to their LoaderInfo objects without overwriting any of them and still be able to clean up after. Say I have the following inside a function body var img:Loader = new Loader(); img.contentLoaderInfo.addEventListener(Event.COMPLETE, onThumb, false, 0, true); img.load(new URLRequest(someImage.jpg)); and the following handler private function onThumb(e:Event):void { var loader:Loader = Loader( LoaderInfo(e.target).loader ); loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, onThumb); var thumbNail:Bitmap = new Bitmap(Bitmap(loader.content).bitmapData); thumbNail.x = (itemWidth - thumbNail.width) / 2; addChild(thumbNail); } Will the handler work its way back to the Loader that was created temporarily and remove a listener from it? Is there a better way to using throw away loaders? -- --Joel Stransky stranskydesign.com ___ 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] dispatch a custom Event in a simple class file
Hi there, I was working on my class file, but the event didn't get called successfully. Anyting I am missing something? Thank you var mc:MyClass = new MyClass(); mc.addEventListener ( testInitialize , onINIT ); function onINIT ( e:Event ) { trace(INIT was called); } 1. package 2. { 3. import flash.events.Event; 4. import flash.events.EventDispatcher; 5. 6. [Event(name=testInitialize, type=flash.events.Event)] 7. public class MyClass extends EventDispatcher 8. { 9. 10. private const TEST_INITIALIZE :String = testInitialize; 11. 12. public function MyClass () 13. { 14. initialize(); 15. } 16. 17. private function initialize():void 18. { 19. .. 20. dispatchEvent ( new Event( TEST_INITIALIZE ) ); 21. } 22. } 23. } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] dispatch a custom Event in a simple class file
You have testInitialize as both a constant value and the name of an event. I would follow this format instead: = Write the custom event: package { import flash.events.Event; public class MyEvent extends Event { public static var SOME_EVENT:String = some_event; public function MyEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false) { super(type, bubbles, cancelable); } public override function clone():Event { return new MyEvent(type, bubbles, cancelable); } } } = Dispatch the event: package { import flash.events.EventDispatcher; import MyEvent; public class MyClass extends EventDispatcher { public function MyClass() { } public function initialize():void { dispatchEvent(new MyEvent(MyEvent.SOME_EVENT)); } } } = Listen for the event: var myClass:MyClass = new MyClass(); myClass.initialize(); myClass.addEventListener(MyEvent.SOME_EVENT, onSomeEvent); = Respond to the event: private function onSomeEvent(event:MyEvent):void { trace(event happened.) } Jason Merrill Bank of America Global Learning Shared Services Solutions Development Monthly meetings on the Adobe Flash platform for rich media experiences - join the Bank of America Flash Platform Community -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of ACE Flash Sent: Thursday, July 09, 2009 1:44 PM To: Flash Coders List Subject: [Flashcoders] dispatch a custom Event in a simple class file Hi there, I was working on my class file, but the event didn't get called successfully. Anyting I am missing something? Thank you var mc:MyClass = new MyClass(); mc.addEventListener ( testInitialize , onINIT ); function onINIT ( e:Event ) { trace(INIT was called); } 1. package 2. { 3. import flash.events.Event; 4. import flash.events.EventDispatcher; 5. 6. [Event(name=testInitialize, type=flash.events.Event)] 7. public class MyClass extends EventDispatcher 8. { 9. 10. private const TEST_INITIALIZE :String = testInitialize; 11. 12. public function MyClass () 13. { 14. initialize(); 15. } 16. 17. private function initialize():void 18. { 19. .. 20. dispatchEvent ( new Event( TEST_INITIALIZE ) ); 21. } 22. } 23. } ___ 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] dispatch a custom Event in a simple class file
you call the event on the constructor... you add the listener to the event after you make a new instance of that class, so your adding the listener AFTER dispatching the event On Thu, Jul 9, 2009 at 1:55 PM, Merrill, Jason jason.merr...@bankofamerica.com wrote: You have testInitialize as both a constant value and the name of an event. I would follow this format instead: = Write the custom event: package { import flash.events.Event; public class MyEvent extends Event { public static var SOME_EVENT:String = some_event; public function MyEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false) { super(type, bubbles, cancelable); } public override function clone():Event { return new MyEvent(type, bubbles, cancelable); } } } = Dispatch the event: package { import flash.events.EventDispatcher; import MyEvent; public class MyClass extends EventDispatcher { public function MyClass() { } public function initialize():void { dispatchEvent(new MyEvent(MyEvent.SOME_EVENT)); } } } = Listen for the event: var myClass:MyClass = new MyClass(); myClass.initialize(); myClass.addEventListener(MyEvent.SOME_EVENT, onSomeEvent); = Respond to the event: private function onSomeEvent(event:MyEvent):void { trace(event happened.) } Jason Merrill Bank of America Global Learning Shared Services Solutions Development Monthly meetings on the Adobe Flash platform for rich media experiences - join the Bank of America Flash Platform Community -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of ACE Flash Sent: Thursday, July 09, 2009 1:44 PM To: Flash Coders List Subject: [Flashcoders] dispatch a custom Event in a simple class file Hi there, I was working on my class file, but the event didn't get called successfully. Anyting I am missing something? Thank you var mc:MyClass = new MyClass(); mc.addEventListener ( testInitialize , onINIT ); function onINIT ( e:Event ) { trace(INIT was called); } 1. package 2. { 3. import flash.events.Event; 4. import flash.events.EventDispatcher; 5. 6. [Event(name=testInitialize, type=flash.events.Event)] 7. public class MyClass extends EventDispatcher 8. { 9. 10. private const TEST_INITIALIZE :String = testInitialize; 11. 12. public function MyClass () 13. { 14. initialize(); 15. } 16. 17. private function initialize():void 18. { 19. .. 20. dispatchEvent ( new Event( TEST_INITIALIZE ) ); 21. } 22. } 23. } ___ 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] AS 2.0 FileReference issue I/O error thrown
Hey T, Sorry to get back to you so late down the line. Hopefully this message finds you in a position to where you will not need it. I had another gentleman ask abut the same question, so I was going to suggest to you and him to also try adding in error handlers to your PHP file that would trigger a response that you designate per each situation. EG: You could make an error code... For when the PHP file reads the dir/For when the PHP file writes the dir For when the PHP file uploads your file to the tmp dir For when the PHP file moves and renames the file to the appropriate dir If you put error codes in that handle these instances, you can get a better idea of what is going wrong, when its going wrong. I did have trouble checking your file because of this line: var files:FileList = new FileList (); It said it could not load that class, so I am not sure about if your class is the culprit. I did notice you were using a relative path for referencing your albums.php. Maybe try a hard link and see if that is what makes it work? Also, you should probably set up your file list to be an array that is sent to the PHP file instead of putting each variable into a string at the end of your URL. Then read through and split up into the variables needed to process the PHP. EG PHP: for(file in fileList) { //split up into separate variables } Check and see if your permissions are set correctly for everything.. PHP file, upload directory, tmp directory, the directory your moving the files to once uploaded. If you are using https, I am not sure, but I think all these things have to be specified in that file for any of this to work. But again, I do not use https that much and am no expert on that subject. I would check with your servers admin on what is the proper set-up for your server. OH, and one last thing... :P Make sure your using the right version of PHP for your server settings. Most have PHP 5, but like my hosting service, they use PHP 4.5. Whole different ball game when creating an upload form. Some of this may be redundant if your able to get it to work on other system, but checking all cases is probably your best bet on figuring it out. :) HTH Karl HTHs you Phillippe as well... On Jun 18, 2009, at 6:34 PM, Karl DeSaulniers wrote: Hey T, If you want to send me your code offline or here, I am on a MAC and work primarily in AS2 and can test for you. Which uploader are you using? I have this error check listener in mine and it works fine. imagePane is a component in my file that displays the uploaded file once complete. listener.onHTTPError = function(file:FileReference, httpError:Number):Void { imagePane.contentPath = error; imagePane.content.errorMSG.text = HTTPError number: +httpError +\nFile: + file.name; } listener.onIOError = function(file:FileReference):Void { imagePane.contentPath = error; imagePane.content.errorMSG.text = IOError: + file.name; } listener.onSecurityError = function(file:FileReference, errorString:String):Void { imagePane.contentPath = error; imagePane.content.errorMSG.text = SecurityError: +SecurityError +\nFile: + file.name; } HTH, Karl On Jun 18, 2009, at 6:21 PM, TS wrote: My uploader works on every other platform except for Mac. The file uploader never completes and throws an ioError? Latest Player installed on FF. Using PHP as the file handler on the backend. Anyone else have this issue or know a workaround? Thanks, T ___ 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 Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS 2.0 FileReference issue I/O error thrown
T, What is in this FileList class? Can you just use an Array instead and still transfer the information, say... var files:Array = []; or var files:Array = new Array(); ? you may have to use .push( instead of .addItem( J.A.T. Karl On Jul 9, 2009, at 3:58 PM, Karl DeSaulniers wrote: Hey T, Sorry to get back to you so late down the line. Hopefully this message finds you in a position to where you will not need it. I had another gentleman ask abut the same question, so I was going to suggest to you and him to also try adding in error handlers to your PHP file that would trigger a response that you designate per each situation. EG: You could make an error code... For when the PHP file reads the dir/For when the PHP file writes the dir For when the PHP file uploads your file to the tmp dir For when the PHP file moves and renames the file to the appropriate dir If you put error codes in that handle these instances, you can get a better idea of what is going wrong, when its going wrong. I did have trouble checking your file because of this line: var files:FileList = new FileList (); It said it could not load that class, so I am not sure about if your class is the culprit. I did notice you were using a relative path for referencing your albums.php. Maybe try a hard link and see if that is what makes it work? Also, you should probably set up your file list to be an array that is sent to the PHP file instead of putting each variable into a string at the end of your URL. Then read through and split up into the variables needed to process the PHP. EG PHP: for(file in fileList) { //split up into separate variables } Check and see if your permissions are set correctly for everything.. PHP file, upload directory, tmp directory, the directory your moving the files to once uploaded. If you are using https, I am not sure, but I think all these things have to be specified in that file for any of this to work. But again, I do not use https that much and am no expert on that subject. I would check with your servers admin on what is the proper set-up for your server. OH, and one last thing... :P Make sure your using the right version of PHP for your server settings. Most have PHP 5, but like my hosting service, they use PHP 4.5. Whole different ball game when creating an upload form. Some of this may be redundant if your able to get it to work on other system, but checking all cases is probably your best bet on figuring it out. :) HTH Karl HTHs you Phillippe as well... On Jun 18, 2009, at 6:34 PM, Karl DeSaulniers wrote: Hey T, If you want to send me your code offline or here, I am on a MAC and work primarily in AS2 and can test for you. Which uploader are you using? I have this error check listener in mine and it works fine. imagePane is a component in my file that displays the uploaded file once complete. listener.onHTTPError = function(file:FileReference, httpError:Number):Void { imagePane.contentPath = error; imagePane.content.errorMSG.text = HTTPError number: +httpError +\nFile: + file.name; } listener.onIOError = function(file:FileReference):Void { imagePane.contentPath = error; imagePane.content.errorMSG.text = IOError: + file.name; } listener.onSecurityError = function(file:FileReference, errorString:String):Void { imagePane.contentPath = error; imagePane.content.errorMSG.text = SecurityError: +SecurityError +\nFile: + file.name; } HTH, Karl On Jun 18, 2009, at 6:21 PM, TS wrote: My uploader works on every other platform except for Mac. The file uploader never completes and throws an ioError? Latest Player installed on FF. Using PHP as the file handler on the backend. Anyone else have this issue or know a workaround? Thanks, T Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] styled text disappears when clicked or animated
I have an entire site full of runtime created TextFields. Some are styled with Stylesheet objects, others with TextFormat objects. That all works fine but when it comes time to script some tweens on them or their display parents, the text disappears! Running the .swf by itself locally tends to work just fine but as soon as a browser displays it... poof, gone. I haven't done much testing with and without formatting/styling/embeded fonts since going without is pretty much out of the question. Anyone know the wicked little trick I know exists out there somewhere? I just want to finish this bad boy and get some sleep. :) -- --Joel Stransky stranskydesign.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] styled text disappears when clicked or animated
I have a similar issue, runtime created Textfields in a scrolling list. If the mouse is within the bounds of the list and I use the scrollwheel to scroll, when the text goes under the cursor it vanishes. I've tried cache as bitmap, didn't work. Any ideas to overcome this annoying little bit of Flash voodoo? -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Joel Stransky Sent: Friday, 10 July 2009 9:37 a.m. To: Flash Coders List Subject: [Flashcoders] styled text disappears when clicked or animated I have an entire site full of runtime created TextFields. Some are styled with Stylesheet objects, others with TextFormat objects. That all works fine but when it comes time to script some tweens on them or their display parents, the text disappears! Running the .swf by itself locally tends to work just fine but as soon as a browser displays it... poof, gone. I haven't done much testing with and without formatting/styling/embeded fonts since going without is pretty much out of the question. Anyone know the wicked little trick I know exists out there somewhere? I just want to finish this bad boy and get some sleep. :) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Is this error prone? [loading multiple images]
That's good thinking. I'll have to look into it some more. This one is just hard to test since removeEventListener fails silently if the listener isn't on the targets listener list. On Thu, Jul 9, 2009 at 12:53 PM, Ktu ktu_fl...@cataclysmicrewind.comwrote: I think I see a problem with this. I don't know how often GarbageCollection runs, but if the loader you create has no references to it, and the only event listener to it is set to have a weakReference, then the loader could get discarded before it finishes, unless the act of loading doesn't allow it to be removed. Otherwise, as far as I know, that looks like it should be fine to get reference to the loader again and remove the event listener. ? Ktu On Tue, Jul 7, 2009 at 12:50 PM, Joel Stransky j...@stranskydesign.com wrote: I'm wondering if I can use a for loop to create local Loader objects, assign listeners to their LoaderInfo objects without overwriting any of them and still be able to clean up after. Say I have the following inside a function body var img:Loader = new Loader(); img.contentLoaderInfo.addEventListener(Event.COMPLETE, onThumb, false, 0, true); img.load(new URLRequest(someImage.jpg)); and the following handler private function onThumb(e:Event):void { var loader:Loader = Loader( LoaderInfo(e.target).loader ); loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, onThumb); var thumbNail:Bitmap = new Bitmap(Bitmap(loader.content).bitmapData); thumbNail.x = (itemWidth - thumbNail.width) / 2; addChild(thumbNail); } Will the handler work its way back to the Loader that was created temporarily and remove a listener from it? Is there a better way to using throw away loaders? -- --Joel Stransky stranskydesign.com ___ 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 Stransky stranskydesign.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] styled text disappears when clicked or animated
Can you set the value of the textBox to a variable in the first state and specify while tweening or any other function that the textBox = thatVariable while performing? Might work. That way, while tweening or other, your specifying that the text is the same and loaded. If it was an animation sequence, I would say put the textBox = thatVariable; code on the play frames between tween key frames for e.g.. JAT Karl On Jul 9, 2009, at 4:44 PM, Barry Hannah wrote: I have a similar issue, runtime created Textfields in a scrolling list. If the mouse is within the bounds of the list and I use the scrollwheel to scroll, when the text goes under the cursor it vanishes. I've tried cache as bitmap, didn't work. Any ideas to overcome this annoying little bit of Flash voodoo? -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Joel Stransky Sent: Friday, 10 July 2009 9:37 a.m. To: Flash Coders List Subject: [Flashcoders] styled text disappears when clicked or animated I have an entire site full of runtime created TextFields. Some are styled with Stylesheet objects, others with TextFormat objects. That all works fine but when it comes time to script some tweens on them or their display parents, the text disappears! Running the .swf by itself locally tends to work just fine but as soon as a browser displays it... poof, gone. I haven't done much testing with and without formatting/styling/embeded fonts since going without is pretty much out of the question. Anyone know the wicked little trick I know exists out there somewhere? I just want to finish this bad boy and get some sleep. :) ___ 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] styled text disappears when clicked or animated
I considered that Kari but it just too much of a performance hit I'm afraid. There might be something to combing cacheAsBitmap = true and selectable = false... On Thu, Jul 9, 2009 at 5:54 PM, Karl DeSaulniers k...@designdrumm.comwrote: Can you set the value of the textBox to a variable in the first state and specify while tweening or any other function that the textBox = thatVariable while performing? Might work. That way, while tweening or other, your specifying that the text is the same and loaded. If it was an animation sequence, I would say put the textBox = thatVariable; code on the play frames between tween key frames for e.g.. JAT Karl On Jul 9, 2009, at 4:44 PM, Barry Hannah wrote: I have a similar issue, runtime created Textfields in a scrolling list. If the mouse is within the bounds of the list and I use the scrollwheel to scroll, when the text goes under the cursor it vanishes. I've tried cache as bitmap, didn't work. Any ideas to overcome this annoying little bit of Flash voodoo? -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Joel Stransky Sent: Friday, 10 July 2009 9:37 a.m. To: Flash Coders List Subject: [Flashcoders] styled text disappears when clicked or animated I have an entire site full of runtime created TextFields. Some are styled with Stylesheet objects, others with TextFormat objects. That all works fine but when it comes time to script some tweens on them or their display parents, the text disappears! Running the .swf by itself locally tends to work just fine but as soon as a browser displays it... poof, gone. I haven't done much testing with and without formatting/styling/embeded fonts since going without is pretty much out of the question. Anyone know the wicked little trick I know exists out there somewhere? I just want to finish this bad boy and get some sleep. :) ___ 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 -- --Joel Stransky stranskydesign.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] styled text disappears when clicked or animated
The performance hit is when you try and animate or tween anything that is cached as a bitmap. Every time that cached file changes, it has to set it in cache again. If the next frame or state of the text box has not had the text set in it so it can be cached, then it caches an empty text box. Thus removing the previous frames/states text. I would set the variable before you set any texBoxes and then reference the variable when you want to load the texBox. Or don't cache as a bitmap. I think what is happening is that the text is placed into the textBox when the first frame is set but not holding once the textBox changes frames. If you set the variable first, then set the value of the textBox to that variable, no matter which frame/state that textBox is in, it should = that variable. I have done this in some of my flash files and I didn't notice a performance hit, but then again I didn't really test for that. Another possible way of embedding multiple fonts is to load a swf that has that font embedded in it and that is all. You can make one for each font and load them on the fly before setting the textBox that uses that font. Then you don't have a bunch of font instances in your main swf, just in their own separate (small size) swf but can still have an instance of your font loaded to the stage for embedding. Mind you this is not a documented practice that I know of, just a though of mine. G.L. Karl On Jul 9, 2009, at 5:03 PM, Joel Stransky wrote: I considered that Kari but it just too much of a performance hit I'm afraid. There might be something to combing cacheAsBitmap = true and selectable = false... On Thu, Jul 9, 2009 at 5:54 PM, Karl DeSaulniers k...@designdrumm.comwrote: Can you set the value of the textBox to a variable in the first state and specify while tweening or any other function that the textBox = thatVariable while performing? Might work. That way, while tweening or other, your specifying that the text is the same and loaded. If it was an animation sequence, I would say put the textBox = thatVariable; code on the play frames between tween key frames for e.g.. JAT Karl On Jul 9, 2009, at 4:44 PM, Barry Hannah wrote: I have a similar issue, runtime created Textfields in a scrolling list. If the mouse is within the bounds of the list and I use the scrollwheel to scroll, when the text goes under the cursor it vanishes. I've tried cache as bitmap, didn't work. Any ideas to overcome this annoying little bit of Flash voodoo? -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Joel Stransky Sent: Friday, 10 July 2009 9:37 a.m. To: Flash Coders List Subject: [Flashcoders] styled text disappears when clicked or animated I have an entire site full of runtime created TextFields. Some are styled with Stylesheet objects, others with TextFormat objects. That all works fine but when it comes time to script some tweens on them or their display parents, the text disappears! Running the .swf by itself locally tends to work just fine but as soon as a browser displays it... poof, gone. I haven't done much testing with and without formatting/styling/embeded fonts since going without is pretty much out of the question. Anyone know the wicked little trick I know exists out there somewhere? I just want to finish this bad boy and get some sleep. :) ___ 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 -- --Joel Stransky stranskydesign.com ___ 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] styled text disappears when clicked or animated
From Adobe LiveDocs: cacheAsBitmap AS2 http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/ wwhelp.htm?context=LiveDocs_Partsfile=2445.html Best, Karl On Jul 9, 2009, at 5:43 PM, Karl DeSaulniers wrote: The performance hit is when you try and animate or tween anything that is cached as a bitmap. Every time that cached file changes, it has to set it in cache again. If the next frame or state of the text box has not had the text set in it so it can be cached, then it caches an empty text box. Thus removing the previous frames/states text. I would set the variable before you set any texBoxes and then reference the variable when you want to load the texBox. Or don't cache as a bitmap. I think what is happening is that the text is placed into the textBox when the first frame is set but not holding once the textBox changes frames. If you set the variable first, then set the value of the textBox to that variable, no matter which frame/state that textBox is in, it should = that variable. I have done this in some of my flash files and I didn't notice a performance hit, but then again I didn't really test for that. Another possible way of embedding multiple fonts is to load a swf that has that font embedded in it and that is all. You can make one for each font and load them on the fly before setting the textBox that uses that font. Then you don't have a bunch of font instances in your main swf, just in their own separate (small size) swf but can still have an instance of your font loaded to the stage for embedding. Mind you this is not a documented practice that I know of, just a though of mine. G.L. Karl On Jul 9, 2009, at 5:03 PM, Joel Stransky wrote: I considered that Kari but it just too much of a performance hit I'm afraid. There might be something to combing cacheAsBitmap = true and selectable = false... On Thu, Jul 9, 2009 at 5:54 PM, Karl DeSaulniers k...@designdrumm.comwrote: Can you set the value of the textBox to a variable in the first state and specify while tweening or any other function that the textBox = thatVariable while performing? Might work. That way, while tweening or other, your specifying that the text is the same and loaded. If it was an animation sequence, I would say put the textBox = thatVariable; code on the play frames between tween key frames for e.g.. JAT Karl On Jul 9, 2009, at 4:44 PM, Barry Hannah wrote: I have a similar issue, runtime created Textfields in a scrolling list. If the mouse is within the bounds of the list and I use the scrollwheel to scroll, when the text goes under the cursor it vanishes. I've tried cache as bitmap, didn't work. Any ideas to overcome this annoying little bit of Flash voodoo? -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Joel Stransky Sent: Friday, 10 July 2009 9:37 a.m. To: Flash Coders List Subject: [Flashcoders] styled text disappears when clicked or animated I have an entire site full of runtime created TextFields. Some are styled with Stylesheet objects, others with TextFormat objects. That all works fine but when it comes time to script some tweens on them or their display parents, the text disappears! Running the .swf by itself locally tends to work just fine but as soon as a browser displays it... poof, gone. I haven't done much testing with and without formatting/styling/embeded fonts since going without is pretty much out of the question. Anyone know the wicked little trick I know exists out there somewhere? I just want to finish this bad boy and get some sleep. :) ___ 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 -- --Joel Stransky stranskydesign.com ___ 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 Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] styled text disappears when clicked or animated
Joel, wondering (seeing as cacheBitmap alone doesn't seem to want to work for me) if adding a subtle filter to text might encourage it to stay put? I'm going to give it a try. Barry. -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: Friday, 10 July 2009 11:19 a.m. To: Flash Coders List Subject: Re: [Flashcoders] styled text disappears when clicked or animated From Adobe LiveDocs: cacheAsBitmap AS2 http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/ wwhelp.htm?context=LiveDocs_Partsfile=2445.html Best, Karl ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders