RE: [Flashcoders] How do you tell if an Object is dynamic?
I ran into a particular situation where i had a function that took an Object as a parameter. I needed that Object to be an actual Object i.e. dynamic because the function was going to add properties to it. But since everything in ActionScript is an Object I had trouble enforcing this. Is there a way to check to see if an Object is dynamic? Or is there a way to enforce something as an Object rather than a subclass of in Object (which is everthing else)? Why not have the object required to be an instance of a custom class instead of a generic object? You typecast the argument to be your custom class. i.e. import MyCustomClass; class myClass { private function myFunction (myCustomClass:MyCustomClass):void { } } Would that do what you want? Jason Merrill Bank of America GTO LLD Solutions Design Development eTools Multimedia Bank of America Flash Platform Developer Community ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] How do you tell if an Object is dynamic?
Hi, on a sidenote, a dictionary object from object to object can be created for as2 very easily as well, the problem lies with the absence of weak referencing. Even then it is stll very usefull in as2 as well. greetz JC On Jan 5, 2008 8:41 AM, T. Michael Keesey [EMAIL PROTECTED] wrote: If you're using AS3, you might consider using a Dictionary object instead. If not, then you could make your own dynamic subclass of Object and use that (although that might break other code -- I'm not sure what your situation is). On Jan 4, 2008 5:51 PM, Jamie S [EMAIL PROTECTED] wrote: I ran into a particular situation where i had a function that took an Object as a parameter. I needed that Object to be an actual Object i.e. dynamic because the function was going to add properties to it. But since everything in ActionScript is an Object I had trouble enforcing this. Is there a way to check to see if an Object is dynamic? Or is there a way to enforce something as an Object rather than a subclass of in Object (which is everthing else)? Jamie ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- T. Michael Keesey Director of Technology Exopolis, Inc. 2894 Rowena Avenue Ste. B Los Angeles, California 90039 http://exopolis.com/ -- http://3lbmonkeybrain.blogspot.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
Re: [Flashcoders] Getting the project directory path in AIR
Let me ask you something. Have you tried this : /import flash.filesystem.File; var dir:File = File.applicationDirectory; trace ( dir.nativePath );/ I remember that this approach had some problems in beta 2. Can´t remember exactly what. But you can give it a try ;) CrAzYcAlL Omar Fouad wrote: Ok it works, but sometimes it returns the path of the subfolders inside the application directory. Why? On Jan 3, 2008 12:00 PM, CrAzYcAlL [EMAIL PROTECTED] wrote: If you type this on the first frame of your application you will get an error , because the call to swithVideo will happens before the InvokeEvent. add a button to your app and label it btn for example and try this at frame 1: var appDir:File; NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE ,onInvoke) function onInvoke (invokeEvent:InvokeEvent):void{ appDir = invokeEvent.currentDirectory; } function switchVideo(st:String):void { trace(appDir.nativePath); } btn.addEventListener(MouseEvent.CLICK, clickVideo); function clickVideo (evt:MouseEvent):void{ switchVideo(Video); } so the problem was that you were calling switchVideo before onInvoke takes place, and the appDir variable was not populated yet. CrAzYcAlL Omar Fouad wrote: When I use: NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, onInvoke) var AppDir; function onInvoke(e:InvokeEvent) { AppDir = e.currentDirectory; trace(AppDir.nativePath); // traces the path } function switchVideo(st:String) { var fileStream:FileStream = new FileStream(); fileStream.openAsync(AppDir.resolvePath(aA.txt), FileMode.WRITE); fileStream.writeUTFBytes(A); fileStream.close(); trace(AppDir.nativePath); // throws an Error } SwitchVideo(Video); Why AppData is not recognized only in the onInvoke() function dispached by the Invoke Event? On Jan 1, 2008 6:16 PM, Omar Fouad [EMAIL PROTECTED] wrote: Ok it wored just fine thanks for your Help :D Happy Feasts :D On Jan 1, 2008 6:15 PM, Omar Fouad [EMAIL PROTECTED] wrote: Well beside the code hint is not working, in the documentation there is definition for the Native Application. BTW I'll try what u sent and feedback... Copy that. On Jan 1, 2008 6:12 AM, CrAzYcAlL [EMAIL PROTECTED] wrote: Well that´s the way I use when doing Air projects with Flash CS3. Even the code hint is working in flash IDE. here is a .fla test: http://www.adrianosantangeli.com/FlashAir.fla CrAzYcAlL Omar Fouad wrote: Well I am using the Beta 3 but there is no NativeApplication Class. P.S. : Um using the flash CS3 Air Update. On Dec 31, 2007 3:24 AM, CrAzYcAlL [EMAIL PROTECTED] wrote: What version of Air ? flash.desktop.NativeApplication is for beta2 and beta3 if you're using an older version you need to use flash.System.Shell instead. CrAzYcAlL * *Omar Fouad wrote: flash.desktop.NativeApplication is not a Class in the AS3 library,,, On Dec 31, 2007 12:45 AM, CrAzYcAlL [EMAIL PROTECTED] wrote: use InvokeEvent : import flash.events.InvokeEvent; import flash.desktop.NativeApplication; import flash.filesystem.File; var appDir:File; NativeApplication.nativeApplication.addEventListener( InvokeEvent.INVOKE , onInvoke) function onInvoke (invokeEvent:InvokeEvent):void{ appDir = invokeEvent.currentDirectory; trace ( appDir.nativePath ); } CrAzYcAlL Omar Fouad wrote: Hey, Um doing some kiosk database driven Application in AIR, and I need to return the absolute directory path of the .fla file itself in order to be able to write files in the same application directory. I tried: var path:File.applicationStorageDirectory; trace(path.nativePath) // it returned some other directory inside documents and settings any Idea? ___ 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 -- Omar M. Fouad - Digital Emotions http://www.omarfouad.net This e-mail and any
[Flashcoders] online game creation course using action script 2.0
Hi Folks, I know several of you over the years have been interested in game creation using Flash Action Script 2/3 using the Object Oriented paradigm (as opposed to the old timeline based scheme). I will be offering a couple of online courses for members of this group for FREE starting early late Jan/early Feb 2008 and later on when time permits... If you are looking to leap into the world of flash game creation please navigate to the url below and register. No programming skills are required for creating simple games. You need a computer with high speed internet connectivity - everything is online including the game creation tools and a script editor. The games are all flash based and they could be hosted on any website. You need a MAC/Linux/Windows machine with the Firefox/IE/opera Browser to get going and I am sure you have the flash plugin installed :-).. And if any of you experts out there have time and interest in taking up contract work for creating a set of fun flash games that can make people happy and laugh, please let me know. ./nanu CTO, http://www.gamebrix.net Build | Share | Play 2008 Game Developers Conference, San Francisco Booth #2N45 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Getting the project directory path in AIR
http://labs.adobe.com/wiki/index.php/AIR:Documentation I use the LiveDocs when getting info of new things, because that is the one they are continually updating. CrAzYcAlL. Omar Fouad wrote: Wow that worked But how do you get the Methods and Classes that I cannot find in the documentation and that have not Code hints? On Jan 5, 2008 1:27 PM, CrAzYcAlL [EMAIL PROTECTED] wrote: Let me ask you something. Have you tried this : /import flash.filesystem.File; var dir:File = File.applicationDirectory; trace ( dir.nativePath );/ I remember that this approach had some problems in beta 2. Can´t remember exactly what. But you can give it a try ;) CrAzYcAlL Omar Fouad wrote: Ok it works, but sometimes it returns the path of the subfolders inside the application directory. Why? On Jan 3, 2008 12:00 PM, CrAzYcAlL [EMAIL PROTECTED] wrote: If you type this on the first frame of your application you will get an error , because the call to swithVideo will happens before the InvokeEvent. add a button to your app and label it btn for example and try this at frame 1: var appDir:File; NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE ,onInvoke) function onInvoke (invokeEvent:InvokeEvent):void{ appDir = invokeEvent.currentDirectory; } function switchVideo(st:String):void { trace(appDir.nativePath); } btn.addEventListener(MouseEvent.CLICK, clickVideo); function clickVideo (evt:MouseEvent):void{ switchVideo(Video); } so the problem was that you were calling switchVideo before onInvoke takes place, and the appDir variable was not populated yet. CrAzYcAlL Omar Fouad wrote: When I use: NativeApplication.nativeApplication.addEventListener( InvokeEvent.INVOKE, onInvoke) var AppDir; function onInvoke(e:InvokeEvent) { AppDir = e.currentDirectory; trace(AppDir.nativePath); // traces the path } function switchVideo(st:String) { var fileStream:FileStream = new FileStream(); fileStream.openAsync(AppDir.resolvePath(aA.txt), FileMode.WRITE ); fileStream.writeUTFBytes(A); fileStream.close(); trace(AppDir.nativePath); // throws an Error } SwitchVideo(Video); Why AppData is not recognized only in the onInvoke() function dispached by the Invoke Event? On Jan 1, 2008 6:16 PM, Omar Fouad [EMAIL PROTECTED] wrote: Ok it wored just fine thanks for your Help :D Happy Feasts :D On Jan 1, 2008 6:15 PM, Omar Fouad [EMAIL PROTECTED] wrote: Well beside the code hint is not working, in the documentation there is definition for the Native Application. BTW I'll try what u sent and feedback... Copy that. On Jan 1, 2008 6:12 AM, CrAzYcAlL [EMAIL PROTECTED] wrote: Well that´s the way I use when doing Air projects with Flash CS3. Even the code hint is working in flash IDE. here is a .fla test: http://www.adrianosantangeli.com/FlashAir.fla CrAzYcAlL Omar Fouad wrote: Well I am using the Beta 3 but there is no NativeApplication Class. P.S. : Um using the flash CS3 Air Update. On Dec 31, 2007 3:24 AM, CrAzYcAlL [EMAIL PROTECTED] wrote: What version of Air ? flash.desktop.NativeApplication is for beta2 and beta3 if you're using an older version you need to use flash.System.Shell instead. CrAzYcAlL * *Omar Fouad wrote: flash.desktop.NativeApplication is not a Class in the AS3 library,,, On Dec 31, 2007 12:45 AM, CrAzYcAlL [EMAIL PROTECTED] wrote: use InvokeEvent : import flash.events.InvokeEvent; import flash.desktop.NativeApplication; import flash.filesystem.File; var appDir:File; NativeApplication.nativeApplication.addEventListener( InvokeEvent.INVOKE , onInvoke) function onInvoke (invokeEvent:InvokeEvent):void{ appDir = invokeEvent.currentDirectory; trace ( appDir.nativePath ); } CrAzYcAlL Omar Fouad wrote: Hey, Um doing some kiosk database driven Application in AIR, and I need to return the absolute directory path of the .fla file itself in order to be able to write files in the same application directory. I tried: var path:File.applicationStorageDirectory; trace(path.nativePath) // it returned some other directory inside documents and settings
Re: [Flashcoders] Getting the project directory path in AIR
You are a Good Dude... Thanks For your help :D Cheers!! -- Omar M. Fouad - Digital Emotions http://www.omarfouad.net This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] setting text of dynamic TextArea component
___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] setting text of dynamic TextArea component
Trying again. The last message came through as blank. I'll try plain text: I'm trying to build a custom display object in CS3 using AS2. I thought I'd use the TextArea component instead of TextFields that I usually use to take advantage of the css support, etc. For each cell in my display I instantiate a custom component using attachMovie. The component contains two instances of TextArea called ta_1 and ta_2. I thought I'd be able to access ta_1.text and ta_2.text directly, since ta_1 and ta_2 should be instances of TextArea, but they are not. When I trace them out they are MovieClips. They have one property that I can find using for in called label, which is not an instance of TextArea either, but which has all of the properties listed below, including text. However, when I try to set the value of text, I don't see any result. What am I missing here? Thanks! label.styleSheet = undefined label.mouseWheelEnabled = true label.condenseWhite = false label.restrict = null label.textHeight = 17 label.textWidth = 0 label.bottomScroll = 1 label.length = 0 label.selectable = true label.multiline = false label.password = false label.wordWrap = false label.background = false label.border = false label.html = false label.embedFonts = false label.maxChars = null label.maxhscroll = 0 label.hscroll = 0 label.variable = null label.htmlText = label.type = input label.text = label.autoSize = none label.tabIndex = undefined label.textColor = 0 label.backgroundColor = 16777215 label.borderColor = 0 label.maxscroll = 1 label.scroll = 1 label.getFocusManager = [type Function] label.onKillFocus = [type Function] label.onSetFocus = [type Function] label.setFocus = [type Function] label.changeTextStyleInChildren = [type Function label.setStyle = [type Function] label.adjustFocusRect = [type Function] label.drawFocus = [type Function] label.getPreferredHeight = [type Function] label.getPreferredWidth = [type Function] label._getTextFormat = [type Function] label.value = label.getValue = [type Function] label.setValue = [type Function] label.__getTextFormat = [type Function] label.getStyle = [type Function] label.setColor = [type Function] label.draw = [type Function] label.invalidateStyle = [type Function] label.setSize = [type Function] label.move = [type Function] label.enabled = undefined label.visible = true label.bottom = NaN label.right = NaN label.y = 0 label.top = 0 label.x = 0 label.left = 0 label.height = 44 label.width = 100 label.filters = label.sharpness = 0 label.thickness = 0 label.antiAliasType = normal label.gridFitType = pixel ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] setting text of dynamic TextArea component
Andrew Sinning wrote: For each cell in my display I instantiate a custom component using attachMovie. After attaching the new instance of the container component, I then immediately try to set the text of the contained TextAreas. I think the problem is that the TAs don't completely exist at the exact moment that the new instances are created! I'm going to have to build in some setter functions. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] parent property woes in AS3
In AS3 I am tring to get the parent movieClip that contains some movieClip timeline animation... parent.play(); It gets me an Error??? is there something wrong? -- Omar M. Fouad - Digital Emotions http://www.omarfouad.net This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] parent property woes in AS3
The parent is a property of DisplayObject class, while the play() method is belongs to MovieClip class which is a sub class of DisplayObject. Therefore the reference of the property should be cast to MovieClip class. MovieClip(parent).play(); _ Omar Fouad wrote: In AS3 I am tring to get the parent movieClip that contains some movieClip timeline animation... parent.play(); It gets me an Error??? Good luck, -- Fumio Nonaka mailto:[EMAIL PROTECTED] http://www.FumioNonaka.com/ My bookshttp://www.FumioNonaka.com/Books/index.html Flash communityhttp://F-site.org/ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] parent property woes in AS3
so if I am inside a movieClip mc i should do: mc(parent).play(); ??? On Jan 6, 2008 5:45 AM, Fumio Nonaka [EMAIL PROTECTED] wrote: The parent is a property of DisplayObject class, while the play() method is belongs to MovieClip class which is a sub class of DisplayObject. Therefore the reference of the property should be cast to MovieClip class. MovieClip(parent).play(); _ Omar Fouad wrote: In AS3 I am tring to get the parent movieClip that contains some movieClip timeline animation... parent.play(); It gets me an Error??? Good luck, -- Fumio Nonaka mailto:[EMAIL PROTECTED] http://www.FumioNonaka.com/ My bookshttp://www.FumioNonaka.com/Books/index.html Flash communityhttp://F-site.org/ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Omar M. Fouad - Digital Emotions http://www.omarfouad.net This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders