Re: [Flashcoders] AS3 Sound = wtf
Yeah sound was a bit of code, test, re-read documentation, trail, and error process. I ended up creating an internal class called tSound (light class with 2 members) that contained a Sound and a SoundChannel that is used in a SoundManager for individual sounds. I used the SoundMixer to control global sound. You alway have to instantiate a new SoundTransform when you want to manipulate either the volume or the pan for an individual sound or the SoundMixer itself. Which I don't like. I haven't implemented converting ByteArrays to Sounds as I haven't the need for it. My next step is adding positional sound when I get the chance to. Just wanted to put my 2 cents in. Cheers, R. EECOLOR wrote: Maybe this is a project you would like to check out? http://code.google.com/p/popforge/ Greetz Erik On 9/13/07, Andreas Rønning [EMAIL PROTECTED] wrote: I didn't mean hacking was wrong by any stretch, but i am not a hacker. I simply don't have the time / budget to get in-depth on that level. Imagine what these hacker types (Andrè Michelle in particular) could do if the API natively supported the things they now hack to do? I don't really think the things Michelle does is special in terms of audio programming, but it IS special in a Flash context because of how limited the API is. It's a moan about how truly awesome Flash audio could've been with some direct way to affect audio and an orderly way to manage it i suppose? I'll write up a feature request myself. Good to hear more people want the same :) - A ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Animating Character Movement
Try the State Pattern. I have successfully used this in a line of games I did for a client. The Quick and Dirty explanation: Each state knows what it needs to do. On a change state the old state exits and the new state enters. On an update (onEnterFrame) the state is handled (it does what it needs to accomplish). Any state can be interrupted to go into another state. Each state implements an interface. In my games I had a hierarchical state pattern (states within states) and the root state was in the game manager which held all the game logic methods that states could use to accomplish whatever task they wanted. More info (cleaner and clearer) here: http://www.ai-junkie.com/architecture/state_driven/tut_state1.html Ciao, Rob. James Marsden wrote: Hey Dan, I've had a bit of a struggle with this too. I've tried a few ways of doing it, but have settled on having all state/animations in a MovieClip on the first frame of the character MovieClip, and then functions to show and hide whichever animations you need eg: turnRightFromLeft() { paddleLeftMC.visible = false; idleLeftMC.visible = false; idleRightMC.visible = false idleCentre.gotoAndPlay(turnRightFromLeft); // at the end of this animation, it calls back to set 'paddleRightMC.visible = true'; } It's quite long winded, and you still need a state machine to work out which functions you need to call, but the other ways I tried were vastly more complex, and introducing a new animation at a later date was a real headache. HTH, James Holth, Daniel C. wrote: Hello, I'm working on an project where the user uses the arrows keys to move a guy in a kayak left and right across the screen. I have 6 total animations set up: Paddling Left, Idle Facing Left, Turning Left to Right, Paddling Right, Idle Facing Right, and Turning Right To Left. I've never programmed a moving character before, so I'm looking for some tips on the best way to program this sort of thing. I started to create a pseudo-state pattern using a 6 switch statement to figure out what state the character is currently in and responding accordingly when the user presses a key. This seems rather tedious though, and I figured there must be a better way of doing this. I think the part I'm having the most trouble with is the 'turning states'. Any feedback greatly appreciated! I can post some of my current code if it helps, but I really haven't gotten anywhere productive with it yet. Thanks! Daniel Holth I.S. Programmer This e-mail and its attachments are intended only for the use of the addressee(s) and may contain privileged, confidential or proprietary information. If you are not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution, displaying, copying, or use of this information is strictly prohibited. If you have received this communication in error, please inform the sender immediately and delete and destroy any record of this message. Thank you. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] AS2: generating new instances dynamically?
I associate my AS2 classes to my library symbols through Object.registerClass(LibraryID, ClassName). Where: LibraryID is an identifier in the FLA of a movie clip. ClassName is a class that eventually extends a Movieclip. I have a RegisterClasses singleton that is the first thing that is called before I start my application manager. I just change the code in RegisterClasses if I have a different version of a particular class and if I compile with MTASC I don't have to open up the FLA. When attaching a movie clip I just use the attachMovie method and if I wanted to pass arguments to the constructor I would use the 4th argument and pass an object. The object members are equivalent to members of the class. For example passing {something:value} in the method gives the class a member called something when the constructor hits. Just wanted to add my way too! Ciao, Rob. Muzak wrote: To be honest, I've always found that alot of hassle just to attach a movieclip. I've never bought into the createClassObject/createObject-way used by the v2 component framework either. If all you're after is the correct type when using attachMovie, do the following. private var customClip:CustomClip private function onLoad() { var mc:CustomClip = CustomClip(this.attachMovie(CustomClip, customClip, this.getNextHighestDepth())); // calling non-existing method - throws error mc.someMethod(); } Doesn't get any easier than that if you ask me. Of course, in AS3 attachMovie is gone and we can just use: var mc:CustomClip = new CustomClip(); ;-) regards, Muzak - Original Message - From: Matthias Dittgen [EMAIL PROTECTED] To: flashcoders@chattyfig.figleaf.com Sent: Thursday, May 03, 2007 9:43 AM Subject: Re: [Flashcoders] AS2: generating new instances dynamically? This discussion is very interesting, so I would like to offer my approach of attaching/construction of visual classes. I am open for optimization hints. I am using something like this: 1) THE CLASS EXTENDING MOVIECLIP class com.path.MyVisual extends MovieClip { public static var _SYMBOL_NAME:String = __Packages.com.path.MyVisual; public static var _SYMBOL_OWNER:Function = MyVisual; public static var _SYMBOL_LINKED = Object.registerClass(_SYMBOL_NAME,_SYMBOL_OWNER); private var __width:Number; private var __text:String; public static function create(target:MovieClip, initObject:Object, depth:Number, name:String):MyVisual { depth = (depth!=undefined?depth:target.getNextHighestDepth()); name = (name!=undefined?name:myVisual+depth); return MyVisual(target.attachMovie(MyVisual._SYMBOL_NAME, name, depth, initObject)); } public static function createInitObject(width:Number, text:String):Object { return { __width: width, __text: text}; } private function MyVisual() { // I can use __width and __text here, if I like so. } } 2) THE CONSTRUCTION OF AN INSTANCE I use the static create/createInitObject methods. The latter gives me its signature when the editor supports code completion. This way, it feels like a constructor and I get the correct type returned: var mv:MyVisual = MyVisual.create(this, MyVisual.createInitObject(200, Hello World)); Have fun, Matthias ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Syntax for dynamically calling a function
You could do something like this: class Something { method1(); method2(a_number:Number); } Somewhere else: var method_str:String = method1; var sm:Something = new Something(); sm[method_str](); // Will call method1 class method sm[method2](0x09F911029D74E35BD84156C5635688C0); // Also works ;-) Ciao, Rob. Alistair Colling wrote: Hi there, I want to call a function but want to able to call it dynamically so a string that is passed will determine which function is called. My reason for this is I have an interface with a number of buttons that have different labels but that look the same and need to call different functions. I was going to make one button and duplicate it then name it so it will call a function depending on what it's name is. My code would go something like this: ///inside 'button' MC named 'pictures' var label:String = this._name this.onPress = function(){ //want to call function from here, dictated by the name of the MC, not sure of this sytanx this._parent.label() } main timeline function pictures(){ //to be called from pictures button onPress event } /// Any suggestions much appreciated! Ali ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com --No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 269.6.2/781 - Release Date: 4/30/2007 9:14 AM ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Any good XML api out there?
Ever tried XML2Object? Check it out: http://www.sephiroth.it/file_detail.php?id=129 The only draw back is if there is only one element it won't put it into an array but an object. To resolve this I throw it into an array to unify use: if(!object.xml_element.length) { object.xml_element = new Array(object.xml_element); } Ciao, Rob. Johannes Nel wrote: xpath statement to get all the artist names ./root/track/artist/text() On 5/3/07, Johan Nyberg [EMAIL PROTECTED] wrote: Hi, what I need is basically a class that puts all the data in an associative array, or numeric, depending on if I'm storing values for individual nodes, or a mothernode. Now I find there is a lot of looping going on every time I have to parse a XML, and XPath seems more like the thing you want to use if you're looking for specific data inside the XML - I just want to put all the data in an Array or Object... For example: root track name/name artist/artist /track track name/name artist/artist /track /root I would like it like this: root[track[n][artist]] Regards, /Johan -- Johan Nyberg Web Guide Partner Sergels Torg 12, 8 tr 111 57 Stockholm 070 - 407 83 00 ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Flash / Java Communication with ExternalInterface
I'm not sure if this will help you but on my current project I have a Oracle / Java back end and I created some servlets to process and return XML to the Flash client for processing. Although for this project I am using AS3, what I use is equivalent to LoadVars. Servlets execute within the Web server’s process space and they persist between calls so they can keep state information as well. If anyone has anything to add or another suggestion I would be interested to know. Ciao, Rob. Alain Rousseau wrote: Hi All, we're at a point in a project where we need good communication between Flash and Java. ATM we are using SWT Flash and it's FSCommand handling. I would like to go a bit further to be able to send complex objects via ExternalInterface. I know there is Javaflash (HYPERLINK http://www.osflash.org/javaflash/http://www.osflash.org/javaflash/) out there but the official website is so slow and it seems to be still in beta. Basically, we are using Flash as GUI for a Java backend. We'll need to send back and forth some complex objects. We are currently exploring the possiblity of using XML to send values. What solution would be the best ? Meaning which one gets the fastest response, stability and extendability. Are there any other options or howto's than FSCommand ? any link or tips are welcome. Or is Javaflash stable enough for use in a commercial App ? Thanks in advance ! Alain No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.467 / Virus Database: 269.6.2/785 - Release Date: 2007-05-02 14:16 ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Implications of using GPL'ed libraries?
It has always been the FSF's position that dynamically linking applications to libraries creates a single work derived from both the library code and the application code. The GPL requires that all derivative works be licensed under the GPL, an effect which can be described as hereditary. So, if an application links to a library licensed under the GPL, the application too must be licensed under the GPL. By contrast, libraries licensed under the GNU Lesser General Public License (LGPL) may be linked to proprietary applications. Source: http://www.gnu.org/licenses/lgpl-java.html FSF == Free Software Foundation If you have to go the GPL route, you can tell your employers that all the code is in the SWF anyway, making it available just takes away an extra step from the process of acquiring the code. This has some good FAQs: http://www.gnu.org/licenses/gpl-faq.html Good Luck, Rob. Henry Cooke wrote: Hey folks, I'm looking at using some GPL licensed code (Flade, to be specific) in a game I'm building for my employers. However, I can't find a clear answer anywhere as to what that implies for our source: does anyone know if using GPL licensed libraries means that we would have to release the source to our game? Or just the library, if I modify it? Or not at all? I assume compiling a SWF constitutes creating a binary version, but are we technically distributing it if it's loaded from a web server? Any insights would be greatly appreciated. Henry Addendum for Free Software people: I'm not trying to circumvent the GPL here, just trying to understand the implications to my employer. Personally, I think open source is a fantastically good thing. I just need to know if I'm going to have to convince my bosses of that ;) ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Implications of using GPL'ed libraries?
Yeah for this instance (Action Script) if you extend a class in the licensed library then that extension must be available to all who ask for it. Robert Sanders wrote: GPL means you have to release source to your game. LGPL - well since it was written or C type langs. there is some (heated) debate about how to define linking in the context of dynamic languages; I've seen recently that there seems to be a creative commons license that explicitly says modification to code must be shared, code that just calls library functions doesn't. Henry Cooke wrote: Hey folks, I'm looking at using some GPL licensed code (Flade, to be specific) in a game I'm building for my employers. However, I can't find a clear answer anywhere as to what that implies for our source: does anyone know if using GPL licensed libraries means that we would have to release the source to our game? Or just the library, if I modify it? Or not at all? I assume compiling a SWF constitutes creating a binary version, but are we technically distributing it if it's loaded from a web server? Any insights would be greatly appreciated. Henry Addendum for Free Software people: I'm not trying to circumvent the GPL here, just trying to understand the implications to my employer. Personally, I think open source is a fantastically good thing. I just need to know if I'm going to have to convince my bosses of that ;) ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 269.6.2/781 - Release Date: 4/30/2007 9:14 AM ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Implications of using GPL'ed libraries?
Does it say anywhere in the GPL that requested code has to be commented and readable? :-) Anyway the link I posted earlier should apply to all languages similar to JAVA considering LGPL: http://www.gnu.org/licenses/lgpl-java.html The way I interpret it, libraries would have to be loaded as an extra SWF to be on the safe side I see it the same way. R. Mark Winterhalder wrote: On 5/2/07, Robert Brisita [EMAIL PROTECTED] wrote: If you have to go the GPL route, you can tell your employers that all the code is in the SWF anyway, making it available just takes away an extra step from the process of acquiring the code. Uhm... I really don't think that can be decompiled qualifies as making code publicly available. Local vars and comments aside, the same would be true for Java and lots of other languages. Frankly, I think there is a good possibility the author intended the lib to be used the way you want to, and just chose the GPL as a generic open source license without giving the implications any thought. A short mail should clear things up, and a positive reply could be taken as permission (the author can license his code to anybody any way s/he pleases). So just mail the author, describe what you want to do, and ask nicely if it's OK. Generally, I would like some more clarity on the LGPL in regards to SWFs. The way I interpret it, libraries would have to be loaded as an extra SWF to be on the safe side, but I can't imagine this is the intention of most of the authors. Mark ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Implications of using GPL'ed libraries?
Cool. his position is that he doesn't want to place any restrictions on the way people use his work, short of passing it off as their own Yeah, understand that. A BSD license would have been better or one of the newer CC licenses. Permission from the author rules all though, right? From my interpretation you are correct. I'm trying to do everything by the book. As we should all do when handling commercial products. R. Henry Cooke wrote: Thanks guys. I emailed the author earlier today and got a nice, positive response - you were right, Mark, his position is that he doesn't want to place any restrictions on the way people use his work, short of passing it off as their own ;) I'm just trying to be super-careful here, because there's some IP issues, and the client are a fairly large, public organisation, so I'm trying to do everything by the book. Permission from the author rules all though, right? Obviously, I'm going to make sure he gets credit and there's a clear line between our work and his etc etc... Thanks again, h. On 02/05/07, Mark Winterhalder [EMAIL PROTECTED] wrote: On 5/2/07, Robert Brisita [EMAIL PROTECTED] wrote: If you have to go the GPL route, you can tell your employers that all the code is in the SWF anyway, making it available just takes away an extra step from the process of acquiring the code. Uhm... I really don't think that can be decompiled qualifies as making code publicly available. Local vars and comments aside, the same would be true for Java and lots of other languages. Frankly, I think there is a good possibility the author intended the lib to be used the way you want to, and just chose the GPL as a generic open source license without giving the implications any thought. A short mail should clear things up, and a positive reply could be taken as permission (the author can license his code to anybody any way s/he pleases). So just mail the author, describe what you want to do, and ask nicely if it's OK. Generally, I would like some more clarity on the LGPL in regards to SWFs. The way I interpret it, libraries would have to be loaded as an extra SWF to be on the safe side, but I can't imagine this is the intention of most of the authors. Mark ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Forms between JSP and Flash
If memory serves me right try this: ? $xml = success; print xml=$xml; ? $xml is a variable that holds the data and xml will be the member of the LoadVars instance in flash when the onLoad event is triggered. Quick Example: class Test { var lv:LoadVars = new some method { ... lv.onLoad = Delegate.create(this, response); lv.load(a_php_url, lv, method); ... } response(success:Boolean) { trace(lv.xml); } } That should work. Regards, Rob. Helmut Granda wrote: Hello all, Im using to reading variables from PHP like this ? echo form=success; ? but I'm having some issues trying to read the same variables from JSP. If I access the file from within the browser I can see the variables but in flash with loadVars it shows as Undefined. Anyone knows if the information has to be treated different? TIA. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] AS2: generating new instances dynamically?
If it is a movie clip you want to instantiate then you have to use: _root.attachMovie(libraryID, instanceName, depth); The class associated with it will construct and the onLoad event will trigger if it is being listened to. Ciao, Rob. sebastian chedal wrote: Hello Flashcoders, Sorry to bother you with another simple AS2 questions, I'm making good progress but I am stumped with one simple thing. I have one class/object that I want to use to generate copies [instances] of another class. The second class is an object in the library with an ID and an assosiated *.as file [in the linkage panel]. The code is: = //PostModel.as import com.blabla.PostView; class com.blabla.PostModel { public function createPost (__id) { var newPost = new PostView (__id); } } = When I run this code, the class doesn't construct an instance... What am I missing? If I need to call the Library Identifyer instead, how would I do that? I don't want to attach the PostView to the PostModel class, I just want to create instances of them and attach them to _root [or some other MC in the timeline]. Thanks!! Seb. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] CrossDomain and Forms
Search for an example of a crossdomain.xml, which would sit on the root directory of your website. Hope this helps, Rob. Helmut Granda wrote: Is there anyway to go around the crossdomain for testing purposes besides testing locally (from flash IDE)? final files will be at Form: subdomain.zzz.com Processing form: differentsubdomain.zzz.com Testing is being done at yyy.com and of course me being at yyy.com dont have access tot xxx.com and I dont want to send files and be like, test it if it fails send it back, then 5 minutes later ask for the file again and so forth. TIA ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] CrossDomain and Forms
The crossdomain.xml has to be on the server with the data you want to access. You could also you LocalConnection to get around it. Helmut Granda wrote: but the crossdomain.xml has to be in the client's machine not on my testing server. is that correct? On 5/1/07, Robert Brisita [EMAIL PROTECTED] wrote: Search for an example of a crossdomain.xml, which would sit on the root directory of your website. Hope this helps, Rob. Helmut Granda wrote: Is there anyway to go around the crossdomain for testing purposes besides testing locally (from flash IDE)? final files will be at Form: subdomain.zzz.com Processing form: differentsubdomain.zzz.com Testing is being done at yyy.com and of course me being at yyy.com dont have access tot xxx.com and I dont want to send files and be like, test it if it fails send it back, then 5 minutes later ask for the file again and so forth. TIA ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Wave effect
This is MAC only. :) That's funny. Michael Stuhr wrote: Parvaiz Patel schrieb: Hi, Anybody knows how to create the wave effect shown in (http://www.mandchou.com/) at the bottom for dynamically loaded images. Pls let me know. Thanks regards, PP This is MAC only. micha *sorry couldn't resist. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Pile of Objects Physics
Cheers for the site: http://lab.polygonal.de/ It has some great topics. I'm sure I'll refer to this site over and over again. Ciao, Rob. Joe Cutting wrote: Tom, Robert, Thanks for this. I've seen Fisix but was put off by the rather nebulous we can negotiate licensing terms for commercial projects. Glad to hear you've used flade successfully. The version number (0.2 alpha) and lack of documentation were a concern but I'll have another look. For those interested the other avenues I found were this guy (http://lab.polygonal.de/category/physics/) who has a great engine in development for a year or so but doesn't look like he's distributing it and Erin Catto (http://www.gphysics.com/) who has a freeware engine but its in C++ and would need translating. Many thanks for all your advice Joe Just a quick note: Flade is AS2 and is no longer in development. APE is AS3 by the creator of Flade (Alex Cove). Fisix is AS3 by another group. Tom Gooding wrote: I think fisix engine is an AS3 continuation of APE. I've used the flade library (which I think in turn is the precursor of APE) for some rigid body simulations before and it's pretty good (especially if you need to support 9 version players), documentation is non existent though, you need to look at the example code to infer usage. FLADE: http://www.cove.org/flade/ Joe Cutting Computer exhibits and installations www.joecutting.com The Fishergate Centre, 4 Fishergate, York, YO10 4FB 01904 624681 As of 30th October 2006 I have a new office so please note my new address and phone number ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Clear Set Interval Q:
Don't know if this helps you but I'll mention it for the sake of knowledge. You could also use: _global.setTimeout(scope, function_str, milliseconds) Works like setInterval and it will return an ID but it will only run once then kill itself. Ciao, Rob. Danny Kodicek wrote: Is a new intervalID always one greater than the most recent intervalID? AFAIK, yes. That is, will this always work to ensure you only ever have one interval running at a time? Again, AFAIK, yes.. but at the same time it limits your to only ever have one interval, no matter where. For instance you won't be able to have 2 instances of the same class run an interval at the same time, which might not be what you're after. If you want to manage intervals better than the built in way (which is non-existant), google for setInterval manager and I'm sure something useful will turn up. Here's one I just found: http://www.ny-dev.com/forums/f184/interval-manager-552/ As a general rule, I don't use them at all, but I was just interested to find a solution that didn't involve having to keep track of all intervals in use. When working in Director, I've in the past wrapped timeout objects (the Lingo equivalent of intervals) in my own objects to improve the functionality, and that's probably what I'd do in Flash too if I were to use them. Danny ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Class for movie - best practice question
One way: In the same directory as your SWF. Have a main class with a static function that takes in a movie clip. In your FLA put code in Frame 1 like: MainClass.main(this); The this is the root movie clip. The static function main will pass it around to who ever needs it in your application. It depends how you want to handle it but this is a starting point. Hope this helps, Rob. Johan Nyberg wrote: Hi, just wanted to know if there is a best practice when creating a class for the mother movie (i.e. the flash-movie itself). Is this the way to go? var mother:MyFabFlashApp = new MyFabFlashApp(); ..or is there a better way? Seems kind of a stupid question, but I wanted to put it anyway in case I've missed something. ;-) I'veput my main code on the first frame of the _root timeline for too long, and want to move it into a class. Regards, /Johan Nyberg ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Finding the height and width of the VISIBLE area of a masked SWF
With your second explanation, the problem you are having is clearer. About a year ago, I developed an application where I had a container that loaded SWFs from other developers. I contacted all the developers with the dimensions and the FPS the SWF container is being built on and sent them an API to communicate with the container. It made my life a little easier. The problem was that some developers didn't conform to the API or read the docs, which led to last minute phone conferences to explain how to use the API, but that is besides the point. Because you have no control of those properties, I believe there isn't a viable fix other than getting the loaded SWF dimensions from the movieclip reference. From what I remember; if the SWF you are loading is built at a faster FPS than your container they will run slower and the loaded SWF may not account for that. Example; your container is 12 FPS and the loaded SWF is 24 FPS, the loaded SWF will run at 12 FPS. They might not be checking the current FPS and adjust their parameters for time based movement. The only other thing I can think of, but I haven't dealt with was changing the scale mode of the stage to showAll or exactFit. I am not sure this will help though and this will affect the container SWF as well. Let me know if you do figure this out another way, I would be interesting to know. Cheers, Rob. matt stuehler wrote: Claus, That's a great suggestion - the best answers are often the overlooked, obvious ones. But I don't think so - in the original SWFs, the masks aren't movieclips - they're just fills. So, I don't know how you'd check their width or height. The key thing about the application is that I won't know anything about the SWFs that are being loaded. My app should simply load a swf into a container movieclip, then attempt to scale it to fit the stage, and center it. Ordinarily, I can just check the container._width and container._height to accomplish this. But I've tested a few SWFs that weren't working properly, and that's when I discovered that they were using masks, which throws off the _width and _height. I can't assume that the SWFs will use a movieclip as a mask. Thanks again for your advice. Cheers, Matt On 4/18/07, Claus Wahlers [EMAIL PROTECTED] wrote: I'd like to be able to find the VISIBLE height and width of those SWFs; however _width and _height return the size of ALL the masked content. Can't you just check the width/height of the mask? Cheers, Claus. -- claus wahlers côdeazur brasil http://codeazur.com.br/ http://wahlers.com.br/claus/blog/ ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Compiler chokes when using a class method as event handler
The compiler says: **Error** Deck.as: There is no method with the name 'setDepthTo'. this.setDepthTo(DepthManager.kTop); And from your code I don't see it either: this.setDepthTo or this.filters. When you say it works do you mean it compiles ok or that onPress the card acts the way it should visually? Took a quick look at UIComponent and didn't see them there either.. I wouldn't be surprised if you traced those two calls and they would be undefined. Hope this helps, Rob. Alexander Farber wrote: Hello, I'm trying to create a v2 component representing a deck of playing cards and I have a problem, which I believe is very common, but I can't find a solution on the net yet. My code is simple and is listed completely at the bottom. And the problem is, that when I assign an event handler to each (child) card MC in my cards_array this way (is it called closure?) in the Deck.createChildren(), then it works ok: card.onPress = function() { this.setDepthTo(DepthManager.kTop); this.filters = _parent.shadow_array; } But when I try to move the code above into a separate method of the parent Deck class like this: card.onPress = raiseCard; or even: card.onPress = Delegate.create(card, raiseCard); Then the compiler will complain - even though I believe the scope (the card) is correct - and the Deck.as won't compile: **Error** Deck.as: There is no method with the name 'setDepthTo'. this.setDepthTo(DepthManager.kTop); What is the workaround here? Thank you Regards Alex class Deck extends UIComponent { static var symbolName:String = 'Deck'; static var symbolOwner:Object = Deck; var className:String = 'Deck'; private var bb_mc:MovieClip; private var cards_array:Array; var shadow_array:Array; function Deck() { } private function init():Void { super.init(); bb_mc.unloadMovie(); shadow_array = [ new DropShadowFilter(0, 90, 0x00, 0.30, 10, 10, 1, 1, false, false, false) ]; cards_array = []; } private function createChildren():Void { for (var i:Number = 0; i = 32; i++) { var card_name:String = 'card_' + (i + 1) + '_mc'; var card:MovieClip = cards_array[i] = this.createChildAtDepth(i, DepthManager.kTop); //card.onPress = raiseCard; //card.onPress = Delegate.create(card, raiseCard); card.onPress = function() { trace('CLICKED CARD: ' + _width + ' x ' + _height + ' @ ' + _x + ', ' + _y + ' ' + _rotation); this.setDepthTo(DepthManager.kTop); this.filters = _parent.shadow_array; } } size(); } function raiseCard():Void { trace('CLICKED CARD: ' + _width + ' x ' + _height + ' @ ' + _x + ', ' + _y + ' ' + _rotation); this.setDepthTo(DepthManager.kTop); // XXX PROBLEM this.filters = _parent.shadow_array; } private function size():Void { super.size(); //if (! (this.__width 0 this.__height 0) //return; for (var i:Number = 0; i = 32; i++) { var card:MovieClip = cards_array[i]; card._x = Math.floor(Math.random() * (this.__width - card._width)); card._y = Math.floor(Math.random() * (this.__height - card._height)); card._rotation = Math.floor(Math.random() * 10 - 5); } invalidate(); } private function draw():Void { super.draw(); } } ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com