Re: [Flashcoders] AS3 and duplicateMovieClip
youre absolutely right. at last you can re-parent clips :) Sascha Balkau wrote: Thanks for pointing me to the migration section! I see now theres all kinds of methods replaced by OOP structuring. And I guess that means that movieclips can be duplicated to anywhere beyond it's own container in AS3! Correct me if I'm wrong! Sascha -- Martin Wood http://relivethefuture.com/choronzon ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] FlexBuilder 2
http://www.andersblog.com/archives/2005/11/flex_friday_dem.html '...then showed off the new outline view, which will please a lot of people who've tried the Alpha and missed it' :) Ralph Caraveo wrote: Does anyone know if you can get the collapsable function window in Flex Builder 2? In Eclipse you have access to a window where you can see a birds eye view of all your class properties and functions and expand and collapse each one...but has this feature been removed from Flex Builder 2? If so, I'm gonna get mad. -- Martin Wood http://relivethefuture.com/choronzon ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] FlexBuilder 2
apparently its coming in the next build. Ralph Caraveo wrote: Does anyone know if you can get the collapsable function window in Flex Builder 2? In Eclipse you have access to a window where you can see a birds eye view of all your class properties and functions and expand and collapse each one...but has this feature been removed from Flex Builder 2? If so, I'm gonna get mad. -Ralph ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Who wants MIDI in the Flash Player?
hank williams wrote: Why bother with compression. This just creates more processor overhead. a minute of cd quality sound should be 10mbytes. This is not so bad. I dont know if flash would have any memory issues with this but I doubt it. In any case it could be chunked. But then the issues is whether it is possible to effectively sync separate tracks. Because if it is then You dont have to worry about doing one big sound file which would reduce memory needs. good point, for some mistaken reason i was thinking that you couldnt put uncompressed audio data in a swf. im getting old and my memory isnt so good these days. :) But I am really curious about this loader thing. I am not really aware of it. It sounds like a huge deal. see the link to Guy's page, also from the docs : loadBytes Method public loadBytes(bytes:ByteArray) : Void Loads from binary data stored in a ByteArray object. Parameters bytes:ByteArray — A ByteArray object. The contents of the ByteArray can be any of the file formats supported by the Loader class: SWF, GIF, JPEG, PNG. from http://livedocs.macromedia.com/labs/1/flex/langref/index.html i think its a really significant addition, lots of possibilities :) now all we need is an actionscript API for creating SWF's in the player. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Who wants MIDI in the Flash Player?
being able to read the data is cool, but just to say it one more time, being able to create audio data would be great. I do have one idea which i'll attempt if it doesnt look like we will get sound buffer access when the next player is released. As i mentioned earlier there is a Loader.loadBytes function which im hoping allows you to create and load swf's entirely in the player. So with a bit of trickery it might be possible to synthesize audio into a buffer, write it into a swf and then use the Loader.loadBytes to play it, all done in the player. I think one of the biggest challenges for this idea would be encoding the sound into the created swf, im not really up for writing an mp3 encoder in actionscript. But if there is a more simple encoding scheme that can be used then it would be one route to synthesizing and processing audio entirely in the client. Of course, it may even be possible to do something like create the audio in the swf as a streaming sound and just keep pumping bytes into the loader, but im getting way ahead of myself with that :) martin. Robert A. Colvin wrote: http://www.richapps.de/?p=23 check it out..;) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of hank williams Sent: Wednesday, December 07, 2005 8:07 AM To: Flashcoders mailing list Subject: Re: [Flashcoders] Who wants MIDI in the Flash Player? the 8.5 player already has an FFT (aka sound spectrum) function built in, but i think its buggy (this is what i have read, ive not tried it yet) Are people currently trying to do sound related stuff? Hank :) martin -- Martin Wood http://relivethefuture.com/choronzon ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] flash and ASP.NET
does it have to be asp? you can run php on IIS and php has ODBC libraries http://us2.php.net/odbc so flash -> amfphp -> ODBC bingo. :) also you can run apache on windows, you dont have to run IIS. It depends on what your constraints are i suppose. martin Serge Jespers wrote: Have a look at http://www.openamf.org Don't know if this can help you but it's also a third party remoting solution. I need to create a Flash application for a small non-profit can't afford the $999 price tag of MM's Flash Remoting gateway. Is there a third party remoting solution like AMFPHP that I could use? Essentially I need to read and write to an Access database on a Windows web host. Thanks for any suggestions and pointers to examples for this. Michael ___ 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 -- Martin Wood http://relivethefuture.com/choronzon ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Who wants MIDI in the Flash Player?
On another note I also think, particularly with the speed of 8.5, that it would be great to give us direct access to the sound buffer. I am not sure how fast 8.5 math will be but if you can do a good FFT we could be making actual synthesizers and audio processors in flash. To me that would be cool. absolutely, the 8.5 player already has an FFT (aka sound spectrum) function built in, but i think its buggy (this is what i have read, ive not tried it yet) Now, if they would add an inverse FFT as well then it would be fantastic. It would definitely take a load off the actionscript processing required if they were implemented natively. but at the very least access to the sound buffer would open up a whole new world. :) martin ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Who wants MIDI in the Flash Player?
Interesting question, although ive made use of midi everyday for, well, too long now :), im really not sure if making it part of the player as a single functional unit would be the best move. Personally i would rather see a more open, low level approach to sound in the player upon which MIDI and other implementations could be developed. Now that the player (8.5 and onwards) will have much better binary data handling, theres nothing to stop me or you from creating a MIDI file parser. Thats one side of the equation, obviously the more intricate side is audio playback. I've been moaning about the audio capabilities of the flash player for longer than i can remember, and would dearly love for it to become much more capable. The options i can think of so far are (and they arent exclusive) 1. An api for accessing midi devices on the user system, much like accessing a webcam, where you can query for which devices are present, then get a handle to a device and start manipulating it, something like: var midiDevice:MidiDevice = Audio.getMidiDevice(1); var instrument:Instrument = midiDevice.createInstrument(); instrument.setChannel(1); instrument.setProgramNumber(34); instrument.setController(23,44); instrument.noteOn(velocity); etc... 2. ACCESS TO THE SOUND BUFFER. Please. :) This would open up a lot more possibilities for audio generation, manipulation etc.. The 8.5 player already has a Loader.loadBytes feature where you can send binary data locally, i.e. you can create a jpg in the player and then load it into a movieclip without sending it to a server. This is great, but I think a similar scheme for audio would be fantastic. With a simple sound.setBuffer(binaryData) you could do a huge amount of interesting things. Sound synthesis, generation. From musical applications, to game sound effects, or just sound notifications within applications. All of this could be done with a minimal impact on filesize. No need for .wav's , mp3's etc.. Sound capture You could capture audio from mic and allow the user to edit it and process it. You could build annotation tools, voice messaging, musical applications etc.. Also if you can get a handle on the audio stream before it hits the audio device you could have live control over streamed audio, tone controls, reverb, delays, echo cancellation, noise reduction. etc.. So, personally I would rather see the components available to us as developers, upon which we can build a variety of applications. MIDI playback being just one particular application of the feature set. Also other similar systems like OSC could be used. anyway, im glad you are asking and i'll happily contribute anything to a document you will put forward requesting audio related capabilities. thanks, Martin Tyler Wright wrote: The Flash Player has evolved through the ages to provide the most needed functionality. Through each version there have always remained a few common goals. What I have found is that: Flash is small -- from the player itself to the swf file format to the assets it is optimized to load, focus has been placed on small file sizes (this of course is not as apparent in many websites that are heavy in multimedia) Flash supports standards -- the player supports many web and multimedia formats standard in the industry, such as jpg, mp3 and xml Flash is interactive -- the players greatest strength is the dynamic behavoir through ActionScript to allow user interactivity MIDI, a music standard format that most computers support today, fits all of these categories (like a glove). In fact there's an opensource project being developed to allow MIDI through Flash, though it requires an additional download and install to the user apart from the Flash Player itself (seen at osflash.org) -- Martin Wood http://relivethefuture.com/choronzon ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Targeting when using for loop
i think you might need to lose the first . my_pane.content["product_"+i]["color_"+j].loadMovie(someUrl); martin Mike Boutin wrote: I am trying to target an object inside my scrollpane. This is what im trying to achieve: my_pane.content["product_"+i].["color_"+j].loadMovie What is the correct way to target a movieclip in this way? Thanks! ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Martin Wood http://relivethefuture.com/choronzon ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] warp dynamic text in flash 8 with filters or script
maybe a good idea to say what you currently know how to do, and if you are after a specific technique or just a general guide to manipulating bitmaps. generally I think you would probably take the route of creating a bitmap from a dynamic textfield and then processing and filtering the bitmap data. Theres info in the docs here about bitmaps in flash 8 http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=1527.html http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=1942.html and a tutorial from Guy Watson here http://www.macromedia.com/devnet/flash/articles/image_api.html thanks, Martin rishi wrote: Hi I want to warp dynamic text in flash 8 with filters or script Regards Rishi -- Martin Wood http://relivethefuture.com/choronzon ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Blitting, Double-Buffering, and Other Bitmap Methodologies
There's a good series of articles on gamedev.net :) http://www.gamedev.net/reference/list.asp?categoryid=45#200 The Game Programming Genesis series. In a lot of cases the 'magical render' is performed by a render manager, the entities themselves dont do rendering, they are maintained in a list (perhaps in a World class) and the render manager just redraws whatever is on the list. Or you could set it up so the renderer orchestrates the rendering of the entities, i.e. it scans the active display list and calls draw() on an entity that survives the clipping tests. martin JesterXL wrote: ...here's where things break down for me. I'm not used to coding like this, so don't really know the best pratice ways to go about it. For example: - how do I handle depth? "last draw wins", so do I manage depth myself? - how do I handle move, and x and y change operations? They don't affect the bitmap the sprite is blitting to, but they do affect the one they are on... events the parent listens to maybe? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Xml editor
for anything thats part of a project I use Eclipse and the free version of XML Buddy http://xmlbuddy.com/ if i just need a quick edit then i use editplus (for any type of text file) http://www.editplus.com martin Patrick Matte wrote: What software do you people use for editing xml for your flash projects ? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- want to know what i think? probably not http://relivethefuture.com/choronzon ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Calc max radius of a circle
it will only affect the 'radius' measured along an axis perpendicular to the rotation axis..to calculate those values you can just take two points, one on each opposited edge of the circle, calculate where they are in 3d space then project them onto your viewing plane.. but are you also concerned about perspective? are you trying to draw a circle rotating in 3d space without going into 3d transformations? or something else? martin I am trying to calculate the max radius a circle can be and have it still fit in a bounding box. The difficult part of the question is that the circle is really a 3D object ie it can be rotate about the x or y axis. Ie imagine a plain circle drawn on the screen, now imagine your could "push" the top of it down till its was edge on, then the max radius would be half the width of the box. If pushed in on the left till it was edge on it woulde be half the height of the box. But how about all the other angles in between. So you have width/height of box, and x rotation and a y rotation, so what is the max radius.. Thanks Rob ___ 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 -- want to know what i think? probably not http://relivethefuture.com/choronzon ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] elegant country list
divide it into continents / large scale areas europe asia africa americas etc.. some kind of two stage selection? ? Toon Van de Putte wrote: Hi list, I'm building a shop site in Flash, where the user has to select their country from a list on the order form. I personally would like to avoid one big long dropdown, i hate those in HTML forms. Since it's Flash, I think I can do something much more user-friendly, these are my options so far: - a small menu where the user first selects a letter of the alphabet and then selects his/her country. - same sort of menu, but with the most likely countries at the top, in this case EU countries. Have any of you done anything like this before, and have any tips to share? thanks, ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Movie seems to unload?
not sure, case sensitivity ? work on windows, deploy to linux? Kaloudis Stathis wrote: Please guys, any ideas?? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Return a class
Will you only be creating one type of object? or multiple types? If its just one, then myFactory.getDrag() can create and return the object..but im guessing thats not the case or you wouldnt be asking :) so, you could return a string of the full class name (including its package) and assuming that any class you want to create implements the same interface so you can rely on some type information further down the line, you could try : String className = myFactory.getDrag(); IDrag drag = new _global[className](); [EMAIL PROTECTED] wrote: I have a class named Drag with a static function create. A drag is created as : Drag.create(...) Now I would like to use a Factory to return a drag, but the problem is that the Factory has to return the class Drag instead of an instance of Drag... ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] recursive function that returns an array
you dont 'delay' the return function, just consider that each invocation of the function can pass back a result to the calling function the idea is something like this (its not tested code, but hopefully will give you a starting point...) also, it assumes that each node has only one child, otherwise you would need to find multiple paths function findTransitionPath(node:XMLNode, attributeName:String):Array { if(node.childNodes.length == 1) { // check children for transition attributes in nodes var path:Array = findTransitionPath(node.childNodes[0], attributeName); } else { // no children, so sub path is empty path = []; } // check this node if(node.attributes.transition != null) { // make this node the start of the array return [node.attributes.transition].concat(path); } else { // just return the array from our children return path; } } there may be better ways to do this... :) thanks, Martin Robin Burrer wrote: Hi everybody, I try to build a recursive function that searches an xml node for a particular attribute name. Each Node of my xml document has an attribute called "transition". So basically what I want to do is pass an xml node to my function and the name of the transition and in return I want to get the path to the transition (which should be an array). ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Eclipse/FDT/Subclipse weirdness
for more information you might want to check the eclipse log file, its found at workspace/.metadata/.log that might give you more information about what is causing the problem. as has been said, theres some cleaning you can do thats a lot less drastic, first is doing an SVN clean, right click project -> team -> cleanup also you can start eclipse with -clean from the command line which may clear out some bad state that has occurred. hope that helps, martin I have all the latest versions... Here's a question - are there files that I should not put in version control? Like Eclipse's .project file and FDT's .as2_classpath? I've done it both ways and still had the same problems, so I don't think that's the solution. Just curious... Jim Kremens -- want to know what i think? probably not http://relivethefuture.com/choronzon ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Flash Remoting Question
The problem I am quite simply having is that I find flash remoting confusing. I have been working with actionscript for about 3 years now, and understand it fully. I just don't understand how to form packets and transfer them between flash and the remoting software. The only programming I have ever done is in actionscript so I really don't know any other language which I guess makes it more difficult. You dont form packets, you send objects. Thats the beauty of it, with the remoting connector installed on the server you dont have to convert data into packets, or strings or xml. its like xml-rpc without the xml. :) martin ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] New Hire Resources list. Input needed.
if they are already literate in other programming languages, this might help http://www.timotheegroleau.com/Flash/articles/scope_chain.htm particularly the section about 'this', which we all know has a great potential to cause confusion. :) its a long article, but is quite enlightening about whats going on in the VM. martin Wade Arnold wrote: I am working on a list of resources that I would like to give to people that are migrating to flash from other languages. We have just hired a couple people that are CS graduates and others that have been in the java world for the last ten years. Any feedback on what you would want your new hires to review? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Detect if swf being viewed in html page
if you are writing the url, the make sure that the html passes in a variable to the flash movie. if the variable isnt set then you know you have been accessed directly. martin On 11/14/05, Paul Steven <[EMAIL PROTECTED]> wrote: Is it possible to detect if a swf is being viewed in a html / asp page OR just a direct link? So for example I may view a file as http://www.mysite.com/test.html (which embeds test.swf) or http://www.mysite.com/test.swf I would like the swf to be able to detect if it is being viewed directly or embedded? Any help much appreciated Paul -- want to know what i think? probably not http://relivethefuture.com/choronzon ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] dispatching events from a class
that still wont work because you are dispatching the event before you bind the function as the handler. what are you trying to achieve (apart from getting the event to fire), i know this is just an example, but it seems a bit strange. anyway, you cant call init in the constructor to dispatch the event, because theres no method to handle the event. you could take out the call to init from the constructor and call it seperately, then it should work : var eventry:EventTry=new EventTry(); eventry.onEvent=function(){ trace(""onEvent fired""); } eventry.init(); martin. Javier Tello wrote: Still doesn't work. If you look at the code the class fired the event before deleting itself. Anyway I simplify it without the die() method: -- want to know what i think? probably not http://relivethefuture.com/choronzon ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: ÍøÒ×ÓÊÏä×Ô¶¯»Ø¸ ´: Re: [Flashcoders]
thats easy for you to say. [EMAIL PROTECTED] wrote: Äú·¢¸øÎÒµÄÐżþÒѾÊÕµ½¡£ ÍøÒ×163ÓÊÏä--רҵµç×ÓÓʾ֣¬2000M³¬´ó¿Õ¼ä£¬Ö§³Ö³¬´ó¸½¼þ£¬È«¹úΨһ24Сʱ¿Í»§·þÎñ¡£ »¶ÓÄúÀ´×¢²áʹÓá£ÍøÒ×126ÓÊÏ䣺http://www.126.com -- want to know what i think? probably not http://relivethefuture.com/choronzon ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders]
this is a bug in the current public build of ASDT, it doesnt handle keywords in string literals properly. Its fixed in CVS, but I dont expect you to build it :) There will be a new release *sometime soon* if you dont want to build from CVS. thanks, Martin Steve Warren wrote: Hey folks, Has anyone using Eclipse noticed this problem? I rely on my Outline view to navigate my large class files, and when I switched from using to this afternoon, it broke my Outline view. before: ref.htmlText = "Black Text Here"; after ref.htmlText = "Black Text Here"; Try using ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Remoting with AMFPHP vs. ASP
Robin Burrer wrote: Read the chapter about "Flash Remoting And ASP.net" in "Flash remoting the definitive guide". Not sure if I would buy the book just for this chapter though. you could always take advantage of the free 14 days of safari, i read this book on there. http://safari.oreilly.com martin ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Resizing Imported Images
are you waiting until the image is loaded before manipulating the movieclip? the MovieClipLoader class may be useful if you arent using it (or a suitable alternative) martin Lehr, Theodore M. wrote: I don't mind resizing the one it is loading into but I can not get it to work... I tried but it remains the size of the image... ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Resizing Imported Images
no, once its loaded in the mc is the image. you can always use another mc as a container if you require it. martin Lehr, Theodore M. wrote: Is there anyway to resize an image imported via loadMovie - not resizing the mc it is loaded into - but the image itself? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- want to know what i think? probably not http://relivethefuture.com/choronzon ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Dynamic Loading Images
ah, i think i missed your point. do what Tom said. :) Martin Wood wrote: look at MovieClip.loadMovie(); despite its name it can load images. :) martin Lehr, Theodore M. wrote: How can I dynamically load images? So when I want to have more images in the movie I just need to put them in the right folder instead of updating the movie. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Dynamic Loading Images
look at MovieClip.loadMovie(); despite its name it can load images. :) martin Lehr, Theodore M. wrote: How can I dynamically load images? So when I want to have more images in the movie I just need to put them in the right folder instead of updating the movie. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] scope in classes
my favourite topic and my favourite links : http://osflash.org/flashcoders/as2 at the bottom theres a link to this page http://www.dynamicflash.co.uk/2005/02/delegate-class-refined/ from which you can find this implementation http://dynamicflash.com/classes/Delegate.as enjoy. :) martin JesterXL wrote: You can use Proxy; ARP has one, and a few other Proxy's have been written that support this. Anyone have the links to those handy? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Flash capabilities
not 100% sure, no. i guess you mean 'real' streaming as opposed to progressive download. in that case i think you might *currently* need fcs because it relies on the rtmp protocol i really know very little about this unfortunately. sorry. martin 8ball Developer wrote: Are you 100% sure about this? Is this documented someplace? I'm trying to get them to replace Helix with FCS. On 11/2/05, Martin Wood <[EMAIL PROTECTED]> wrote: 8ball Developer wrote: 1. Can flash play audio streamed from Helix (Real Server)? flash streams mp3. thats all. (why it doesnt do ogg, i dont know.. :) Sorry. I meant to say: can a flash player, play mp3 streamed from Helix? Or does it have to come From Flash comm? no, it can come from anywhere. :) ___ 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 -- want to know what i think? probably not http://relivethefuture.com/choronzon ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Flash capabilities
8ball Developer wrote: 1. Can flash play audio streamed from Helix (Real Server)? flash streams mp3. thats all. (why it doesnt do ogg, i dont know.. :) Sorry. I meant to say: can a flash player, play mp3 streamed from Helix? Or does it have to come From Flash comm? no, it can come from anywhere. :) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Flash capabilities
8ball Developer wrote: Hi guys, I'm giving a presentation on using flash for an application in a few hours and would like to have a firm answer on the following items. 1. Can flash play audio streamed from Helix (Real Server)? flash streams mp3. thats all. (why it doesnt do ogg, i dont know.. :) 2. Can flash access a database directly? I know this is no. But I don't know what are all the work arounds. Suggestions? presently you have to use middleware, php, java etc.. or if its a standalone application then you would have to have a suitable library and driver that you could access in the host (screenweaver, swfstudio, zinc etc..) with 8.5 and some binary socket magic you could talk to a db directly. i hope thats accurate :) martin ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] can I dynamically register an MC with an AS2.0 class?
alternatively you could just have a setClip method defined in IMapHolder and implemented in the two classes. Then keep a reference to the clip as a member variable and work with that instead of subclassing movieclip. martin Liam Morley wrote: I'm working in FlashPro8. I have an empty movie clip called "mapHolder" defined on the stage. Depending on some parameters when starting my swf, i'm either going to call loadMovie("FlashMap.swf", mapHolder) or loadMovie(" imagemap.jpg", mapHolder). I have an interface called "IMapHolder", and two implementing AS2.0 classes called "SWFMapHolder" and "ImageMapHolder". Because I'm not sure what type it will be, I'd like to associate the MC and the class dynamically. Something like Object.registerClass() would be perfect, but I imagine that doesn't support AS2.0. Do I need to create two separate MCs, each with its own linked AS2.0 class? Or is it possible to dynamically register an MC with AS2.0? Thanks all. Liam ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- want to know what i think? probably not http://relivethefuture.com/choronzon ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Circle, rotation to ?
actually the solution was simpler than i first thought, if you take advantage of the fact that _rotation can go above 360 and below 0 then all you need to do is this : import mx.transitions.Tween; import mx.transitions.easing.*; function rotation(dx:Number, dy:Number):Number { return Math.atan2(dy, dx) * 180/Math.PI; } circle.onRelease = function() { var newAngle:Number = rotation(_xmouse - this._x, _ymouse-this._y); var dist:Number = Math.abs(newAngle - this._rotation); this._rotation %= 360; if(dist > 180) { if(newAngle > this._rotation) { newAngle -= 360; } else { newAngle += 360; } } new Tween(this, "_rotation", Strong.easeOut, this._rotation, newAngle, 1, true); }; // just mind the formatting. :) martin Eric E. Dolecki wrote: Hmm yes. Looks like the regular Tween stuff won't work. Looks like a rotation easing class might be in order. And it decides whether or not to rotate + or - to get to the destination. Its a bit of work to do, but it would really be worth it. The Tween class seems to only want to += until it gets to the desired rotation - which is understandable. But sometimes we need tighter control ;) e.dolecki On Nov 1, 2005, at 4:16 PM, Martin Wood wrote: well, what you need to do is work out the shortest route to the angle you want. i think it would go something like this first compute the difference in angles : angleDiff = abs(destAngle - sourceAngle) if its greater than 180 degrees, you want to go the other way. to find that, check which angle is bigger. goClockwise = sourceAngle > destAngle So, if you are at 5 degrees and you click at 355 you get : angleDiff = 355 - 5 = 350 goClockwise = false and if you are at 355 and want to go to 5 angleDiff = 5 - 355 = 350 goClockwise = true then find out how far to go : howFar = 360 - angleDiff and if you want to go anticlockwise, make it negative THEN, keep the original angle stored, run the tween from 0 -> howFar and add it to the original angle at each step. i think this means you wont be able to get the tween to change _rotation directly, but rather you'll have to get a callback or something similar to grab the current tween position. (or you could do something nifty with nested movieclips and rotate the parent without tweening first, so you can just modify the rotation of the child from the tween, but that may be more trouble than its worth..) anyway, i think that should work, im just working it out as i go along so it could fail for some cases...this may be where i was thinking about the quadrant checks, but im not sure. i'll give it a try in a while, ive got non-computer things to do now. :) thanks, Martin eric dolecki wrote: Its that last part frying me - sometimes it works as expected, other times, it decides to rotate the long way around :/ thanks all. ___ 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 -- want to know what i think? probably not http://relivethefuture.com/choronzon ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Circle, rotation to ?
well, what you need to do is work out the shortest route to the angle you want. i think it would go something like this first compute the difference in angles : angleDiff = abs(destAngle - sourceAngle) if its greater than 180 degrees, you want to go the other way. to find that, check which angle is bigger. goClockwise = sourceAngle > destAngle So, if you are at 5 degrees and you click at 355 you get : angleDiff = 355 - 5 = 350 goClockwise = false and if you are at 355 and want to go to 5 angleDiff = 5 - 355 = 350 goClockwise = true then find out how far to go : howFar = 360 - angleDiff and if you want to go anticlockwise, make it negative THEN, keep the original angle stored, run the tween from 0 -> howFar and add it to the original angle at each step. i think this means you wont be able to get the tween to change _rotation directly, but rather you'll have to get a callback or something similar to grab the current tween position. (or you could do something nifty with nested movieclips and rotate the parent without tweening first, so you can just modify the rotation of the child from the tween, but that may be more trouble than its worth..) anyway, i think that should work, im just working it out as i go along so it could fail for some cases...this may be where i was thinking about the quadrant checks, but im not sure. i'll give it a try in a while, ive got non-computer things to do now. :) thanks, Martin eric dolecki wrote: Its that last part frying me - sometimes it works as expected, other times, it decides to rotate the long way around :/ thanks all. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Circle, rotation to ?
ok, i was wrong, looks like you dont even need the quadrant checks...thats my memory for you :) i made a little movie with a circular movie clip, the reg point was in the middle, and another movieclip called pointer, which is just a line going up from the reg point, then this code did the trick circle.onRelease = function() { x = this._xmouse; y = this._ymouse; angle = Math.atan2(y,x) * (180 / Math.PI); _root.pointer._rotation = angle + 90; } thanks, i havent written code like that in a long time, its quite fun being old skool ;) Martin. Merrill, Jason wrote: Ah, rotate to the click point, right. So combine Martin's trig and my suggestion of the tween classes to move to a new rotation angle, and you should have what you need. Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Martin Wood Sent: Tuesday, November 01, 2005 3:22 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] Circle, rotation to ? but you'll need some trigonometry to work out the rotation angle from the point that is clicked. if my memory serves me, you can use Math.atan2( y, x ) to get you the angle in radians, but i think you have to do some quadrant checking to get the right answer. the quadrant check itself is easy, just check if x is left or right of the midpoint, and if y is above or below. that should get you going. martin Merrill, Jason wrote: No math required, just use the tween and transition mx classes to tween to a new rotation. Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of eric dolecki Sent: Tuesday, November 01, 2005 3:10 PM To: Flashcoders mailing list Subject: [Flashcoders] Circle, rotation to ? I have a math question. Lets say I have a circular movieclip on the stage. It has a directional marker on it so you know which direction its rotated to. click on the circle, now with easing (even just linear), rotate to the movieclip from its current rotation to the destination angle (where the movieclip was clicked on). To work in full 360 degrees. Anyone have any good suggestions on the best way to code this, or an example to boot? Thanks, e.dolecki ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- want to know what i think? probably not http://relivethefuture.com/choronzon ___ 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 -- want to know what i think? probably not http://relivethefuture.com/choronzon ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Circle, rotation to ?
but you'll need some trigonometry to work out the rotation angle from the point that is clicked. if my memory serves me, you can use Math.atan2( y, x ) to get you the angle in radians, but i think you have to do some quadrant checking to get the right answer. the quadrant check itself is easy, just check if x is left or right of the midpoint, and if y is above or below. that should get you going. martin Merrill, Jason wrote: No math required, just use the tween and transition mx classes to tween to a new rotation. Jason Merrill | E-Learning Solutions | icfconsulting.com -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of eric dolecki Sent: Tuesday, November 01, 2005 3:10 PM To: Flashcoders mailing list Subject: [Flashcoders] Circle, rotation to ? I have a math question. Lets say I have a circular movieclip on the stage. It has a directional marker on it so you know which direction its rotated to. click on the circle, now with easing (even just linear), rotate to the movieclip from its current rotation to the destination angle (where the movieclip was clicked on). To work in full 360 degrees. Anyone have any good suggestions on the best way to code this, or an example to boot? Thanks, e.dolecki ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders NOTICE: This message is for the designated recipient only and may contain privileged or confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this e-mail by you is prohibited. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- want to know what i think? probably not http://relivethefuture.com/choronzon ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Debugging wih FAMES?
very true, it also brings up the point that the development of open source tools can (to some extent) now be unified where the eclipse platform is concerned. If a developer creates a nice plugin for flash development on eclipse, a developer who is using either FB2 or a collection of open source alternatives can benefit. I agree, i think its a very good move. martin With Flex Builder 2 being built on the Eclipse platform, there is enormous scope for open source developers to contribute very low level functionality to extend and enhance the product. You really do get the best of both worlds and I, for one, applaud Macromedia for choosing it. Spike ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Debugging wih FAMES?
i'll combine my answer to jesse with a response to this as well, because they cover some of the same ground..hope you dont mind. why choose open source vs flexbuilder 2 ? because A: its open source, if it doesnt do what i want, there is always the possibility to change that B: it would most likely be free. Now, im not averse to paying for tools which i use and would consider buying FlexBuilder2 if my work required it, but its not just about me. of course, its too early to say if MM will make the command line version of the compiler available for free. If they do, then thats great, that alleviates some of the need for an open source / free version, and it would allow me to concentrate more on working with the ASDT team to make a better development environment. If their compiler is not free, then we'll see what direction the osflash community moves, if its towards an ocaml based compiler, then i'll learn ocaml, if its towards an antlr / flex / bison based approach then i'll help with that (and there has already been work on an as3 antlr grammar, so the pieces are starting to take shape) whatever happens im determined that a free compiler should be available, because it would keep the momentum around osflash going. If the only option is to buy FlexBuilder2 then I think the (OS) flash community would start to lose out on potential development talent that would be attracted. In my opinion the scope and quantity of tools that will be created to support flash development would be severely hindered by the lack of a decent free compiler. just to be clear, its not about one versus the other, its about the whole flash development ecosystem. Having commercial tools with commercial support is very important within certain sectors of industry, and similarly having free versions is important to other sectors of industry. with both we have choice, with just one, we dont. i like choice. thanks, Martin. Nick Weekes wrote: I don't understand why you would go for a (possibly) less functional tool than FlexBuilder 2 just because its open source? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Debugging wih FAMES?
JesterXL wrote: I used to use FAME because MTASC is extremely fast at compiling compared to Flash. However, MTASC is apparently not going to support AS3, thus the whole point of using FAME, for me anyway, is dead. While Flashout has some nicely formatted traces, and ASDT has some neat templates, it doesn't compare to FlexBuilder 2. So, yeah, I'd dump FAME and go to FlexBuilder 2. I wouldnt get too concerned yet. Flex 2 is still alpha, theres plenty of time for AS3 related things to happen in the open source world. I know Flex2 is all very exciting at the moment, but i'll never give up my open source. NEVER. :) martin ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] ASDT data loss?
Its a known issue, which is fixed in the CVS build. unfortunately if you point the current version at an existing directory for a new project, it decides to forcibly delete the contents. sounds like you discovered that bug. the fix has been in cvs for a while now, so its probably time we got a new release out before more situations like this happen. thanks, Martin eric dolecki wrote: Just curious if anyone else has lost data when using Eclipse with ASDT? e.dolecki ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Bizare...AS3.0 packages have methods?
i think its just a function declared with package scope. Mark Lapasa wrote: flash.util.trace() Is that a method of a package? Or a compiler directive? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Profiling the clients CPU
maybe it would be best to do the profiling using the code that is being performed, otherwise your results may be unreliable. i dont know if thats possible in your case, but you could start from the bottom and work up. run a few loops of the doSomethingEasy() and see how fast its running, if its blindingly fast assume they have a fast cpu and move up to the doSomethingHard() martin Alias wrote: Hi guys, I'm working on a project which involves reducing the amount of work done, based on the client's CPU speed. I'm wondering - does anyone have a tried & tested method of doing this? I'm thinking something along the lines of: startTime = getTimer(); //do something timeconsuming - loop 100 times, for example speed = doSomethingTimeconsuming() if (speed < 5){ doSomethingEasy(); } else{ doSomethingHard(); } What I'm wondering is the doing something timeconsuming part - I need a simple operation that will be reasonably consistent across player types - is there any operation that *hasn't* been improved or that has always been fast? The target player is FP6 (pre 6.65), so I need an operation that will be consistently slow or fast on every player since then Has anyone done this much? Thanks in advance, Alias ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- want to know what i think? probably not http://relivethefuture.com/choronzon ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Scope Issues was :Newbie AS3 question
In my opinion this problem comes up so often because of bad design in the libraries. If the libraries were written to support the observer pattern rather than all this anonymous function / function binding the world would be a better place, ok, the technique itself is useful and slightly more compact than observer, but its very confusing at first. I guess it was an inevitable side effect of the transition from AS1 to AS2 without any change in the underlying model. anyway, lets not get too excited, if someone knows of a good article that explains this clearly with good examples, please post the link and i'll make a reference to it from the flashcoders faq section on the osflash wiki. http://osflash.org/flashcoders/as2 thanks, Martin ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Flash and ASP/MSSQL
The person who gave me the brief said something along the lines of "Sure Flash can talk straight to a database! All you need to do is set the connection string or something!" I hitherto hadn't realised this was possible - I've always thought you used loadVariables to call an (in my experience) ASP or PHP page that talked to the database. Can anyone clear this one up for me please? Im pretty sure that unless someone has done some magic ive not heard of, you will need to use some kind of middle layer to talk to the database. thanks, Martin ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Re: Newbie AS3 question
ryanm wrote: The idea is to use it (this) when you have two variables with the same name, usually to distinguish between the class member and a locally declared variable. You must know that :) The compiler won't know to use "this" or not in those cases, so it is important to use it in those contexts. Actually, the compiler *does* know, it always adds "this." to references without explicitly stated scope. Which brings us full circle, all the way back to maintainability. Now, if you have a class, and all of the member functions and variables are referenceless (using "assumed" scope without the this reference), and all of a sudden, in the middle of a method, you have a this reference because of a potential scope conflict, what does a developer looking at your code 2 years after you've left the job think about it? Does he remove the single this reference, to make it more readable and consistent, thus breaking the method and blowing up the whole project, all without knowing how or why? Martin piped up with "I would refactor the method to make it more readable..." immediately, which, in this case, would've broken the method (if he removed the reference) and possibly the whole class, which is exactly how these sort of expensive, time consuming, and difficult to troubleshoot problems come up. On the other hand, if the original developer used the this reference every time, it would already be consistent, readable, and explicit about scope. The other question is, would Martin (not to pick on Martin, but he was vocal about it, so I use him as an example) take a class that stated scope explicitly and remove all the this references, possibly breaking the class in the process? It sounds like it, from his post. The question is, is that a good practice or a bad practice, and does that make him a "good" developer, or a "bad" one, given the potential for expensive and time consuming breakage caused solely by his dislike for the keyword this? Its ok, you can pick on me, i dont mind ;) I'll take each piece seperately. 1. Removing the single 'this' reference. well no, i wouldnt remove it because i know why its there. If the method was long and could / should be refactored, then that is what i would do. Of course there exists edge cases where that isnt feasible, but most programs dont implement DES algorithms (to relate this to an earlier post) and a lot of legacy code i have worked with has benefitted from being re-factored. If i see one 'this' reference among a series of unspecified local references then I would look at it carefully and think that the programmer had good cause to specify the scope in that case. One 'this' reference doesnt have much of an impact on readability but using it everywhere does, as Jesse highlighted. I would rarely advocate becoming dogmatic about any technique, *always* do this or *always* do that, because its not often an all or nothing decision. Of course, in some far off dreamland this code would also have unit tests so that if i did refactor it or unthinkingly removed the one reference to 'this' then a nice little red bar would tell me id done something bad, but again, im realistic, most code doesnt have unit tests. :) 2. Removing all references to 'this' in supplied code. It really depends on the level of maintenance im expected to undertake with the legacy code. If it was just a minor bugfix or two, or some tweak then i would be inclined to save myself the effort and just do what is required (i.e. leave the extraneous references to 'this' intact). If the code required some major work then I would remove the references to this, except where necessary. Like i stated in my first post about this subject, sometimes its necessary and i know when that is. Most of the time it isnt and personally i feel that it clutters the code. One more thing worth mentioning, and I don't say this to be rude or as a slight to anyone on this list, but the opinion that the this reference is bad and should be avoided seems to be unilaterally coming from people who learned programming in Flash, while the opinion that scope should be stated explicitly seems to be coming from people with more formal training in software development and experience in (non-Flash) real world development. Personally, I have to give more weight to the opinions of people with more formal training and more varied real-world experience, because there are some things you just can't learn in a year or two of using Flash for web development. Unless you are a mind reader or have access to information about each poster that is in this discussion then i would say that its a dangerous and false generalization. I initially learnt my programming way back in the mists of time, before flash was but a glint in some guys eye, and have had my fair share of formal training and developed in non-flash 'real world situations', but in my opinion that isnt really relev
Re: [Flashcoders] Newbie AS3 question
*snip* AS3 and Flex both hammer the point that this really has little use other than confirming for those programmers who are not familiar with ActionScript. Same goes for the Singleton.method vs. Singleton.getInstance().method argument; the latter is for those programmers who don't know ActionScript well. *snip* Maybe there's something I don't understand, or maybe you typed it wrong, but in every other OO language I've dealt with there's a significant but subtle difference between Singleton.getInstance().method() and Singleton.method() The former is calling an instance method and the latter is calling a static method. Instance methods have access to instance data that is persisted as long as the instance exists, static methods have access only to static data and that data passed in to the method call. Is this not true in ActionScript? Spike On 10/28/05, JesterXL <[EMAIL PROTECTED]> wrote: I'm the opposite end of the spectrum. This: class Box extends UIObject { function doStuff() { move(x + 10, y + 10); setSize(width + 100, height + 100); visible = !visible; } } looks more readable to me than: class Box extends UIObject { function doStuff() { this.move(this.x + 10, this.y + 10); this.setSize(this.width + 100, this.height + 100); this.visible = !this.visible; } } To each their own. I can see it justified in extending intrinsic classes, as the first parameter to setInterval, and the first parameter in Delegate. AS3 and Flex both hammer the point that this really has little use other than confirming for those programmers who are not familiar with ActionScript. Same goes for the Singleton.method vs. Singleton.getInstance().method argument; the latter is for those programmers who don't know ActionScript well. If you do it every day, there is no point. - Original Message - From: "Muzak" <[EMAIL PROTECTED]> To: "Flashcoders mailing list" Sent: Friday, October 28, 2005 5:37 PM Subject: Re: [Flashcoders] Newbie AS3 question Well, to me it's the other way around. Code that doesn't use proper references looks messy to me. Whe I'm lazy or in a hurry, I do skip them, but I usually find myself adding them afterwards anyway. So, I'm with ryanm on this one ;-) regards, Muzak - Original Message - From: "Martin Wood" <[EMAIL PROTECTED]> To: "Flashcoders mailing list" Sent: Friday, October 28, 2005 11:03 PM Subject: Re: [Flashcoders] Newbie AS3 question ryanm wrote: What I don't get is why it needs "this.addChild" instead of just addChild. I've been sick of the keyword "this" for a long time and have since avoided it in AS2. Any reason that it needs to be back in for AS3? Maybe because it's one of the most useful scope references ever invented? The fundamental concept that you seem to miss is that "addChild" is meaningless by itself, it is a method of an object (in proper OOP development), and if you just say "addChild", who is adding the child? the context is the current class. Occasionally 'this' is useful if you happen to name a method parameter or local variable the same as a member variable and need to distinguish the two. But, I dont agree that its bad form to leave it out, nor is it any more difficult to maintain. in my opinion putting 'this' in everywhere to me just makes things harder to read. thanks, Martin ___ 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 -- Stephen Milligan Do you do the Badger? http://www.yellowbadger.com Do you cfeclipse? http://www.cfeclipse.org ___ 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 -- Stephen Milligan Do you do the Badger? http://www.yellowbadger.com Do you cfeclipse? http://www.cfeclipse.org ___ 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.figl
Re: [Flashcoders] Re: Newbie AS3 question
If you come along maintain someone's code 6 months from now and you find a complex method of 200 lines of so, it's useful to have the this prefix to distinguish between variables that are local to the function and those that are available to the instance. true, but i would also immediately re-factor it into shorter, clearer methods. anyway, i think its more a matter of taste rather than good or bad programming. theres places where you need to use it, but otherwise do what you like. :) martin ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Newbie AS3 question
ryanm wrote: What I don't get is why it needs "this.addChild" instead of just addChild. I've been sick of the keyword "this" for a long time and have since avoided it in AS2. Any reason that it needs to be back in for AS3? Maybe because it's one of the most useful scope references ever invented? The fundamental concept that you seem to miss is that "addChild" is meaningless by itself, it is a method of an object (in proper OOP development), and if you just say "addChild", who is adding the child? the context is the current class. Occasionally 'this' is useful if you happen to name a method parameter or local variable the same as a member variable and need to distinguish the two. But, I dont agree that its bad form to leave it out, nor is it any more difficult to maintain. in my opinion putting 'this' in everywhere to me just makes things harder to read. thanks, Martin ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] File under BIZARRE: Keyboard Freezes Game, Wiggling Mouse Unfreezes
no problems for me, XP, IE and Firefox both FP 8. martin Buck Ruckman wrote: assist. Is this a processor thing? Is it my file? Is it the Flash player 7 in IE? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Flash vs Flex
well, if you want to have a stab at it, it would make a great addition to the current set of open source tools used for developing flash content. head over to osflash.org and get involved :) im sure theres others around who would be interested in helping develop something like this...i know i would take a keen interest. Martin Spike wrote: Like I said, If MM doesn't think this will make it into FB, I'm happy to have a stab at it. Now that I know what it actually means ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] OK to ask about X Factor Studio here?
i reckon so...im sure quite a few people use it... personally i dont, but dont let that stop you :) Miles Thompson wrote: Is it OK to ask an XPath / X Factor Studio question here? Miles Thompson ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] javascript function SetVariable doesn't work withFlash Player 8
Stan Vassilev wrote: If you run this offline, make sure this file you test is in the trusted list. You gotta go to the "advanced" flash panel hosted on macromedia.com to do this. but surely therein lies a paradox. if i want to run it offline, you must first go online? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Macromedia unveiling Flex 2andFlash9 :communication or cacophony ?
(except for the fact that they seem to be trying to kill open source remoting... damn cant they just compete on features!) Hank, i really dont think this is true. if you check the new docs you'll see that AMF is still in the new player, BUT there is a new version of AMF (AMF3) which contains improvements to the protocol. and like the old and new VM, the two AMF protocols can exist happily side by side in the the new player. thats how it seems to me anyway. thanks, martin ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] > Normalizing point
you can also combine that with some curve smoothing Once you have 3 points you can calculate the angle between the first and the third and use a tolerance (some call it the 'breaking angle') to determine if the middle point can be removed from the data set. so one idea could be to use 1 distance threshold and 1 angle threshold 0 -> DT : very small distance, just remove the intermediate points. > DT : check the change in angles of line sections and remove those that are under AT (the breaking angle). This would get rid of straight and nearly straight lines with multiple points. of course you could expand on this and make AT inversely proportionate to the distance between points, so that as the distance between points increases you break at a smaller angle. this could be done either as you store them or as a post processing step. hope that gives you some ideas. martin. Hans Wichman wrote: Hi, how about doing this while storing them? You know the last point stored, every time u get a mouse event and are ready to store the next point, u calculate the distance from the last point first, and only store the new point if the distance is bigger than a certain value. greetz Hans ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Referencing MovieClip
if the methods are in the same class, then that should work, assuming that the reference to timeline is still valid, try trace(timeline) to make sure. alternatively, you could store the movieclip references in an array and then access that later rather than getting them from their parent movieclip. martin Trevor Burton wrote: Probably a bit of newbie question but here goes: In a class method I'm creating a movieclip (this is simplified) Public function whatever(timeline) { Var mc:MovieClip; For (var j = 0; j < someVariable; j++) { Mc = timeline.createEmptyMovieClip("face" + j, j); } } then later, in another method I'm getting hold of that movieclip again and doing something with it: public function whatever_again() { var mc:MovieClip; for (var j = 0; j < someVariable; j++) { mc = timeline["face" + j]; } } but the trace gives the value of mc in the second method as 'undefined' - I can't seem to grab hold of those movieclips created in the first method. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders