[Flashcoders] AS3: custom cursor
Hi list, I posted the following question a few days ago on Flash Tiger but got no response there. Anybody here knows? I have an mc attached to the mouse as a custom cursor. Somehow I'm not able to click on buttons etc. in this setup anymore. It seems as if the display items under the cursor do not recieve moude events anymore because the custom cursor is intercepting the clicks, although I set both _customCursor.mouseEnabled and _customCursor.mouseChildren to false. When I offset the _customCursor slightly from the actual event.stageX and event.stageY position all works well. What am I missing? Here's the code: //customCursor is called in mouseUp functions of individual tools private function customCursor(event:MouseEvent):void { Mouse.hide(); for(var kwik:uint = 0 ; kwik _lengthAll ; kwik++) { if(_allToolsArray[kwik].name != event.target.name) //do nothing for the moment } else if(_allToolsArray[kwik].name == event.target.name) { _customCursor = _allToolsArray[kwik]; _customCursor.mouseEnabled = false; _customCursor.mouseChildren = false; _customCursor.backDrop.visible = false; addChild(_customCursor); stage.addEventListener(MouseEvent.MOUSE_MOVE,redrawCursor); _customCursor.visible = true; } else { trace(Clip to drag not found: + _customCursor.name); } } } //redrawCursor is called by customCursor private function redrawCursor(event:MouseEvent):void { _customCursor.x = event.stageX+0; _customCursor.y = event.stageY-0; } thanks, Willem van den Goorbergh =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= Geografiek is a Dutch, Utrecht-based map and chart design company. Willem van den Goorbergh can be contacted by telephone: (+31) 30-2719512 or cell phone: (+31)6-26372378 or by fax: (+31)302719687 snail mail: Hooghiemstraplein 89 3514 AX UTRECHT Visit our website at: http://www.geografiek.nl =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3: custom cursor
Hello Willem, I never done Custom cursors in AS3, but did you look at http://www.ultrashock.com/#/asset/37933/customcursor/ http://www.eclips3media.com/workshop/2007/12/11/custom-cursor-bug-in- actionscript3/ ? It seems offsetting x and y by 1 pixel is helpful :S HTH, Cedric Hi list, I posted the following question a few days ago on Flash Tiger but got no response there. Anybody here knows? I have an mc attached to the mouse as a custom cursor. Somehow I'm not able to click on buttons etc. in this setup anymore. It seems as if the display items under the cursor do not recieve moude events anymore because the custom cursor is intercepting the clicks, although I set both _customCursor.mouseEnabled and _customCursor.mouseChildren to false. When I offset the _customCursor slightly from the actual event.stageX and event.stageY position all works well. What am I missing? Here's the code: //customCursor is called in mouseUp functions of individual tools private function customCursor(event:MouseEvent):void { Mouse.hide(); for(var kwik:uint = 0 ; kwik _lengthAll ; kwik++) { if(_allToolsArray[kwik].name != event.target.name) //do nothing for the moment } else if(_allToolsArray[kwik].name == event.target.name) { _customCursor = _allToolsArray[kwik]; _customCursor.mouseEnabled = false; _customCursor.mouseChildren = false; _customCursor.backDrop.visible = false; addChild(_customCursor); stage.addEventListener(MouseEvent.MOUSE_MOVE,redrawCursor); _customCursor.visible = true; } else { trace(Clip to drag not found: + _customCursor.name); } } } //redrawCursor is called by customCursor private function redrawCursor(event:MouseEvent):void { _customCursor.x = event.stageX+0; _customCursor.y = event.stageY-0; } thanks, Willem van den Goorbergh =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= Geografiek is a Dutch, Utrecht-based map and chart design company. Willem van den Goorbergh can be contacted by telephone: (+31) 30-2719512 or cell phone: (+31)6-26372378 or by fax: (+31)302719687 snail mail: Hooghiemstraplein 89 3514 AX UTRECHT Visit our website at: http://www.geografiek.nl =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Control speed by how fast mouse moving
Hiya, how about logging the _root._xmouse properties (AS2) or log the localX/ stageX properties of the MouseEvent class in AS3. The timer can be triggered by moving over a movieclip or by whatever then set the parameters of where your 'moving area' is to be on the stage or let the user use the whole stage once the timer starts, using this method you can log their movements outside of the box! Hope this helps, Ali On 13 Feb 2008, at 07:04, Paul Steven wrote: Thanks Cory Good point about the setInterval introducing redundant processing.Problem with placing an invisible movie clip is, the users mouse may not pass over this movie clip. For example, the movie is 600 pixels wide and 400 pixels high. If I place a 400 high and say 10 pixels wide movie clip in the center of the movie, it is still possible for the player to move their mouse left and right in the area to the left or the area to the right of the hidden movie clip - hence no speed would be detected. I am therefore not sure how to overcome this apart from insisting they move the mouse in a specified area. Any ideas anyone? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Cory Petosky Sent: 12 February 2008 21:52 To: Flash Coders List Cc: [EMAIL PROTECTED] Subject: Re: [Flashcoders] Control speed by how fast mouse moving You'd be better off doing it in an onEnterFrame or a onMouseMove than in a setInterval call -- code is only executed between frames anyway, so your way just adds extra processing burden. Since all these events are only working once per frame, just comparing x's isn't likely to give you meaningful data -- if a player moves his mouse rapidly left to right at a rate that's some factor of your framerate, you could easily get the same (or similar) x value at every read. Increasing the framerate could help this, but brings other problems. Consider placing a small, invisible movieclip on the path you intend the user to move his mouse, and listen for onRollOver. You can use the number of RollOver events per second to adjust speed. Just keep in mind that you won't get any more events than your framerate. Finally, instead of adjusting speed directly, adjust max speed and provide a constant acceleration toward the current max speed. For example, if the user starts out at a rate that correlates to 50 mph, his current speed should slowly increase at a constant rate over many seconds until it reaches 50. Similarly, once the user begins to slow down, the speed should decrease linearly to the maximum speed allowed by the mouse move rate. This provides a slow acceleration at the beginning -- which is probably what you want if you're emulating the old button mashers -- and provides smooth speed changes as the game progresses, which is definitely good. On 2/12/08, Paul Steven [EMAIL PROTECTED] wrote: I am trying to program a game where a character moves faster, the faster the player moved the mouse left and right. A bit like the old Dailey Decathlon Game where you had to hit 2 keys on the keyboard on after the other as fast as you can to control the speed of say a character running. I could do with some advice on how to achieve this. I have a frame rate of 31 FPS, with a movie width of 600 pixels. Currently I am calling a function every 10ms to calculate the speed objShowerGame.updateSpeedInterval = setInterval(updateSpeed, 10); I compare the previous mouse X position with the current one and use this difference as the speed. This isn't really working so I could do with some suggestions. Thanks Paul ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Cory Petosky : Lead Developer : PUNY 1618 Central Ave NE Suite 130 Minneapolis, MN 55413 Office: 612.216.3924 Mobile: 240.422.9652 Fax: 612.605.9216 http://www.punyentertainment.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Anyone know of music sequencer source code?
Hiya, I'm looking into working on a project where a simple music sequencer is created. Does anyone know of any pre-existing classes or FLAs that do this, I have come across popforge, are there any others? Thanks Ali ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Multiple moviecliploaders
Never said I would ask users to change anything, just said that *I* have changed it, cos 2 simultaneous up/downloads doesn't cut it for me. However, it's something to be aware of when loading multiple external assets into a Flash application, they'll be queued. - Original Message - From: Martin Klasson [EMAIL PROTECTED] To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Wednesday, February 13, 2008 8:16 AM Subject: Re: [Flashcoders] Multiple moviecliploaders changing it on its own computer would not be of my taste, since I am developing for users that has windows installed at its default settings. / m 2008/2/13, Muzak [EMAIL PROTECTED]: It's a Windows restriction, which can be manually changed in the registry (or with some 3rd party tools). Mine is set to 20 or something ;-) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Anyone know of music sequencer source code?
Look at Flash Coders Brighton's synth project http://www.flashbrighton.org/wordpress/?p=9 And Andre-Michelle's work too: http://blog.andre-michelle.com/2006/how-cool-is-audioprogramming/ These guys have done lots of audio programming for Flash, so read around those articles. Alex Issac wrote a MIDI plugin for Flash that you can install as an optional extra, think there are some sequencing classes in here. http://www.alexisisaac.net/products/flashMidi/ HTH Glen Alistair Colling wrote: Hiya, I'm looking into working on a project where a simple music sequencer is created. Does anyone know of any pre-existing classes or FLAs that do this, I have come across popforge, are there any others? Thanks Ali ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Glen Pike 01736 759321 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Multiple moviecliploaders
I've written a simple class that loads multiple objects and triggers a function when all have downloaded. If you needed to trigger multiple sets of objects loading you could just create a new instance of the class. You need the loadObj class also. Hope this help Ali // // LoadChecker // this class is passed am array and calls a function when all of the objects in the array are loaded // // Created by Alistair Colling on 2008-01-30. // // pass mcs to load and start loading // FLA CODE // import mc.LoadObj // // import mc.LoadChecker // function completed(){ } // function percentLoad(pc:Number){}; // this.createEmptyMovieClip(loader, 1); // var ob1:LoadObj = new LoadObj(Content/roseAnim.swf, loader); // var load_ar:Array = [ob1] // var myLoader:LoadChecker = new LoadChecker(load_ar, completed, percentLoad); // // // import mc.*; import mx.utils.Delegate; // class mc.LoadChecker { private var allLoadedFn:Function; private var progFn:Function; public var itemsToLoad_ar:Array; private var itemsLoaded:Array; //total Bytes to load of all objects passed private var totalBytes:Number; private var totalLoaded:Number; public function LoadChecker(a:Array, f:Function, pF:Function) { trace(loadchecker! created:+a.toString()); totalBytes = 0; totalLoaded = 0; allLoadedFn = f; progFn = pF; itemsLoaded = new Array(); itemsToLoad_ar = a; for (var i = 0; iitemsToLoad_ar.length; i++) { var arRef:Number = i; var tempLoad:LoadObj = itemsToLoad_ar[arRef]; //array contains custom objects taht contain url and mc vars myLoader(tempLoad.targURL,tempLoad.targMC); } } private function myLoader(str:String, mc:MovieClip) { // trace(MY LOADER loading file:+str+ mc:+mc); var loadListener = new Object(); loadListener.onLoadInit = Delegate.create(this, mcLoaded); loadListener.onLoadProgress = Delegate.create(this, loadProgress); var mcLoader = new MovieClipLoader(); mcLoader.addListener(loadListener); //create holder inside of movie clip--remove this when finished lenor!! //var holder:MovieClip = mc.createEmptyMovieClip(holder, mc.getNextHighestDepth()); mcLoader.loadClip(str, mc); } //returns pos of mc in array private function mcInAr(mc:MovieClip, ar:Array):Number{ var retNum:Number = undefined; for (var i=0; iar.length; i++){ //trace(--CHECKING MC:+mc+ arrray MC:+ar[i].targMC); if (mc == ar[i].targMC){ retNum = i; } } return retNum; } private function loadProgress(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void { var posInAr:Number = mcInAr(target, itemsToLoad_ar); //add totalBytes up when first progress comes thru for each object //trace(load progress mc+target+ total bytes:+bytesTotal+ so far+bytesLoaded); if (itemsToLoad_ar[posInAr].totalBytes==undefined){ itemsToLoad_ar[posInAr].totalBytes = bytesTotal; totalBytes += bytesTotal; // trace(TOTAL BYTES UPDATED TO:+totalBytes); } itemsToLoad_ar[posInAr].bytesLoaded = bytesLoaded; ///update total bytes loaded-- could think of a better way to code this so it doesnt reset to 0 totalLoaded = 0; for ( var i=0; iitemsToLoad_ar.length; i++ ) { totalLoaded+= itemsToLoad_ar[i].bytesLoaded; }; // trace(total bytes loaded now:+totalLoaded); calcPercent() //calculate total % bytes loaded } //triggers function that shows total percentage loaded-- could be extended to return an array of values to show individual fiels loading status private function calcPercent() { var pcLoaded:Number = Math.round((totalLoaded/totalBytes)*100); // trace(--- Total PERCENT NOW LOADED:+pcLoaded); progFn(pcLoaded); } private function mcLoaded(mcl:MovieClip) {
Re: [Flashcoders] Multiple moviecliploaders
Look at QLOD Loader class - I think this lets you queue a load of clips. http://www.helpqlodhelp.com/blog/index.html http://www.helpqlodhelp.com/stuff/loaderclass/LoaderClass.doc.html Allandt Bik-Elliott (Receptacle) wrote: is there a good way of queueing the loading in flash? my first guess would be to run some kind of while/for loop using movieClipLoader.onLoadInit to recursively call the function to load the next clip from an array but i don't know if that's a hack On 13 Feb 2008, at 11:28, Muzak wrote: Never said I would ask users to change anything, just said that *I* have changed it, cos 2 simultaneous up/downloads doesn't cut it for me. However, it's something to be aware of when loading multiple external assets into a Flash application, they'll be queued. - Original Message - From: Martin Klasson [EMAIL PROTECTED] To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Wednesday, February 13, 2008 8:16 AM Subject: Re: [Flashcoders] Multiple moviecliploaders changing it on its own computer would not be of my taste, since I am developing for users that has windows installed at its default settings. / m 2008/2/13, Muzak [EMAIL PROTECTED]: It's a Windows restriction, which can be manually changed in the registry (or with some 3rd party tools). Mine is set to 20 or something ;-) ___ 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 -- Glen Pike 01736 759321 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Multiple moviecliploaders
is there a good way of queueing the loading in flash? my first guess would be to run some kind of while/for loop using movieClipLoader.onLoadInit to recursively call the function to load the next clip from an array but i don't know if that's a hack On 13 Feb 2008, at 11:28, Muzak wrote: Never said I would ask users to change anything, just said that *I* have changed it, cos 2 simultaneous up/downloads doesn't cut it for me. However, it's something to be aware of when loading multiple external assets into a Flash application, they'll be queued. - Original Message - From: Martin Klasson [EMAIL PROTECTED] To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Wednesday, February 13, 2008 8:16 AM Subject: Re: [Flashcoders] Multiple moviecliploaders changing it on its own computer would not be of my taste, since I am developing for users that has windows installed at its default settings. / m 2008/2/13, Muzak [EMAIL PROTECTED]: It's a Windows restriction, which can be manually changed in the registry (or with some 3rd party tools). Mine is set to 20 or something ;-) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Anyone know of music sequencer source code?
Thanks for the links Glen, these all seem to be for synthesizers and I can't seem to find the source code for the sequencers that trigger them to play, a simple music sequencer shouldn't be so hard to write, I'm just guessing that there's audio syncing issues I'll probably run into that have already been solved. Cheers Ali On 13 Feb 2008, at 11:37, Glen Pike wrote: Look at Flash Coders Brighton's synth project http://www.flashbrighton.org/wordpress/?p=9 And Andre-Michelle's work too: http://blog.andre-michelle.com/2006/how-cool-is-audioprogramming/ These guys have done lots of audio programming for Flash, so read around those articles. Alex Issac wrote a MIDI plugin for Flash that you can install as an optional extra, think there are some sequencing classes in here. http://www.alexisisaac.net/products/flashMidi/ HTH Glen Alistair Colling wrote: Hiya, I'm looking into working on a project where a simple music sequencer is created. Does anyone know of any pre-existing classes or FLAs that do this, I have come across popforge, are there any others? Thanks Ali ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Glen Pike 01736 759321 www.glenpike.co.uk http://www.glenpike.co.uk ___ 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] pure AS3 app to use mx.* stuff
Hi all, As far as I know, so called pure AS3 project typically uses flash classes, intristics and others that come along with Flash IDE. From the other side, Flex2 project can be built with Flex2 SDK , but *based on .mxml file*. Frankly, I'd prefer to use flash-like class structure, instead of mixed mxml-and-as code. After googling for an hour or so, the best workaround I've found is: http://www.actionscript.org/forums/archive/index.php3/t-146833.html I guess I'm not the only one who faced this issue. Can you please share you finding and/or thoughts? PS: currently I'm working in Flex2 SDK (via FlashDevelop), but without Flash IDE. -- -- Best regards, GregoryN http://GOusable.com Flash components development. Usability services. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] pure AS3 app to use mx.* stuff
Hi, I had similar problems - I have been developing with FD3 (nice) to write AS3 code and using Embed to add graphics / sounds at compile time. Graphics were created as MovieClips in Flash 8 - I have one file and set Linkages. Previously with AS2, I have used the Linkage / AS2 class file method, so this is a similar thing. Look at Keith Peter's post here for some direction: http://www.bit-101.com/blog/?p=853 I ran into some problems with this though - it looks like FD3 only has autocompletion for the core AS3 and the Flex side of things. I wanted to use the mx.* tween classes, but could not get these into my project as I don't have CS3... I asked about this on the FD Forums - search for author glenpike - and got the reply that I should install CS3 to compile against the classes, so I guess there is no stub code like FD coders have provided / integrated for Flex code autocompletion... There will probably be an issue with CS3 components too - have not tried this yet. FD3 allows you to create Flex / Flash projects so I guess the Flex one includes the framework if you use it (sorry, a few weeks since I did the Hello World stuff and have forgotten the exact bits). Also, if you use FD3, get the shell script for the Flex compiler - it improves compilation speed greatly - http://labs.adobe.com/wiki/index.php/Flex_Compiler_Shell Glen Gregory N wrote: Hi all, As far as I know, so called pure AS3 project typically uses flash classes, intristics and others that come along with Flash IDE. From the other side, Flex2 project can be built with Flex2 SDK , but *based on .mxml file*. Frankly, I'd prefer to use flash-like class structure, instead of mixed mxml-and-as code. After googling for an hour or so, the best workaround I've found is: http://www.actionscript.org/forums/archive/index.php3/t-146833.html I guess I'm not the only one who faced this issue. Can you please share you finding and/or thoughts? PS: currently I'm working in Flex2 SDK (via FlashDevelop), but without Flash IDE. -- Glen Pike 01736 759321 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Multiple moviecliploaders
Thanks for all the replies, and yes ... 2 is the hardcoded limit in simultaneous http streams unless you change it you better have this in mind, and it's because of it that I need to have a loding graph inside my mc ... The main.hideMc(target._parent.loading_mc) did the trick for me Thanks again Marcelo Wolfgang ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3: custom cursor
Thanks Cedric but that doesn't help. Only if I get the custom cursor really out of the way (say 15 px or so) the underlying button receives the event. _customCursor.mouseEnabled and customCursor.mouseChildren both trace 'false'. Shouldn't this this prevent the custom cursor from intercepting the event? Pulling my hair, Willem Op 13-feb-2008, om 11:54 heeft Cedric Muller het volgende geschreven: Hello Willem, I never done Custom cursors in AS3, but did you look at http://www.ultrashock.com/#/asset/37933/customcursor/ http://www.eclips3media.com/workshop/2007/12/11/custom-cursor-bug- in-actionscript3/ ? It seems offsetting x and y by 1 pixel is helpful :S HTH, Cedric Hi list, I posted the following question a few days ago on Flash Tiger but got no response there. Anybody here knows? I have an mc attached to the mouse as a custom cursor. Somehow I'm not able to click on buttons etc. in this setup anymore. It seems as if the display items under the cursor do not recieve moude events anymore because the custom cursor is intercepting the clicks, although I set both _customCursor.mouseEnabled and _customCursor.mouseChildren to false. When I offset the _customCursor slightly from the actual event.stageX and event.stageY position all works well. What am I missing? Here's the code: //customCursor is called in mouseUp functions of individual tools private function customCursor(event:MouseEvent):void { Mouse.hide(); for(var kwik:uint = 0 ; kwik _lengthAll ; kwik++) { if(_allToolsArray[kwik].name != event.target.name) //do nothing for the moment } else if(_allToolsArray[kwik].name == event.target.name) { _customCursor = _allToolsArray[kwik]; _customCursor.mouseEnabled = false; _customCursor.mouseChildren = false; _customCursor.backDrop.visible = false; addChild(_customCursor); stage.addEventListener(MouseEvent.MOUSE_MOVE,redrawCursor); _customCursor.visible = true; } else { trace(Clip to drag not found: + _customCursor.name); } } } //redrawCursor is called by customCursor private function redrawCursor(event:MouseEvent):void { _customCursor.x = event.stageX+0; _customCursor.y = event.stageY-0; } thanks, Willem van den Goorbergh =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= Geografiek is a Dutch, Utrecht-based map and chart design company. Willem van den Goorbergh can be contacted by telephone: (+31) 30-2719512 or cell phone: (+31)6-26372378 or by fax: (+31)302719687 snail mail: Hooghiemstraplein 89 3514 AX UTRECHT Visit our website at: http://www.geografiek.nl =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] AS3 Api writing
Hi List, Are there people who write their own AS3 apis for web services? for instance twitter, the nabaztag rabbit, amazon? Do you have any good documentation on how and where to start? Special steps to take concerning events, things to keep in the back of your mind when coding. Or is there a Hitchhikers guide to writing flash api's? Any help would be highly appreciated1 Sid ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 Api writing
Hi, Have not written anything myself, but have played with quite a few AS2 ones. The SWXFormat project has quite a few API's for some of the services you mentioned, but they are still working on porting SWX to AS3. I guess one thing to suggest would be to get involved with the project and help them write the API's for these things. Yahoo is pretty up on Flash and has just released a few useful things. http://developer.yahoo.com/flash/ The Adobe labs site has some examples links here: http://labs.adobe.com/wiki/index.php/ActionScript_3:resources:apis:libraries Hope this helps. Glen Sidney de Koning wrote: Hi List, Are there people who write their own AS3 apis for web services? for instance twitter, the nabaztag rabbit, amazon? Do you have any good documentation on how and where to start? Special steps to take concerning events, things to keep in the back of your mind when coding. Or is there a Hitchhikers guide to writing flash api's? Any help would be highly appreciated1 Sid ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Glen Pike 01736 759321 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3: custom cursor
I would say 'yes'. What type of graphic is your custom cursor symbol (Does it have some transparent background ?) Out of curiosity and frivolity, did you try to set your listener only during the target and bubbling phases (instead of capture) ? stage.addEventListener(MouseEvent.MOUSE_MOVE, redrawCursor, false); ? Cedric Thanks Cedric but that doesn't help. Only if I get the custom cursor really out of the way (say 15 px or so) the underlying button receives the event. _customCursor.mouseEnabled and customCursor.mouseChildren both trace 'false'. Shouldn't this this prevent the custom cursor from intercepting the event? Pulling my hair, Willem Op 13-feb-2008, om 11:54 heeft Cedric Muller het volgende geschreven: Hello Willem, I never done Custom cursors in AS3, but did you look at http://www.ultrashock.com/#/asset/37933/customcursor/ http://www.eclips3media.com/workshop/2007/12/11/custom-cursor-bug- in-actionscript3/ ? It seems offsetting x and y by 1 pixel is helpful :S HTH, Cedric Hi list, I posted the following question a few days ago on Flash Tiger but got no response there. Anybody here knows? I have an mc attached to the mouse as a custom cursor. Somehow I'm not able to click on buttons etc. in this setup anymore. It seems as if the display items under the cursor do not recieve moude events anymore because the custom cursor is intercepting the clicks, although I set both _customCursor.mouseEnabled and _customCursor.mouseChildren to false. When I offset the _customCursor slightly from the actual event.stageX and event.stageY position all works well. What am I missing? Here's the code: //customCursor is called in mouseUp functions of individual tools private function customCursor(event:MouseEvent):void { Mouse.hide(); for(var kwik:uint = 0 ; kwik _lengthAll ; kwik++) { if(_allToolsArray[kwik].name != event.target.name) //do nothing for the moment } else if(_allToolsArray[kwik].name == event.target.name) { _customCursor = _allToolsArray[kwik]; _customCursor.mouseEnabled = false; _customCursor.mouseChildren = false; _customCursor.backDrop.visible = false; addChild(_customCursor); stage.addEventListener (MouseEvent.MOUSE_MOVE,redrawCursor); _customCursor.visible = true; } else { trace(Clip to drag not found: + _customCursor.name); } } } //redrawCursor is called by customCursor private function redrawCursor(event:MouseEvent):void { _customCursor.x = event.stageX+0; _customCursor.y = event.stageY-0; } thanks, Willem van den Goorbergh =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= Geografiek is a Dutch, Utrecht-based map and chart design company. Willem van den Goorbergh can be contacted by telephone: (+31) 30-2719512 or cell phone: (+31)6-26372378 or by fax: (+31)302719687 snail mail: Hooghiemstraplein 89 3514 AX UTRECHT Visit our website at: http://www.geografiek.nl =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 Api writing
Hi, Do you mean you want to write Web Services or the AS3 code to use these? For the former, you would probably want to look on other lists as this will be server side code - for PHP, the only thing I can recommend is to look at Pear's libraries for common web services and see if you can extend the base classes to roll your own. There are also lots of other libraries out there - CakePHP had some if I remember rightly. Programmable Web http://www.programmableweb.com/ has a good list of API's available and may also mention some stuff that has been done in Flash already. For AS3, I would look at the documentation provided by the web-service providers and think about duplicating these functions on the client side... Have a look at the structure of some of the things I have mentioned - take them apart. You will probably see common functionality: A set of functions duplicating the server side functions you can call, some error handling and some response handling. If you are making a solid class, you will probably have to deal with asynchronicity - you can't block your client code waiting for something to happen on the server side as this is unreliable, instead, you will need to think about the EventListener model, etc. I remembered a good tutorial on the Devnet site which is really useful for thinking about any application that talks to servers somewhere: http://www.adobe.com/devnet/flex/articles/blueprint.html The article provides source code to download, but the main point is that it separates the services from the rest of the application really nicely - what you want to do. Have a look at Flashr too - this was a nice example of something that provided a really nice interface to the Flickr web service. Glen Sidney de Koning wrote: Sounds like a very good tip :) The thing is i want to start writing my own api's. But i have no idea where to begin, what is a good starting point for me? Cheers, Sid Mark Lapasa wrote: (If you already know about this, my apologies in advance) A useful API is a well documented one. If you haven't already looked into it, ASDoc is a code documentation tool that will generate your documentation based on how you apply the ASDoc syntax in your code. Glen Pike wrote: Hi, Have not written anything myself, but have played with quite a few AS2 ones. The SWXFormat project has quite a few API's for some of the services you mentioned, but they are still working on porting SWX to AS3. I guess one thing to suggest would be to get involved with the project and help them write the API's for these things. Yahoo is pretty up on Flash and has just released a few useful things. http://developer.yahoo.com/flash/ The Adobe labs site has some examples links here: http://labs.adobe.com/wiki/index.php/ActionScript_3:resources:apis:libraries Hope this helps. Glen Sidney de Koning wrote: Hi List, Are there people who write their own AS3 apis for web services? for instance twitter, the nabaztag rabbit, amazon? Do you have any good documentation on how and where to start? Special steps to take concerning events, things to keep in the back of your mind when coding. Or is there a Hitchhikers guide to writing flash api's? Any help would be highly appreciated1 Sid ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Notice of confidentiality: The information contained in this e-mail is intended only for the use of the individual or entity named above and may be confidential. Should the reader of this message not be the intended recipient, you are hereby notified that any unauthorized dissemination, distribution or reproduction of this message is strictly prohibited. If you have received this message in error, please advise the sender immediately and destroy the e-mail. ___ 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 -- Glen Pike 01736 759321 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 Api writing
Hi Sidney, What's the goal of your API ? It is only for your private use or you plan to make it OpenSource ? You may have different constraints that comes depending on that (I mean). I'd say, a good API is a useful API (and also well documented) :) Regards, Cedric On Feb 13, 2008 5:52 PM, Sidney de Koning [EMAIL PROTECTED] wrote: Sounds like a very good tip :) The thing is i want to start writing my own api's. But i have no idea where to begin, what is a good starting point for me? Cheers, Sid Mark Lapasa wrote: (If you already know about this, my apologies in advance) A useful API is a well documented one. If you haven't already looked into it, ASDoc is a code documentation tool that will generate your documentation based on how you apply the ASDoc syntax in your code. Glen Pike wrote: Hi, Have not written anything myself, but have played with quite a few AS2 ones. The SWXFormat project has quite a few API's for some of the services you mentioned, but they are still working on porting SWX to AS3. I guess one thing to suggest would be to get involved with the project and help them write the API's for these things. Yahoo is pretty up on Flash and has just released a few useful things. http://developer.yahoo.com/flash/ The Adobe labs site has some examples links here: http://labs.adobe.com/wiki/index.php/ActionScript_3:resources:apis:libraries Hope this helps. Glen Sidney de Koning wrote: Hi List, Are there people who write their own AS3 apis for web services? for instance twitter, the nabaztag rabbit, amazon? Do you have any good documentation on how and where to start? Special steps to take concerning events, things to keep in the back of your mind when coding. Or is there a Hitchhikers guide to writing flash api's? Any help would be highly appreciated1 Sid ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Notice of confidentiality: The information contained in this e-mail is intended only for the use of the individual or entity named above and may be confidential. Should the reader of this message not be the intended recipient, you are hereby notified that any unauthorized dissemination, distribution or reproduction of this message is strictly prohibited. If you have received this message in error, please advise the sender immediately and destroy the e-mail. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3: custom cursor
Thanks again Cedric, stage.addEventListener(MouseEvent.MOUSE_MOVE, redrawCursor, false); didn't make any difference. The custom cursor is an mc made up of shapes plus 1 child mc, called 'backDrop'. backDrop in turn contains a child called 'backDropVis' + a transparent shape to define the outer boundaries of the custom cursor. But then again: _customCursor.mouseEnabled and customCursor.mouseChildren both trace 'false'. backDrop.visible = false and shapes don't intercept events, do they? I did a test with a custom cursor that contained nothing but a shape - same result. I have no clue what's causing this. Willem Op 13-feb-2008, om 16:42 heeft Cedric Muller het volgende geschreven: I would say 'yes'. What type of graphic is your custom cursor symbol (Does it have some transparent background ?) Out of curiosity and frivolity, did you try to set your listener only during the target and bubbling phases (instead of capture) ? stage.addEventListener(MouseEvent.MOUSE_MOVE, redrawCursor, false); ? Cedric Thanks Cedric but that doesn't help. Only if I get the custom cursor really out of the way (say 15 px or so) the underlying button receives the event. _customCursor.mouseEnabled and customCursor.mouseChildren both trace 'false'. Shouldn't this this prevent the custom cursor from intercepting the event? Pulling my hair, Willem Op 13-feb-2008, om 11:54 heeft Cedric Muller het volgende geschreven: Hello Willem, I never done Custom cursors in AS3, but did you look at http://www.ultrashock.com/#/asset/37933/customcursor/ http://www.eclips3media.com/workshop/2007/12/11/custom-cursor- bug-in-actionscript3/ ? It seems offsetting x and y by 1 pixel is helpful :S HTH, Cedric Hi list, I posted the following question a few days ago on Flash Tiger but got no response there. Anybody here knows? I have an mc attached to the mouse as a custom cursor. Somehow I'm not able to click on buttons etc. in this setup anymore. It seems as if the display items under the cursor do not recieve moude events anymore because the custom cursor is intercepting the clicks, although I set both _customCursor.mouseEnabled and _customCursor.mouseChildren to false. When I offset the _customCursor slightly from the actual event.stageX and event.stageY position all works well. What am I missing? Here's the code: //customCursor is called in mouseUp functions of individual tools private function customCursor(event:MouseEvent):void { Mouse.hide(); for(var kwik:uint = 0 ; kwik _lengthAll ; kwik++) { if(_allToolsArray[kwik].name != event.target.name) //do nothing for the moment } else if(_allToolsArray[kwik].name == event.target.name) { _customCursor = _allToolsArray[kwik]; _customCursor.mouseEnabled = false; _customCursor.mouseChildren = false; _customCursor.backDrop.visible = false; addChild(_customCursor); stage.addEventListener (MouseEvent.MOUSE_MOVE,redrawCursor); _customCursor.visible = true; } else { trace(Clip to drag not found: + _customCursor.name); } } } //redrawCursor is called by customCursor private function redrawCursor(event:MouseEvent):void { _customCursor.x = event.stageX+0; _customCursor.y = event.stageY-0; } thanks, Willem van den Goorbergh =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= Geografiek is a Dutch, Utrecht-based map and chart design company. Willem van den Goorbergh can be contacted by telephone: (+31) 30-2719512 or cell phone: (+31)6-26372378 or by fax: (+31)302719687 snail mail: Hooghiemstraplein 89 3514 AX UTRECHT Visit our website at: http://www.geografiek.nl =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 Api writing
(If you already know about this, my apologies in advance) A useful API is a well documented one. If you haven't already looked into it, ASDoc is a code documentation tool that will generate your documentation based on how you apply the ASDoc syntax in your code. Glen Pike wrote: Hi, Have not written anything myself, but have played with quite a few AS2 ones. The SWXFormat project has quite a few API's for some of the services you mentioned, but they are still working on porting SWX to AS3. I guess one thing to suggest would be to get involved with the project and help them write the API's for these things. Yahoo is pretty up on Flash and has just released a few useful things. http://developer.yahoo.com/flash/ The Adobe labs site has some examples links here: http://labs.adobe.com/wiki/index.php/ActionScript_3:resources:apis:libraries Hope this helps. Glen Sidney de Koning wrote: Hi List, Are there people who write their own AS3 apis for web services? for instance twitter, the nabaztag rabbit, amazon? Do you have any good documentation on how and where to start? Special steps to take concerning events, things to keep in the back of your mind when coding. Or is there a Hitchhikers guide to writing flash api's? Any help would be highly appreciated1 Sid ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Notice of confidentiality: The information contained in this e-mail is intended only for the use of the individual or entity named above and may be confidential. Should the reader of this message not be the intended recipient, you are hereby notified that any unauthorized dissemination, distribution or reproduction of this message is strictly prohibited. If you have received this message in error, please advise the sender immediately and destroy the e-mail. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 Api writing
Sounds like a very good tip :) The thing is i want to start writing my own api's. But i have no idea where to begin, what is a good starting point for me? Cheers, Sid Mark Lapasa wrote: (If you already know about this, my apologies in advance) A useful API is a well documented one. If you haven't already looked into it, ASDoc is a code documentation tool that will generate your documentation based on how you apply the ASDoc syntax in your code. Glen Pike wrote: Hi, Have not written anything myself, but have played with quite a few AS2 ones. The SWXFormat project has quite a few API's for some of the services you mentioned, but they are still working on porting SWX to AS3. I guess one thing to suggest would be to get involved with the project and help them write the API's for these things. Yahoo is pretty up on Flash and has just released a few useful things. http://developer.yahoo.com/flash/ The Adobe labs site has some examples links here: http://labs.adobe.com/wiki/index.php/ActionScript_3:resources:apis:libraries Hope this helps. Glen Sidney de Koning wrote: Hi List, Are there people who write their own AS3 apis for web services? for instance twitter, the nabaztag rabbit, amazon? Do you have any good documentation on how and where to start? Special steps to take concerning events, things to keep in the back of your mind when coding. Or is there a Hitchhikers guide to writing flash api's? Any help would be highly appreciated1 Sid ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Notice of confidentiality: The information contained in this e-mail is intended only for the use of the individual or entity named above and may be confidential. Should the reader of this message not be the intended recipient, you are hereby notified that any unauthorized dissemination, distribution or reproduction of this message is strictly prohibited. If you have received this message in error, please advise the sender immediately and destroy the e-mail. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Multiple moviecliploaders
I tkink that 4 object at a time EECOLOR [EMAIL PROTECTED] schreef: If I remember well the MovieClip loader can only load 2 images simultaniously. This also might be a browser restriction. Greetz Erik ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Control speed by how fast mouse moving
Well, two transparent sprite are too little. You should create some 20 or even more of them. Position the vertically all over the stage at equal distances and every time the user passes his mouse over one of them it starts a timer. When it passes over the next it checks the timer time. So you'll have the distance between the 2 sprites/movie clips (because you have to position them at equal distances over the stage) and the time needed to reach one from the other. From this you can easily calculate the speed. I tried to draw it. Hope you'll see it all right: You have the movie clips (the horizontal lines) created and positioned to stage with a loop. You set an onMouseOver function. Then it starts a timer(i don't know how to do it-i only just started with as3) when the mouse goes over one of those MCs. When it goes over the next you check the time it took to move from one to the other and you calculate the speed(If the stage is 600 i think a mc every 20 or 30 pixels should do it for the distance between the mcs-don't put too much of them or i would use too much cpu and i am not sure if it would be able to check the time with 31 fms-)speed = distance/time; And you 'v got the speed. you make a var speed:Number=0; and the in an enter_frame event you check the speed of the mouse between 2 mcs, multiply it with a fraction of 1 so the acceleration is not too big and speed += speedBetweenMcs; ___ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ___ On Feb 13, 2008 8:04 AM, Paul Steven [EMAIL PROTECTED] wrote: Thanks Cory Good point about the setInterval introducing redundant processing.Problem with placing an invisible movie clip is, the users mouse may not pass over this movie clip. For example, the movie is 600 pixels wide and 400 pixels high. If I place a 400 high and say 10 pixels wide movie clip in the center of the movie, it is still possible for the player to move their mouse left and right in the area to the left or the area to the right of the hidden movie clip - hence no speed would be detected. I am therefore not sure how to overcome this apart from insisting they move the mouse in a specified area. Any ideas anyone? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Cory Petosky Sent: 12 February 2008 21:52 To: Flash Coders List Cc: [EMAIL PROTECTED] Subject: Re: [Flashcoders] Control speed by how fast mouse moving You'd be better off doing it in an onEnterFrame or a onMouseMove than in a setInterval call -- code is only executed between frames anyway, so your way just adds extra processing burden. Since all these events are only working once per frame, just comparing x's isn't likely to give you meaningful data -- if a player moves his mouse rapidly left to right at a rate that's some factor of your framerate, you could easily get the same (or similar) x value at every read. Increasing the framerate could help this, but brings other problems. Consider placing a small, invisible movieclip on the path you intend the user to move his mouse, and listen for onRollOver. You can use the number of RollOver events per second to adjust speed. Just keep in mind that you won't get any more events than your framerate. Finally, instead of adjusting speed directly, adjust max speed and provide a constant acceleration toward the current max speed. For example, if the user starts out at a rate that correlates to 50 mph, his current speed should slowly increase at a constant rate over many seconds until it reaches 50. Similarly, once the user begins to slow down, the speed should decrease linearly to the maximum speed allowed by the mouse move rate. This provides a slow acceleration at the beginning -- which is probably what you want if you're emulating the old button mashers -- and provides smooth speed changes as the game progresses, which is definitely good. On 2/12/08, Paul Steven [EMAIL PROTECTED] wrote: I am trying to program a game where a character moves faster, the faster the player moved the mouse left and right. A
Re: [Flashcoders] AS3 Api writing
I'm planning on opensourcing it (is that a word?) I get my data from an external source, in json or xml. I can write normal code to process that, but an API is somthing else, there is alot more involved. And that is what i'd like to learn. For instance when you look at the AS3 API for the nabaztag rabbit (http://www.iotashan.com/nabaztagexplorer/docs/) or the API's Christian Cantrell wrote (http://code.google.com/u/christian.cantrell/) you see that everything is organised in a specific manner, loads of custom events its a tad different that 'normal' code, if you know what i mean. I'd like to learn to write AS3 API's, but i hav eno idea where to start, so links, books, lists everything is welcome Cheers, Sid Cédric Tabin wrote: Hi Sidney, What's the goal of your API ? It is only for your private use or you plan to make it OpenSource ? You may have different constraints that comes depending on that (I mean). I'd say, a good API is a useful API (and also well documented) :) Regards, Cedric On Feb 13, 2008 5:52 PM, Sidney de Koning [EMAIL PROTECTED] wrote: Sounds like a very good tip :) The thing is i want to start writing my own api's. But i have no idea where to begin, what is a good starting point for me? Cheers, Sid Mark Lapasa wrote: (If you already know about this, my apologies in advance) A useful API is a well documented one. If you haven't already looked into it, ASDoc is a code documentation tool that will generate your documentation based on how you apply the ASDoc syntax in your code. Glen Pike wrote: Hi, Have not written anything myself, but have played with quite a few AS2 ones. The SWXFormat project has quite a few API's for some of the services you mentioned, but they are still working on porting SWX to AS3. I guess one thing to suggest would be to get involved with the project and help them write the API's for these things. Yahoo is pretty up on Flash and has just released a few useful things. http://developer.yahoo.com/flash/ The Adobe labs site has some examples links here: http://labs.adobe.com/wiki/index.php/ActionScript_3:resources:apis:libraries Hope this helps. Glen Sidney de Koning wrote: Hi List, Are there people who write their own AS3 apis for web services? for instance twitter, the nabaztag rabbit, amazon? Do you have any good documentation on how and where to start? Special steps to take concerning events, things to keep in the back of your mind when coding. Or is there a Hitchhikers guide to writing flash api's? Any help would be highly appreciated1 Sid ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Notice of confidentiality: The information contained in this e-mail is intended only for the use of the individual or entity named above and may be confidential. Should the reader of this message not be the intended recipient, you are hereby notified that any unauthorized dissemination, distribution or reproduction of this message is strictly prohibited. If you have received this message in error, please advise the sender immediately and destroy the e-mail. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 Api writing
He Glen, Thanks for your post; What i want to do is this; take data from an external source (an API for some service) and write a wrapper for flash (i found the right termonoligy :) ) But there is not that much documentation on writing this. Any good resources will help. Thanks, Sidney Glen Pike wrote: Hi, Do you mean you want to write Web Services or the AS3 code to use these? For the former, you would probably want to look on other lists as this will be server side code - for PHP, the only thing I can recommend is to look at Pear's libraries for common web services and see if you can extend the base classes to roll your own. There are also lots of other libraries out there - CakePHP had some if I remember rightly. Programmable Web http://www.programmableweb.com/ has a good list of API's available and may also mention some stuff that has been done in Flash already. For AS3, I would look at the documentation provided by the web-service providers and think about duplicating these functions on the client side... Have a look at the structure of some of the things I have mentioned - take them apart. You will probably see common functionality: A set of functions duplicating the server side functions you can call, some error handling and some response handling. If you are making a solid class, you will probably have to deal with asynchronicity - you can't block your client code waiting for something to happen on the server side as this is unreliable, instead, you will need to think about the EventListener model, etc. I remembered a good tutorial on the Devnet site which is really useful for thinking about any application that talks to servers somewhere: http://www.adobe.com/devnet/flex/articles/blueprint.html The article provides source code to download, but the main point is that it separates the services from the rest of the application really nicely - what you want to do. Have a look at Flashr too - this was a nice example of something that provided a really nice interface to the Flickr web service. Glen Sidney de Koning wrote: Sounds like a very good tip :) The thing is i want to start writing my own api's. But i have no idea where to begin, what is a good starting point for me? Cheers, Sid Mark Lapasa wrote: (If you already know about this, my apologies in advance) A useful API is a well documented one. If you haven't already looked into it, ASDoc is a code documentation tool that will generate your documentation based on how you apply the ASDoc syntax in your code. Glen Pike wrote: Hi, Have not written anything myself, but have played with quite a few AS2 ones. The SWXFormat project has quite a few API's for some of the services you mentioned, but they are still working on porting SWX to AS3. I guess one thing to suggest would be to get involved with the project and help them write the API's for these things. Yahoo is pretty up on Flash and has just released a few useful things. http://developer.yahoo.com/flash/ The Adobe labs site has some examples links here: http://labs.adobe.com/wiki/index.php/ActionScript_3:resources:apis:libraries Hope this helps. Glen Sidney de Koning wrote: Hi List, Are there people who write their own AS3 apis for web services? for instance twitter, the nabaztag rabbit, amazon? Do you have any good documentation on how and where to start? Special steps to take concerning events, things to keep in the back of your mind when coding. Or is there a Hitchhikers guide to writing flash api's? Any help would be highly appreciated1 Sid ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Notice of confidentiality: The information contained in this e-mail is intended only for the use of the individual or entity named above and may be confidential. Should the reader of this message not be the intended recipient, you are hereby notified that any unauthorized dissemination, distribution or reproduction of this message is strictly prohibited. If you have received this message in error, please advise the sender immediately and destroy the e-mail. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] pure AS3 app to use mx.* stuff
Glen, thanks for your reply. Previously with AS2, I have used the Linkage / AS2 class file method, so this is a similar thing. Look at Keith Peter's post here for some direction: http://www.bit-101.com/blog/?p=853 I'd like to mention one thing here about embedding symbols (movieclips). The matter is that, if the mc has only one frame (as most of my symbols do), it's embedded as mx.core.SpriteAsset and should be use as is or casted to Sprite. Similarly, if the symbol has 2+ frames, it's embedded as mx.core.MovieClipAsset and can be casted to MovieClip. I spend several hours in frustration before found this in EAS3 book :-). FD3 allows you to create Flex / Flash projects so I guess the Flex one includes the framework if you use it (sorry, a few weeks since I did the Hello World stuff and have forgotten the exact bits). So do I :-) Actually, everything goes ok, unless I'm trying to use components ( mx.controls.*). No problem using them in mxml file, but, to use them in AS3, seems I need 1) minimal mxml to load application 2) make main class to extend mx.core.Application (not Sprite) From the other hand, there is NO way to use fl.controls.* (and other non-intristics) w/o Flash CS3 installed. Hence was the question - trying to make the required mxml as small as possible. BTW, Flexcoders have several posts about it, but seems they feel ok using script tag in mxml. While I'd prefer to have well-planned class structure... -- -- Best regards, GregoryN http://GOusable.com Flash components development. Usability services. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] pure AS3 app to use mx.* stuff
Hi, Sorry was getting confused with what you were trying to do... You can write pure AS3 files for Flex - all MXML gets compiled down to AS3 before it is compiled to bytecode. (I had done followed an example online which has a pure AS3 component - once it is written, you add the package to your namespace and add an MXML tag in your code to add it to the stage.) Like with the workaround on the forum you posted - if you have added your package path to the namespace ( xmlns:app=app.*), you can write your code in an AS file rather than an MXML file, then you write it as you would any other class file - no need for Script tags mixing mxml / as code. ?xml version=1.0 encoding=utf-8? mx:Application horizontalScrollPolicy=off xmlns:mx=http://www.adobe.com/2006/mxml; xmlns:app=app.* layout=absolute frameRate=30 app:SystemCore id=sysCore width=100% height=100%/ /mx:Application So the above example, you can have your class in the app folder called SystemCore.as this looks like it extends a display object or similar as it has width and height attributes - not sure about extending other classes. Glen -- Glen Pike 01736 759321 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 Api writing
I honestly think from what you've said so far, you're already on track. You've got quite a bit to get started. My only recommendation would be if you can have your client objects either interacting with an Interface class or a Facade instead of accessing directly the concrete class/implementation of your services. By introducing an abstraction layer, you can 1) change the underlying implementation such that it adheres to a public declared interface. Connected client objects will not be too adversely affected by change since it is loosely coupled to the core implementation details of your api. 2) you can implement stub/dummy/hard code so that when client objects hit your API, they get the expected results in which case they don't know if they are getting the real deal or not. Once you have this in place, it's a matter of getting your internals of the api to actually deliver what the stub/dummy/hard code is responding back to client objects. I think to a certain degree, you need to wear at least two hats. One is how is your API going to work internally. The other is how easy will it be to access the services your API will provide. I think librarification of code is well worth the trouble if it's going to be reused in more than one project. Also the other bit of advice that I think people would agree is to keep it as simple as possible. It's very easy to offer an API with a ga-billion methods when client objects are only interested in a few if not one method call. Sidney de Koning wrote: He Glen, Thanks for your post; What i want to do is this; take data from an external source (an API for some service) and write a wrapper for flash (i found the right termonoligy :) ) But there is not that much documentation on writing this. Any good resources will help. Thanks, Sidney Glen Pike wrote: Hi, Do you mean you want to write Web Services or the AS3 code to use these? For the former, you would probably want to look on other lists as this will be server side code - for PHP, the only thing I can recommend is to look at Pear's libraries for common web services and see if you can extend the base classes to roll your own. There are also lots of other libraries out there - CakePHP had some if I remember rightly. Programmable Web http://www.programmableweb.com/ has a good list of API's available and may also mention some stuff that has been done in Flash already. For AS3, I would look at the documentation provided by the web-service providers and think about duplicating these functions on the client side... Have a look at the structure of some of the things I have mentioned - take them apart. You will probably see common functionality: A set of functions duplicating the server side functions you can call, some error handling and some response handling. If you are making a solid class, you will probably have to deal with asynchronicity - you can't block your client code waiting for something to happen on the server side as this is unreliable, instead, you will need to think about the EventListener model, etc. I remembered a good tutorial on the Devnet site which is really useful for thinking about any application that talks to servers somewhere: http://www.adobe.com/devnet/flex/articles/blueprint.html The article provides source code to download, but the main point is that it separates the services from the rest of the application really nicely - what you want to do. Have a look at Flashr too - this was a nice example of something that provided a really nice interface to the Flickr web service. Glen Sidney de Koning wrote: Sounds like a very good tip :) The thing is i want to start writing my own api's. But i have no idea where to begin, what is a good starting point for me? Cheers, Sid Mark Lapasa wrote: (If you already know about this, my apologies in advance) A useful API is a well documented one. If you haven't already looked into it, ASDoc is a code documentation tool that will generate your documentation based on how you apply the ASDoc syntax in your code. Glen Pike wrote: Hi, Have not written anything myself, but have played with quite a few AS2 ones. The SWXFormat project has quite a few API's for some of the services you mentioned, but they are still working on porting SWX to AS3. I guess one thing to suggest would be to get involved with the project and help them write the API's for these things. Yahoo is pretty up on Flash and has just released a few useful things. http://developer.yahoo.com/flash/ The Adobe labs site has some examples links here: http://labs.adobe.com/wiki/index.php/ActionScript_3:resources:apis:libraries Hope this helps. Glen Sidney de Koning wrote: Hi List, Are there people who write their own AS3 apis for web services? for instance twitter, the nabaztag rabbit, amazon? Do you have any good documentation
Re: [Flashcoders] Multiple moviecliploaders
Guess again: http://www.google.com/search?hl=enq=windows+simultaneous+downloadsmeta= http://support.microsoft.com/kb/282402 - Original Message - From: Cor [EMAIL PROTECTED] To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Wednesday, February 13, 2008 6:17 PM Subject: Re: [Flashcoders] Multiple moviecliploaders I tkink that 4 object at a time EECOLOR [EMAIL PROTECTED] schreef: If I remember well the MovieClip loader can only load 2 images simultaniously. This also might be a browser restriction. Greetz Erik ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Multiple moviecliploaders
I was certain I remember having to change this years ago to be able to download more than 4 files in IE. Here is the page that references the limit of 4 (2) MaxConnectionsPerServer REG_DWORD (Default 2) Sets the number of simultaneous requests to a single HTTP 1.1 Server MaxConnectionsPer1_0Server REG_DWORD (Default 4) Sets the number of simultaneous requests to a single HTTP 1.0 Server http://support.microsoft.com/default.aspx?scid=KB;en-us;q183110 On Feb 13, 2008 8:07 PM, Muzak [EMAIL PROTECTED] wrote: Guess again: http://www.google.com/search?hl=enq=windows+simultaneous+downloadsmeta= http://support.microsoft.com/kb/282402 - Original Message - From: Cor [EMAIL PROTECTED] To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Wednesday, February 13, 2008 6:17 PM Subject: Re: [Flashcoders] Multiple moviecliploaders I tkink that 4 object at a time EECOLOR [EMAIL PROTECTED] schreef: If I remember well the MovieClip loader can only load 2 images simultaniously. This also might be a browser restriction. Greetz Erik ___ 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