Re: [Flashcoders] Missing fl.* AS3 Packages in Flash CS3
The classes (.as files) are not in any classpath for faster compilation (.swc's compile faster). You can find the resources (fla files) on Win XP in: C:\Program Files\Adobe\Adobe Flash CS3\en\Configuration\Components The fl package sources (.as files) are in: C:\Program Files\Adobe\Adobe Flash CS3\en\Configuration\Component Source\ActionScript 3.0\User Interface\fl So if you want to extend one of these classes you'll have to add the 'User Interface' directory to the classpath. As mentioned earlier, doing so will result in slower compiling when using these classes (not sure how much slower though). regards, Muzak -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Chang Sent: Thursday, May 03, 2007 8:26 PM To: Flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Missing fl.* AS3 Packages in Flash CS3 Hello, I recently purchased Flash CS3 as part of CS3. To start, I wanted to use the following packages: fl.video.FLVPlayback fl.controls.Button When I tried to import these, I was surprised to get an error that these classes could not be found. I looked in the directories to see why (Mac OSX). I found the directory: Adobe Flash CS3:Configuration:ActionScript 3.0:Classes:fl In here, I found the following packages: lang, livepreview, motion, transitions but no video or controls. I don't know if these other ones are built in, but it doesn't appear so as a simple import statement causes a compile error. Has anyone encountered this issue? Thanks in advance, Paul ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] _searchKey???
_searchKey is added as a variable to all the movieclips on the stage and is interfering with extremely basic functionality What is it exactly that goes haywire? regards, Muzak - Original Message - From: Scott Boepple [EMAIL PROTECTED] To: flashcoders@chattyfig.figleaf.com Sent: Friday, May 04, 2007 2:27 AM Subject: [Flashcoders] _searchKey??? So I'm working on a project that uses the Flash 8 combobox. Everything is dandy until an item is selected from the combobox - at that point _searchKey is added as a variable to all the movieclips on the stage and is interfering with extremely basic functionality. I found _searchKey in mx.managers.FocusManagermx.managers.FocusManager in the First Run/Classes local structure. Apparently it's used to make sure components don't search for something more than once and uses getTimer (); That's all good. Glad it's there. Why would that property now be applied to other mc's on the stage? Any ideas how I could work around this or should I simply avoid the combobox? ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
[Flashcoders] Re: Flash 9 Express Install
Branding the interface and serving ads with custom rss took the cake for me. But yes those ads and iterabuive bits in the middle me the video were very cool. Matt On 5/3/07, Asai [EMAIL PROTECTED] wrote: Why don't you check out Geoff Stearn's SWFObject site? SWFObject supports express install for any version of the Flash Player. asai Matt Muller wrote: Anyone know if the 'Express Install' is available for a Flash Player 9 upgrade yet? thanks, - MaTT ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
[Flashcoders] Programatic anmation to Quicktime/AVI
Hello, Got an animation that uses nested MCs and programatic animation. Need to export it to either AVI or uncompressed Quicktime, and obviously using Flash's own export is a no-no. Was wondering how other people would approach this. Have tried a few swf to AVI apps, but found them prone to dropping frames. To compound matters I am using a Mac, though I can run PC apps through Parralells. Any advice gratefully appreciated. P ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] stumped video behaviour in AS2/Classes
doh, I'm really sorry. Silly me, thanks! [btw the constructor had all kinds of other [irrelevant] things in it, hence why i left it out, sorry! will include next time] On 5/3/07, Lists [EMAIL PROTECTED] wrote: Sebastian, You didn't include the timeline code, but I made some assumptions. I think the most relevant issue is that your NetConnection and NetStream variables are local and expire after the function is called. This works: //in class PostView.as, in com/blabla/ class com.blabla.PostView extends MovieClip { private var _netConn:NetConnection; private var _netStream:NetStream; public function playVideo () { _netConn = new NetConnection(); _netConn.connect(null); _netStream = new NetStream(_netConn); _netStream.onStatus = function (infoObject:Object) { trace (infoObject.code); } _root.vid.attachVideo(_netStream); _netStream.play(video/video.flv); } } //in timeline import com.blabla.PostView; var myVar:PostView = new PostView(); myVar.playVideo(); // I'm not a fan of classes without constructors, though. If you only included a snippet, disregard. If not, you can unify the class and function name above and omit the last line in the timeline. Or, even throw in a generic constructor for clarity/possible info. Rich Shupe ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] inline graphics with text
sorry to repost but i thought this might have got lost because of the time i posted On 3 May 2007, at 19:13, Allandt Bik-Elliott (Receptacle) wrote: i've had a quick squizz through the archives but not luck i'm looking to produce an xml driven site but one of the things that would make it a WHOLE lot easier is putting graphics inline with the text (to show links within the document) - is there any way of doing this or should i attach text boxes to do it? ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
[Flashcoders] Re: AS2: Design Pattern: event based or pointer? from model or controller?
Alo, So I've done some more independant research, I think I'm going to use an EventDispatcher system from the PageController: http://www.adobe.com/devnet/flash/articles/creating_events.html Instead of pointers. As I think this makes more sense. Ofcourse, any insight from the 'pros' still welcome! With kind, Seb. On 5/3/07, sebastian [EMAIL PROTECTED] wrote: Hello folks, My next question is conceptual... I've made good progress on many of the classes in my application, but I'm now caught in a dilemma regarding approach. As mentioned in a previous mail, I'm building a system that can be divided into two: 1 part does general world 3D animation until the pages are opened; this was relatively easy to make... the second part of the system deals with generating pages [its a templating MVC system]; this is the tough part! At the center of the application is my class: PageController Linked to it are 3 other Classes: PageModel [to load new pages], StatsCollector [to record new pages called] and MouseController [told to turn off 3D motion when pages are opened]. I was planning on using an object-instance pointer in the PageController formed during its construction, to tell the associated Classes that a new event has ocured, but someone pointed out to me that I should be using an event based system instead [so that's its easier to add new Classes that listen to the Controller in the future] Here is what I have: class com.blabla.PageController { //Object pointers private var pageModel:Object; private var statsCollector:Object; private var mouseController:Object; private var urlMapper:Object; //Page open/close status private var activeWindow:Boolean; function PageController ( __pageModel:Object, __mouseController:Object, __statsCollector:Object, __urlMapper:Object) { //Pointers: this.pageModel = __pageModel; this.statsCollector = __statsCollector; this.mouseController = __mouseController; this.urlMapper = __urlMapper; //Set initial state: this.activeWindow = false; } //this method is called by SWFAddress on url changes: public function urlChange(__name:String):Void { // MOUSE CONTROLLER //set the page active true to turn off //3D mouse system: this.activeWindow = true; //tell 3D mouse system to check status: this.mouseController.checkWindowStatus(); // PAGE MODEL //call URL mapper returns an XML file based //on the url __name //this XML file is then passed to the pageModel //which will then notify the PageView of changes this.pageModel.buildPage (this.urlMapper.convertLink (__name)); // STATS COLLECTOR //run the method in 'statscol' with url: this.statsCollector.callURL(__name); } } So, my question is... is this the right way to be sending events? By making pointers and calling methods in connected classes? Also, should I store my activeWindow parameter in the Controller? I have a feeling its in the wrong Class; but from a Code-clarity perspective it does make sense to have it here as the controller is a state-dispatcher...? Or should I be using an event based system instead of pointers? If so, could someone lightly outline what the difference would be like in such a set up? I'm not very familiar with using events to drive app like this. I'd be very thankful. Here is the latest diagram of the system: http://www.chedal.org/temp/uml_design_03.png [this that are blue/green are things I've built until now] Note I chose to connect the MouseController and StatsCollector to the PageController instead of the PageModel because if I did so the PageModel would get very long in terms of code; I want the PageModel to focus JUST on storing the Templates' data that the View will build [by refering to the PageModel's loaded data]. Also, if I linked everything to the PageModel instead, the functionality of the PageController as a dispatcher would be made redundant... am I right in this thinking? If you wish I can copy-paste the code of other Classes [assuming I've written the code!], but I don't think this is necessary to answer my question. With kindness, Sebastian. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] Programatic anmation to Quicktime/AVI
Swf2video has always worked for me http://www.adshareit.com/ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of pedr browne Sent: 04 May 2007 10:34 To: Flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Programatic anmation to Quicktime/AVI Hello, Got an animation that uses nested MCs and programatic animation. Need to export it to either AVI or uncompressed Quicktime, and obviously using Flash's own export is a no-no. Was wondering how other people would approach this. Have tried a few swf to AVI apps, but found them prone to dropping frames. To compound matters I am using a Mac, though I can run PC apps through Parralells. Any advice gratefully appreciated. P ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Programatic anmation to Quicktime/AVI
Flash CS3 export supports programatic animation. On 04/05/2007, at 6:33 PM, pedr browne wrote: Hello, Got an animation that uses nested MCs and programatic animation. Need to export it to either AVI or uncompressed Quicktime, and obviously using Flash's own export is a no-no. Was wondering how other people would approach this. Have tried a few swf to AVI apps, but found them prone to dropping frames. To compound matters I am using a Mac, though I can run PC apps through Parralells. Any advice gratefully appreciated. P ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] inline graphics with text
i'm looking to produce an xml driven site but one of the things that would make it a WHOLE lot easier is putting graphics inline with the text (to show links within the document) - is there any way of doing this or should i attach text boxes to do it? I suggest you try the Flashnewbie list at chattyfig.figleaf.com. Jason Merrill Bank of America GTO Learning Leadership Development eTools Multimedia Team ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
[Flashcoders] adding filter to the stage.
hi Guys, I've been thinking of this, is possible to add a filter to the stage? like: stageBlur:BlurFilter = new BlurFilter(); stage.filters=[stageBlur]; I don't know maybe I'm looking for something crazy, but I'd appreciate any input you would have guys. regards Gustavo Duenas Creative Director LEFT AND RIGHT SOLUTIONS LLC 1225 W. Beaver St. Suite 119 Jacksonville, Fl. 32204 904 . 2650330 www.leftandrightsolutions.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] LocalConnection via localhost failure
Try throwing some traces in there along with the Alerts. For some reason I've had trouble getting Alert dialogs to appear (I'd make the call to show it but it would never show up on screen). I never figured out why it was happening, but it's possible you're having the same problem. Maybe things are working, but the Alert boxes just aren't displaying for some reason. -Andy On 5/3/07, Stephen Downs [EMAIL PROTECTED] wrote: That does not fix it :( I've tried querying the domain property of the connection from both ends, and it is indeed returned as localhost so I know the movies are playing in the same sandbox. On 2007-05-03, at 1:50 PM, John Grden wrote: try naming your connection string by leading it with an underscore: _lc_reportSending On 5/3/07, Stephen Downs [EMAIL PROTECTED] wrote: I'm having a tough time getting a simple LocalConnection connection working. Scenario: Flash 8, AS 2, two separate Flash projectors. Procedure: 1) Projector A starts LocalConnection.connect. 2) Projector A opens Projector B via fscommand. 3) Project B initializes, then starts LocalConnection.send using connectionName from step A. No arguments are sent. 4) Nothing happens, no onStatus calls are triggered either on the LocalConnection instance or at the System level. The method does not get called. Both connect and send calls return true. This is all occurring on the localhost sandbox, so I'm pretty sure I don't have to deal with security shenanigans. The code is all contained in static singleton classes, so the LocalConnection objects are class properties. I'm probably overlooking something, but my brain is frazzled from fiddling with this for the last five hours. Thanks in advance for any insights or suggestions. Code snippets follow. // * From projector A main class: // Use alerts as a debug aid. import mx.controls.Alert; // ... public var _reportReceiver_lc:LocalConnection; // This gets called from a button -- the initial trigger to open up Projector B. public function showReport():Void { var theTimer:com.plasticbrain.timer.Timer = com.plasticbrain.timer.Timer.getInstance(); // Establish listener for report open event _reportReceiver_lc = new LocalConnection(); // This function doesn't get triggered. _reportReceiver_lc.allowDomain = function():Boolean { Alert.show(allowDomain, Alert); return true; } // This function doesn't get triggered either. _reportReceiver_lc.allowInsecureDomain = function():Boolean { Alert.show(allowInsecureDomain, Alert); return true; } // *** This is what I want to call from Projector B connection, but it fails! _reportReceiver_lc.initReport = function ():Void { Alert.show(***initReport, Alert); } var connectionName:String = lc_reportSending; var sendRes:Boolean = _reportReceiver_lc.connect(connectionName); Alert.show(showReport: listen=+sendRes+, con=+connectionName); // Last, open Projector B fscommand(exec, Report.app); } // * From projector B main class: import mx.controls.Alert; // ... public var _reportSender_lc:LocalConnection; // This gets called during initialization of Projector B. public function initReport():Void { // Create object to pass status to main Timer client. _reportSender_lc = new LocalConnection(); // This function doesn't get triggered. _reportSender_lc.onStatus = function (infoObject:Object) { Alert.show(onStatus, Alert); switch (infoObject.level) { case 'status' : Alert.show(connected!, Alert); break; case 'error' : Alert.show(connection error!, Alert); break; } }; var connectionName:String = lc_reportSending; var sendRes:Boolean = _reportSender_lc.send(connectionName, initReport); Alert.show(initReport: send=+sendRes +,domain=+_reportReceiver_lc.domain()+, con=+connectionName); } ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software
Re: [Flashcoders] Programatic anmation to Quicktime/AVI
Hello, Got an animation that uses nested MCs and programatic animation. Need to export it to either AVI or uncompressed Quicktime, and obviously using Flash's own export is a no-no. Was wondering how other people would approach this. Have tried a few swf to AVI apps, but found them prone to dropping frames. To compound matters I am using a Mac, though I can run PC apps through Parralells. Any advice gratefully appreciated. Actually, you should try CS3's video exporting feature; it works perfectly with actionscript code. I've tried exporting very complex actionscript sequences - ie, done with Papervision3D - and they work perfectly. The only caveat is not being able to interact with the movie (using the mouse/keyboard) while exporting. Other than that, it's the best way to export, hands down. There are ways to do this with previous Flash versions that will more or less work, but for a headache-less exporting, I'd suggest one getting Flash CS3 trial (somehow) and giving it a whirl. Zeh ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
[Flashcoders] Animating Character Movement
Hello, I'm working on an project where the user uses the arrows keys to move a guy in a kayak left and right across the screen. I have 6 total animations set up: Paddling Left, Idle Facing Left, Turning Left to Right, Paddling Right, Idle Facing Right, and Turning Right To Left. I've never programmed a moving character before, so I'm looking for some tips on the best way to program this sort of thing. I started to create a pseudo-state pattern using a 6 switch statement to figure out what state the character is currently in and responding accordingly when the user presses a key. This seems rather tedious though, and I figured there must be a better way of doing this. I think the part I'm having the most trouble with is the 'turning states'. Any feedback greatly appreciated! I can post some of my current code if it helps, but I really haven't gotten anywhere productive with it yet. Thanks! Daniel Holth I.S. Programmer This e-mail and its attachments are intended only for the use of the addressee(s) and may contain privileged, confidential or proprietary information. If you are not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution, displaying, copying, or use of this information is strictly prohibited. If you have received this communication in error, please inform the sender immediately and delete and destroy any record of this message. Thank you. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] Re: AS2: Design Pattern: event based or pointer? frommodel or controller?
IMO, EventDispatcher will work well in most cases. If you need a more flexible or scalable way to handle events, then I'd suggest writing your own event framework based on the Observer pattern as there are some limitations to EventDispatcher. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of sebastian chedal Sent: Friday, May 04, 2007 5:24 AM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Re: AS2: Design Pattern: event based or pointer? frommodel or controller? Alo, So I've done some more independant research, I think I'm going to use an EventDispatcher system from the PageController: http://www.adobe.com/devnet/flash/articles/creating_events.html Instead of pointers. As I think this makes more sense. Ofcourse, any insight from the 'pros' still welcome! With kind, Seb. On 5/3/07, sebastian [EMAIL PROTECTED] wrote: Hello folks, My next question is conceptual... I've made good progress on many of the classes in my application, but I'm now caught in a dilemma regarding approach. As mentioned in a previous mail, I'm building a system that can be divided into two: 1 part does general world 3D animation until the pages are opened; this was relatively easy to make... the second part of the system deals with generating pages [its a templating MVC system]; this is the tough part! At the center of the application is my class: PageController Linked to it are 3 other Classes: PageModel [to load new pages], StatsCollector [to record new pages called] and MouseController [told to turn off 3D motion when pages are opened]. I was planning on using an object-instance pointer in the PageController formed during its construction, to tell the associated Classes that a new event has ocured, but someone pointed out to me that I should be using an event based system instead [so that's its easier to add new Classes that listen to the Controller in the future] Here is what I have: class com.blabla.PageController { //Object pointers private var pageModel:Object; private var statsCollector:Object; private var mouseController:Object; private var urlMapper:Object; //Page open/close status private var activeWindow:Boolean; function PageController ( __pageModel:Object, __mouseController:Object, __statsCollector:Object, __urlMapper:Object) { //Pointers: this.pageModel = __pageModel; this.statsCollector = __statsCollector; this.mouseController = __mouseController; this.urlMapper = __urlMapper; //Set initial state: this.activeWindow = false; } //this method is called by SWFAddress on url changes: public function urlChange(__name:String):Void { // MOUSE CONTROLLER //set the page active true to turn off //3D mouse system: this.activeWindow = true; //tell 3D mouse system to check status: this.mouseController.checkWindowStatus(); // PAGE MODEL //call URL mapper returns an XML file based //on the url __name //this XML file is then passed to the pageModel //which will then notify the PageView of changes this.pageModel.buildPage (this.urlMapper.convertLink (__name)); // STATS COLLECTOR //run the method in 'statscol' with url: this.statsCollector.callURL(__name); } } So, my question is... is this the right way to be sending events? By making pointers and calling methods in connected classes? Also, should I store my activeWindow parameter in the Controller? I have a feeling its in the wrong Class; but from a Code-clarity perspective it does make sense to have it here as the controller is a state-dispatcher...? Or should I be using an event based system instead of pointers? If so, could someone lightly outline what the difference would be like in such a set up? I'm not very familiar with using events to drive app like this. I'd be very thankful. Here is the latest diagram of the system: http://www.chedal.org/temp/uml_design_03.png [this that are blue/green are things I've built until now] Note I chose to connect the MouseController and StatsCollector to the PageController instead of the PageModel because if I did so the PageModel would get very long in terms of code; I want the PageModel to focus JUST on storing the Templates' data that the View will build [by refering to the PageModel's loaded data]. Also, if I linked everything to the PageModel instead, the functionality of the PageController as a dispatcher would be made redundant... am I right in this thinking?
Re: [Flashcoders] Animating Character Movement
Hey Dan, I've had a bit of a struggle with this too. I've tried a few ways of doing it, but have settled on having all state/animations in a MovieClip on the first frame of the character MovieClip, and then functions to show and hide whichever animations you need eg: turnRightFromLeft() { paddleLeftMC.visible = false; idleLeftMC.visible = false; idleRightMC.visible = false idleCentre.gotoAndPlay(turnRightFromLeft); // at the end of this animation, it calls back to set 'paddleRightMC.visible = true'; } It's quite long winded, and you still need a state machine to work out which functions you need to call, but the other ways I tried were vastly more complex, and introducing a new animation at a later date was a real headache. HTH, James Holth, Daniel C. wrote: Hello, I'm working on an project where the user uses the arrows keys to move a guy in a kayak left and right across the screen. I have 6 total animations set up: Paddling Left, Idle Facing Left, Turning Left to Right, Paddling Right, Idle Facing Right, and Turning Right To Left. I've never programmed a moving character before, so I'm looking for some tips on the best way to program this sort of thing. I started to create a pseudo-state pattern using a 6 switch statement to figure out what state the character is currently in and responding accordingly when the user presses a key. This seems rather tedious though, and I figured there must be a better way of doing this. I think the part I'm having the most trouble with is the 'turning states'. Any feedback greatly appreciated! I can post some of my current code if it helps, but I really haven't gotten anywhere productive with it yet. Thanks! Daniel Holth I.S. Programmer This e-mail and its attachments are intended only for the use of the addressee(s) and may contain privileged, confidential or proprietary information. If you are not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution, displaying, copying, or use of this information is strictly prohibited. If you have received this communication in error, please inform the sender immediately and delete and destroy any record of this message. Thank you. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] inline graphics with text
ah you can just use img ~hangs head in shame and goes back to kindergarten On 4 May 2007, at 13:41, Merrill, Jason wrote: i'm looking to produce an xml driven site but one of the things that would make it a WHOLE lot easier is putting graphics inline with the text (to show links within the document) - is there any way of doing this or should i attach text boxes to do it? I suggest you try the Flashnewbie list at chattyfig.figleaf.com. Jason Merrill Bank of America GTO Learning Leadership Development eTools Multimedia Team ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Animating Character Movement
Try the State Pattern. I have successfully used this in a line of games I did for a client. The Quick and Dirty explanation: Each state knows what it needs to do. On a change state the old state exits and the new state enters. On an update (onEnterFrame) the state is handled (it does what it needs to accomplish). Any state can be interrupted to go into another state. Each state implements an interface. In my games I had a hierarchical state pattern (states within states) and the root state was in the game manager which held all the game logic methods that states could use to accomplish whatever task they wanted. More info (cleaner and clearer) here: http://www.ai-junkie.com/architecture/state_driven/tut_state1.html Ciao, Rob. James Marsden wrote: Hey Dan, I've had a bit of a struggle with this too. I've tried a few ways of doing it, but have settled on having all state/animations in a MovieClip on the first frame of the character MovieClip, and then functions to show and hide whichever animations you need eg: turnRightFromLeft() { paddleLeftMC.visible = false; idleLeftMC.visible = false; idleRightMC.visible = false idleCentre.gotoAndPlay(turnRightFromLeft); // at the end of this animation, it calls back to set 'paddleRightMC.visible = true'; } It's quite long winded, and you still need a state machine to work out which functions you need to call, but the other ways I tried were vastly more complex, and introducing a new animation at a later date was a real headache. HTH, James Holth, Daniel C. wrote: Hello, I'm working on an project where the user uses the arrows keys to move a guy in a kayak left and right across the screen. I have 6 total animations set up: Paddling Left, Idle Facing Left, Turning Left to Right, Paddling Right, Idle Facing Right, and Turning Right To Left. I've never programmed a moving character before, so I'm looking for some tips on the best way to program this sort of thing. I started to create a pseudo-state pattern using a 6 switch statement to figure out what state the character is currently in and responding accordingly when the user presses a key. This seems rather tedious though, and I figured there must be a better way of doing this. I think the part I'm having the most trouble with is the 'turning states'. Any feedback greatly appreciated! I can post some of my current code if it helps, but I really haven't gotten anywhere productive with it yet. Thanks! Daniel Holth I.S. Programmer This e-mail and its attachments are intended only for the use of the addressee(s) and may contain privileged, confidential or proprietary information. If you are not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution, displaying, copying, or use of this information is strictly prohibited. If you have received this communication in error, please inform the sender immediately and delete and destroy any record of this message. Thank you. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Syntax for dynamically calling a function
Wow, thanks for all your suggestions guys, Lists, I really appreciate the time you took to write your detailed response, I like your third option the best. David thanks for your suggestion I am going to do some further experimentation. I'll also have a look into the Event Dispatcher class as this looks interesting but I'm not sure what specific benefits it brings me here, I will do more research to find out. For the moment I think I will stick with putting this code inside my movie clip, and the do_ functions on the main timeline: this.onPress = function(){ this._parent[do_ + this._name].call(); } // Thanks again everyone :) On 3 May 2007, at 17:59, Lists wrote: The short answer is, you can invoke the function directly by writing: this.onPress = function () { _parent[this._name](); } or, if this looks clearer, you can use the call() method this.onPress = function () { _parent[this._name].call(); } However, there are a few issues with this approach. First, I don't like the fact that there are two things with the same name in the same scope: a function and a movie clip. This might just be me being picky, but I'll show you an example of where this breaks in a moment. Second, it's not best practice to put scripts inside movie clips. It's easier to assign these functions from the main timeline. Third, I'm not sure what this gains you. It's easier to copy and paste but, if you're already going into the movie clip manually, you might as well just type the function name. Maybe if you reused the clip from movie to movie this step would already be done and you'd only have to write the function... Or maybe I'm missing another time saving purpose. Combining all three of the above issues, you can automatically assign functions to all your movie clips from the the main timeline by writing this: (assumes mcs on stage named pictures, help, and home, and gets around same-name-in-same-scope by adding a do_ prefix to the function name) // for (var s:String in this) { if (typeof(this[s]) == movieclip) { this[x].onPress = function () { this._parent[do_ + this._name].call(); } } } function do_pictures() { trace(pictures); } function do_help() { trace(help); } function do_home() { trace(home); } // This will cause EVERY mc in the main timeline to behave this way, so this approach may not be what you want, but it's a proof of concept. You could do this through an array of all mcs you want the function assigned to, or even do it manually like this: pictures.onPress = function () { this._parent[do_ + this._name].call(); } But, again, without some sort of automation in applying the script, you lose the benefit. You might as well just write: pictures.onPress = function () { do_pictures(); } If you want to see an example of the same-name-in-same-scope problem, run the first example above after removing do_ from everything. The script will work but when it goes through and assigns the onPress event handler, it will assign it to the function pictures rather than the mc pictures. The function is seen before the mc in the execution order of the loop. Finally, if the lowercase string movieclip for typeof is confusing, you can substitute: if (this[x] instanceof MovieClip) { ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Cellrenderer problems
Hey Bruce, how are you (beyond this irritation, of course)? I don't have an existing cell renderer, but I might be able to help if I can see the code. One thing off the top of my head is that changing the font may be changing the behavior of the text field/label component so that it is now trapping your mouse event. You might be able to do something as simple as change the text field to prevent selectable/editable or something along those lines. I say this, vaguely, because I had the exact same symptom in an AS3 project recently and just set mouseEnabled to false on the text field to solve it. It's certainly not the same, but it gives us somewhere to look. Rich Shupe ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] BitmapData.dispose()
I'm not sure if its completely necessary, but when I use it, and check the activity monitor, my cpu usage drops considerably. - Ben I've only just noticed the dispose() method of the BitmapData object. Is it strictly necessary? That is: if I just let a BitmapData object get garbage collected, will the memory fail to be released? And if not, why would we need this method instead of plain old delete? Danny ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] _searchKey???
It's specifically killing my buttons (which are movieclips). It's forcing me to move the mouse slightly before buttons register as clickable again. But that's really the smaller issue. Main problem is that the combobox is having its way with movieclips that have nothing to do with it. I've even tried constantly deleting _searchKey from the clips it's affecting, but as soon as the variable is set, the stage is affected. Scott. Scott Boepple | Flash Lead | Whittman Hart | 310.788.1900 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Muzak Sent: Thursday, May 03, 2007 11:11 PM To: flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] _searchKey??? _searchKey is added as a variable to all the movieclips on the stage and is interfering with extremely basic functionality What is it exactly that goes haywire? regards, Muzak - Original Message - From: Scott Boepple [EMAIL PROTECTED] To: flashcoders@chattyfig.figleaf.com Sent: Friday, May 04, 2007 2:27 AM Subject: [Flashcoders] _searchKey??? So I'm working on a project that uses the Flash 8 combobox. Everything is dandy until an item is selected from the combobox - at that point _searchKey is added as a variable to all the movieclips on the stage and is interfering with extremely basic functionality. I found _searchKey in mx.managers.FocusManagermx.managers.FocusManager in the First Run/Classes local structure. Apparently it's used to make sure components don't search for something more than once and uses getTimer (); That's all good. Glad it's there. Why would that property now be applied to other mc's on the stage? Any ideas how I could work around this or should I simply avoid the combobox? ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] _searchKey???
Ah, that's the annoying focusmanager stealing focus - bug ;-) http://www.mail-archive.com/flashcoders@chattyfig.figleaf.com/msg22433.html regards, Muzak - Original Message - From: Scott Boepple [EMAIL PROTECTED] To: flashcoders@chattyfig.figleaf.com Sent: Friday, May 04, 2007 7:12 PM Subject: RE: [Flashcoders] _searchKey??? It's specifically killing my buttons (which are movieclips). It's forcing me to move the mouse slightly before buttons register as clickable again. But that's really the smaller issue. Main problem is that the combobox is having its way with movieclips that have nothing to do with it. I've even tried constantly deleting _searchKey from the clips it's affecting, but as soon as the variable is set, the stage is affected. Scott. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] _searchKey???
You're awesome. I ended up with a more complicated workaround that basically accomplished the same thing :) Thanks again. Scott Boepple | Flash Lead | Whittman Hart | 310.788.1900 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Muzak Sent: Friday, May 04, 2007 11:14 AM To: flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] _searchKey??? Ah, that's the annoying focusmanager stealing focus - bug ;-) http://www.mail-archive.com/flashcoders@chattyfig.figleaf.com/msg22433.h tml regards, Muzak - Original Message - From: Scott Boepple [EMAIL PROTECTED] To: flashcoders@chattyfig.figleaf.com Sent: Friday, May 04, 2007 7:12 PM Subject: RE: [Flashcoders] _searchKey??? It's specifically killing my buttons (which are movieclips). It's forcing me to move the mouse slightly before buttons register as clickable again. But that's really the smaller issue. Main problem is that the combobox is having its way with movieclips that have nothing to do with it. I've even tried constantly deleting _searchKey from the clips it's affecting, but as soon as the variable is set, the stage is affected. Scott. ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
[Flashcoders] flv playback from DVD
Hi I am trying tro figurte out what the best way to play back flv's from DVD would be? At the moment I am using the following script: var videoPath = mdm.Application.path+data/av/intro.flv var nc:NetConnection = new NetConnection(); nc.connect(null); var ns:NetStream = new NetStream(nc); IntroClip_video.attachVideo (ns); ns.play (videoPath); ns.onStatus = function(info) { trace(info.code); if (info.code == NetStream.Play.Stop) { gotoAndPlay(10); } }; ...but I am not sure it is the best, as some videos never seem to 'finish' so that the application I am developing hands on the last video frame instead of moving on to frame 10. Would proper streaming be better, than progressive download? Thanks! Nik Crosina ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] AS2: Design Pattern: event based or pointer? from model or controller?
Hello :) To implements MVC or a FrontController in your application you can try to use the event model of my opensource framework based with the DOM2/3 of the W3C model events, example : http://code.google.com/p/vegas/wiki/VegasTutorialsEvents Vegas page project : http://code.google.com/p/vegas/ Install Vegas : http://code.google.com/p/vegas/wiki/InstallVEGASwithSVN Tutorial in french to implement Visitor, Observer and FrontController(MVC) pattern with VEGAS : http://www.ekameleon.net/blog/index.php?2006/12/13/53--vegas-design-pattern-visitor http://www.ekameleon.net/blog/index.php?2006/12/16/54--vegas-tutorial-02-design-pattern-mvc-and-observer http://www.ekameleon.net/blog/index.php?2006/12/22/56--vegas-tutorial-03-design-pattern-mvc-with-frontcontroller http://www.ekameleon.net/blog/index.php?2006/12/22/57--vegas-tutorial-03-design-pattern-mvc-with-frontcontroller-partie2 you can test this tutorials with the example in the AS2/bin/test/vegas/util directory of the SVN repository of VEGAS. To finish i have begin to write a little library based on VEGAS, an Actionscript Template to creates application with VEGAS : http://code.google.com/p/astr/ This project is only an opensource example to implements with Vegas a full application with a global FrontController, MVC , config and localization model etc... This project is in alpha version but explain the event implementation of VEGAS. EKA+ :) 2007/5/3, sebastian [EMAIL PROTECTED]: Hello folks, My next question is conceptual... I've made good progress on many of the classes in my application, but I'm now caught in a dilemma regarding approach. As mentioned in a previous mail, I'm building a system that can be divided into two: 1 part does general world 3D animation until the pages are opened; this was relatively easy to make... the second part of the system deals with generating pages [its a templating MVC system]; this is the tough part! At the center of the application is my class: PageController Linked to it are 3 other Classes: PageModel [to load new pages], StatsCollector [to record new pages called] and MouseController [told to turn off 3D motion when pages are opened]. I was planning on using an object-instance pointer in the PageController formed during its construction, to tell the associated Classes that a new event has ocured, but someone pointed out to me that I should be using an event based system instead [so that's its easier to add new Classes that listen to the Controller in the future] Here is what I have: class com.blabla.PageController { //Object pointers private var pageModel:Object; private var statsCollector:Object; private var mouseController:Object; private var urlMapper:Object; //Page open/close status private var activeWindow:Boolean; function PageController ( __pageModel:Object, __mouseController:Object, __statsCollector:Object, __urlMapper:Object) { //Pointers: this.pageModel = __pageModel; this.statsCollector = __statsCollector; this.mouseController = __mouseController; this.urlMapper = __urlMapper; //Set initial state: this.activeWindow = false; } //this method is called by SWFAddress on url changes: public function urlChange(__name:String):Void { // MOUSE CONTROLLER //set the page active true to turn off //3D mouse system: this.activeWindow = true; //tell 3D mouse system to check status: this.mouseController.checkWindowStatus(); // PAGE MODEL //call URL mapper returns an XML file based //on the url __name //this XML file is then passed to the pageModel //which will then notify the PageView of changes this.pageModel.buildPage (this.urlMapper.convertLink (__name)); // STATS COLLECTOR //run the method in 'statscol' with url: this.statsCollector.callURL(__name); } } So, my question is... is this the right way to be sending events? By making pointers and calling methods in connected classes? Also, should I store my activeWindow parameter in the Controller? I have a feeling its in the wrong Class; but from a Code-clarity perspective it does make sense to have it here as the controller is a state-dispatcher...? Or should I be using an event based system instead of pointers? If so, could someone lightly outline what the difference would be like in such a set up? I'm not very familiar with using events to drive app like this. I'd be very thankful. Here is the latest diagram of the system: http://www.chedal.org/temp/uml_design_03.png [this that are blue/green are things I've built
RE: [Flashcoders] Syntax for dynamically calling a function
My personal favorite is the use of the Delegate loaded with arguments. // // INTERACTION // function button_onPress ( btn:MovieClip ) { var data = dataArray [ btn.id ]; var func = this [ 'func_' + data.section ]; func ( data ); } // // EVENTS // function func_work ( data:Object ) {trace( data.btn ); } function func_portfolio ( data:Object ) { trace( data.id ); } function func_about ( data:Object ) { trace( data.section ); } // // UTILS // function proxyBEFORE (s:Object, func:Function):Function { // from jgDelegate.as var a:Array = arguments.slice(2, arguments.length); return function ():Void { func.apply(s, a.concat(arguments)); }; } // // INIT // var dataArray = [ {section:'work'}, {section:'portfolio'}, {section:'about'} ]; var len = dataArray.length; for ( var i = 0; ilen; i++) { var btn = holder [ 'btn_' + dataArray [i].section ]; dataArray[i].id = btn.id = i; dataArray[i].btn = btn; btn.onPress = proxyBEFORE ( this, button_onPress, btn ); } _ Jesse Graupmann www.jessegraupmann.com www.justgooddesign.com/blog/ _ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alistair Colling Sent: Friday, May 04, 2007 8:59 AM To: flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] Syntax for dynamically calling a function Wow, thanks for all your suggestions guys, Lists, I really appreciate the time you took to write your detailed response, I like your third option the best. David thanks for your suggestion I am going to do some further experimentation. I'll also have a look into the Event Dispatcher class as this looks interesting but I'm not sure what specific benefits it brings me here, I will do more research to find out. For the moment I think I will stick with putting this code inside my movie clip, and the do_ functions on the main timeline: this.onPress = function(){ this._parent[do_ + this._name].call(); } // Thanks again everyone :) On 3 May 2007, at 17:59, Lists wrote: The short answer is, you can invoke the function directly by writing: this.onPress = function () { _parent[this._name](); } or, if this looks clearer, you can use the call() method this.onPress = function () { _parent[this._name].call(); } However, there are a few issues with this approach. First, I don't like the fact that there are two things with the same name in the same scope: a function and a movie clip. This might just be me being picky, but I'll show you an example of where this breaks in a moment. Second, it's not best practice to put scripts inside movie clips. It's easier to assign these functions from the main timeline. Third, I'm not sure what this gains you. It's easier to copy and paste but, if you're already going into the movie clip manually, you might as well just type the function name. Maybe if you reused the clip from movie to movie this step would already be done and you'd only have to write the function... Or maybe I'm missing another time saving purpose. Combining all three of the above issues, you can automatically assign functions to all your movie clips from the the main timeline by writing this: (assumes mcs on stage named pictures, help, and home, and gets around same-name-in-same-scope by adding a do_ prefix to the function name) // for (var s:String in this) { if (typeof(this[s]) == movieclip) { this[x].onPress = function () { this._parent[do_ + this._name].call(); } } } function do_pictures() { trace(pictures); } function do_help() { trace(help); } function do_home() { trace(home); } // This will cause EVERY mc in the main timeline to behave this way, so this approach may not be what you want, but it's a proof of concept. You could do this through an array of all mcs you want the function assigned to, or even do it manually like this: pictures.onPress = function () { this._parent[do_ + this._name].call(); } But, again, without some sort of automation in applying the script, you lose the benefit. You might as well just write: pictures.onPress = function () { do_pictures(); } If you want to see an example of the same-name-in-same-scope problem, run the first example above after removing do_ from everything. The script will work but when it goes through and assigns the onPress event handler, it will assign it to the function pictures rather than the mc pictures. The function is seen before the mc in the execution order of the loop. Finally, if the lowercase string movieclip for typeof is confusing, you can substitute: if (this[x] instanceof MovieClip) { ___
Re: [Flashcoders] Re: AS2: Design Pattern: event based or pointer? frommodel or controller?
Thanks David and Muzak, What I've done is used an existing Broadcaster.as class to create events, and then created a pointer in the PageController + relatedListening classes to the Broadcaster so that they can register eventListen + DispatchEvent. I found this conceptually easier to implement than: .addEventListener(click, Delegate.create(this, function)); But I think this also has to do with my unfamiliarity with using this design approach... especially in how to make two classes talk to each other [all the examples I find have the Delegate function call something within the same class; but i need the events to go between classes...?] So here is how I am doing it... the Broadcaster class: //THE BROADCASTER class com.oop.core.Broadcaster { private var __listeners:Array; function Broadcaster() { __listeners = []; } public function addEventListener(evnt:String, lstnr:Object, mappedTo:String):Boolean { var ev:String; var li:Object; for (var i in __listeners) { ev = __listeners[i].event; li = __listeners[i].listener; if (ev == evnt li == lstnr) return false; } __listeners.push({event:evnt, listener:lstnr, mappedTo:mappedTo}); return true; } public function dispatchEvent(evnt:String, params:Object):Void { var evtObj = {type:evnt, parameters:params}; for (var i:String in __listeners) { if (__listeners[i].event == evnt) { __listeners[i].listener[evnt](evtObj); __listeners[i].listener[__listeners[i].mappedTo](evtObj); } } this[evnt + Handler](evtObj); } public function removeEventListener(evnt:String, lstnr:Object):Boolean { var ev:String; var li:Object; for (var i = 0; i __listeners.length; i++) { ev = __listeners[i].event; li = __listeners[i].listener; if (ev == evnt li == lstnr) { __listeners.splice(i, 1); return true; } } return false; } } And then in each class I want to register to the broadcaster I write: //THE DISPATCHER class com.blabla.PageController { //init pointers: private var myModel:Object; private var myBroadcaster:Object; private var myURLMapper:Object; //init window state: private var activeWindow:Boolean; public function PageController (__myModel:Object,__myBroadcaster:Object,__myURLMapper:Object) { myModel = __myModel; myBroadcaster = __myBroadcaster; myURLMapper = __myURLMapper; activeWindow = false; } public function urlChange (__newURL:String):Void { if ((__newURL == ) || (__newURL == /)) { activeWindow = false; } else { activeWindow = true; } myBroadcaster.dispatchEvent(newURL,{myURL:__newURL,activate:activeWindow,relatedXMLfile:myURLMapper.matchURL(__newURL)}); } } //THE EVENT LISTENER class com.blabla.StatsCollector { var myBroadcaster:Object; public function StatsCollector (__myBroadcaster) { myBroadcaster = __myBroadcaster; myBroadcaster.addEventListener(newURL,this) } public function newURL (__newURL) { trace (StatsCollector = + __newURL.parameters.myURL); } } Are there any advantages/disadvantages to the way I am setting up my listeners/dispatchers in this way vs. addEventListener(event, Delegate.create(this, function));? I want to make sure I'm doing it right as I will soon be making loads of listeners/dispatchers... thanks again!!! seb. David Ngo wrote: IMO, EventDispatcher will work well in most cases. If you need a more flexible or scalable way to handle events, then I'd suggest writing your own event framework based on the Observer pattern as there are some limitations to EventDispatcher. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of sebastian chedal Sent: Friday, May 04, 2007 5:24 AM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Re: AS2: Design Pattern: event based or pointer? frommodel or controller? Alo, So I've done some more independant research, I think I'm going to use an EventDispatcher system from the PageController: http://www.adobe.com/devnet/flash/articles/creating_events.html Instead of pointers. As I think this makes more sense. Ofcourse, any insight from the
Re: [Flashcoders] flv playback from DVD
Do you mean you want to switch from DVD to net-based delivery? You can't stream from a DVD. If you had a kiosk situation, I guess you could setup a local server and point to the DVD as your asset repository, but you can't do that if you're distributing the DVD. There are a few other things you can do to check for the end of the DVD. You can check for current time and compare it against the duration parsed from the metadata (assuming your encoder has added it and it is reliable). You can let the FLVPlayback component handle the event for you (which has other issues which have been discussed here, namely seeking). If you think the playback will be very reliable because the files are local, you can check for NetStream.Buffer.Empty (The only trouble there is, the buffer can empty and refill if the playback data transfer is choppy. I had that happen from my boot drive a day or two ago, because it was chugging on something else, so it could probably happen with DVD playback.) There are further options, but I'm drawing a blank at the moment. Rich Shupe ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] flv playback from DVD
Hi Rich, Thank you for attempting to answer a rather tentative post, I am finding out more as I am writing this - ... the main reason why I posted was because the video I got from the client didn't trigger the script that was supposed ot execute at the end of the video. Now it turns out that Flash 8 encoder doesn't do it's job properly when entering the metadata and I have found that Flix Pro does. Or at least in such a way that it triggers 'NetStream.Play.Stop' which is what I would assume is safest when determining whether a clip has finished playing back. The DVD is the distribution medium and I have done loads of these with Director, but not so many with Flash (probably going to change in the future though). Nik On 5/4/07, Lists [EMAIL PROTECTED] wrote: Do you mean you want to switch from DVD to net-based delivery? You can't stream from a DVD. If you had a kiosk situation, I guess you could setup a local server and point to the DVD as your asset repository, but you can't do that if you're distributing the DVD. There are a few other things you can do to check for the end of the DVD. You can check for current time and compare it against the duration parsed from the metadata (assuming your encoder has added it and it is reliable). You can let the FLVPlayback component handle the event for you (which has other issues which have been discussed here, namely seeking). If you think the playback will be very reliable because the files are local, you can check for NetStream.Buffer.Empty (The only trouble there is, the buffer can empty and refill if the playback data transfer is choppy. I had that happen from my boot drive a day or two ago, because it was chugging on something else, so it could probably happen with DVD playback.) There are further options, but I'm drawing a blank at the moment. Rich Shupe ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- Nik C ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] remoting with as3 (not flex)
I was playing with this a while ago too This is the solution I came up with. I have amfphp installed on my server. First I make a class called 'RemotingService': package { import flash.net.NetConnection; import flash.net.ObjectEncoding; public class RemotingService extends NetConnection { function RemotingService(url:String) { objectEncoding = ObjectEncoding.AMF3; // verander eventueel naar AMF0 voor compatibiliteit connect(url); } } } Then a class which does the remoting (with some basic parsing): package { import RemotingService; public class Remoting { private var rs:RemotingService; function Remoting() { } private function getData() { rs = new RemotingService(http://www.someadress.com/_amfphp/ gateway.php); var responder:Responder = new Responder(theresult, theproblem); rs.call(classPath, responder); } private function theresult(re:Object):void { for ( var a in re.serverInfo.initialData ){ for ( var b in re.serverInfo.initialData[a] ){ trace(b+ = +re.serverInfo.initialData[a][b]); }; trace(); }; } private function theproblem(fault:Object):void { trace(fault); } } } Hope this helps. Greetings Ypmits Op 16-apr-2007, om 17:57 heeft Mark Walters het volgende geschreven: Is there any class that you know of like RecordSet or ArrayCollection for AS3 only projects (not flex)? I'm looking for a class to handle database query results a little easier. -- Mark Walters [EMAIL PROTECTED] http://digitalflipbook.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com