RE: [Flashcoders] A Question that I've been asking for years ...
Interfaces allow 'Polymorphism'. Many say this is OOP's greatest contribution to computer science. Polymorphism occurs when a superclass stands in for a subclass. This is extremely useful when you don't know exactly what type of class (usually a concrete class) is needed at a specific spot within your code. Example: class Vehicle extends Sprite - class Car extends Vehicle class Boat extends Vehicle class Plane extends Vehicle Using the above, you can declare an attribute as type Vehicle in any spot where you don't know exactly which of the 3 vehicle types the application will be operating on. There needs to be a way (in my opinion) to define a type, it's methods/properties and whether these methods/properties are public or private. Also, you should be able to define concrete implementation within these methods. As I understand it, the closest you can get to what I've described above, is an abstract class which implements an interface, and methods within the abstract class throw an error - to make sure that a class extending the abstract overwrites said methods. Any thoughts on this? ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] RTMP H.264 and FLVPlayback
OK I change the question: has anyone managed to play RTMP H.264 through FLVPlayback??? Kenneth -- Kenneth Kawamoto http://www.materiaprima.co.uk/ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] A Question that I've been asking for years ...
On Sat, Sep 6, 2008 at 9:37 AM, S0 F1 [EMAIL PROTECTED] wrote: Interfaces allow 'Polymorphism'. Many say this is OOP's greatest contribution to computer science. snip Any thoughts on this? What you've described above has no need for interfaces. That's just standard OOP polymorphism based on inheritance of concrete objects. Interfaces are actually more useful for objects which aren't necessarily related via inheritance. It's worth reading back through this long (and quite old, as Jason points out) thread - there are a lot of good answers in it. Ian ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 Call a function from an array
Thanks Mike! -Gerry On Sep 6, 2008, at 12:47 AM, Mike Chambers wrote: if fnct is a function: stepArray[0].fnct(); if it is a string: stepArray[0][fnct](); The 0 is the index from the array you want to retrieve. mike chambers [EMAIL PROTECTED] On Sep 5, 2008, at 8:30 PM, Gerry wrote: I have an array built from and XML file that I want to step through and one of the nodes will have a function to call. I thought I did this in AS2 before but can't find my code. I'm stuffing my array with the function string cast as an object but I can't seem to find any hints on how I should be calling that function. My array is built like this... [code] //this works fine for each (var step:XML in xmlData..step) { var step_text:String = step.text; var stepFunc:String = step.funct; var stepPause:Number = step.pausev; stepArray.push({txt:step_text,fnct:stepFunc,pv:stepPause}); } [/code] I want to call the stepArray.fnct but can't seem to get it to work nor can I find an example of how I should go about this. Any help or link would be greatly appreciated. ___ 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] Spinning world..
- Original Message - From: Zeh Fernando [EMAIL PROTECTED] To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Saturday, September 06, 2008 4:21 AM Subject: Re: [Flashcoders] Spinning world.. First thought was PaperVision3D, but I really wonder if it's up to doing the rotating globe with cities attached effect. Second thought was pre-rendered sequences switched frame by frame, but it looks rather more sophisticated than that - it rotates at any angle. Your second assumption is correct. It's a pre-rendered sequence. It does not rotate by any angle - it just give you the impression that it's doing that because it rotates the container (in 2d). Aha, now I look again (after a nights sleep) I see that you are absolutely right. Rotation about a single axis cleverly disguised using a 2D rotation. And of course, yes, it's very well made. It certainly is. Zeh Thanks to everyone in the thread who took a look. Paul ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] RTMP H.264 and FLVPlayback
Works fine here. Make sure to use the following syntax to stream any compatible MPEG-4 file: .mov, .avi, .mp4, etc.. rtmp://[domain]/[app]/mp4:streamname.mp4 The following code works with an FLVPlayback instance named _vpb and an MPEG-4 file named r4_unlock.mov import fl.video.FLVPlayback; _vpb.source = rtmp://muzakserver/vod/mp4:r4_unlock.mov; regards, Muzak - Original Message - From: Kenneth Kawamoto [EMAIL PROTECTED] To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Saturday, September 06, 2008 12:09 PM Subject: [Flashcoders] RTMP H.264 and FLVPlayback OK I change the question: has anyone managed to play RTMP H.264 through FLVPlayback??? Kenneth -- Kenneth Kawamoto http://www.materiaprima.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
Re: [Flashcoders] RTMP H.264 and FLVPlayback
Thanks Muzak. I didn't know about this mp4:file source string - it's not documented by Adobe is it...? How strange ;) Will ask my colleague to test again on Monday. Kind regards, Kenneth Kawamoto http://www.materiaprima.co.uk/ Muzak wrote: Works fine here. Make sure to use the following syntax to stream any compatible MPEG-4 file: .mov, .avi, .mp4, etc.. rtmp://[domain]/[app]/mp4:streamname.mp4 The following code works with an FLVPlayback instance named _vpb and an MPEG-4 file named r4_unlock.mov import fl.video.FLVPlayback; _vpb.source = rtmp://muzakserver/vod/mp4:r4_unlock.mov; regards, Muzak - Original Message - From: Kenneth Kawamoto [EMAIL PROTECTED] To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Saturday, September 06, 2008 12:09 PM Subject: [Flashcoders] RTMP H.264 and FLVPlayback OK I change the question: has anyone managed to play RTMP H.264 through FLVPlayback??? Kenneth -- Kenneth Kawamoto http://www.materiaprima.co.uk/ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 Call a function from an array
Where is the actual function? You cant store a function in XML, on the name. You can then use that name to construct a call to the function. Where is the function? mike chambers [EMAIL PROTECTED] mike chambers [EMAIL PROTECTED] On Sep 6, 2008, at 7:40 AM, Gerry wrote: Mike, Neither of these options are working. -Gerry Here's what my XML looks like: steps step textNEW TEXT./text functtestFunction/funct pausev1.5/pausev /step step textNEXT TEXT to display ./text functtestFunctionOne/funct pausev2.5/pausev /step /steps I have a button that is named mentorNext with this event listener.. mentorNxt.addEventListener(MouseEvent.CLICK,playNextSection); the function playNextSection looks like this... private function playNextSection(e:MouseEvent):void{ // var val:Number = stepArray[stepCount].pv; //stepArray[stepCount].fnct(val); stepArray[stepCount][fnct](val); textwindow.captionTxt.text = stepArray[stepCount].txt; stepCount++ } If I remove the line for the stepArray function the textwindow.captionText line works. The data is there the array is populated properly but I can't get the function to act like a function. I get this error message: TypeError: Error #1006: value is not a function. at MainIntro/::playNextSection() Thanks, -Gerry On Sep 6, 2008, at 12:47 AM, Mike Chambers wrote: if fnct is a function: stepArray[0].fnct(); if it is a string: stepArray[0][fnct](); The 0 is the index from the array you want to retrieve. mike chambers [EMAIL PROTECTED] On Sep 5, 2008, at 8:30 PM, Gerry wrote: I have an array built from and XML file that I want to step through and one of the nodes will have a function to call. I thought I did this in AS2 before but can't find my code. I'm stuffing my array with the function string cast as an object but I can't seem to find any hints on how I should be calling that function. My array is built like this... [code] //this works fine for each (var step:XML in xmlData..step) { var step_text:String = step.text; var stepFunc:String = step.funct; var stepPause:Number = step.pausev; stepArray.push({txt:step_text,fnct:stepFunc,pv:stepPause}); } [/code] I want to call the stepArray.fnct but can't seem to get it to work nor can I find an example of how I should go about this. Any help or link would be greatly appreciated. ___ 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 Call a function from an array
Mike asks an important question, but assuming for the moment the function is in the same class as playNextSection(): What you're retrieving from the XML is a String. So the line stepArray[stepCount][fnct](val); isn't going to call a function. It's going to try to treat a string as a function... and the main way to do that is via [ ] notation. I think it's most readable to separate it into two steps: var functionName:String = stepArray[stepCount][fnct]; this[functionName](val); // assuming it's in this class. You may also have to cast this[functionName] this as a function; can't test right now -jonathan On Sat, Sep 6, 2008 at 12:09 PM, Mike Chambers [EMAIL PROTECTED] wrote: Where is the actual function? You cant store a function in XML, on the name. You can then use that name to construct a call to the function. Where is the function? mike chambers [EMAIL PROTECTED] mike chambers [EMAIL PROTECTED] On Sep 6, 2008, at 7:40 AM, Gerry wrote: Mike, Neither of these options are working. -Gerry Here's what my XML looks like: steps step textNEW TEXT./text functtestFunction/funct pausev1.5/pausev /step step textNEXT TEXT to display ./text functtestFunctionOne/funct pausev2.5/pausev /step /steps I have a button that is named mentorNext with this event listener.. mentorNxt.addEventListener(MouseEvent.CLICK,playNextSection); the function playNextSection looks like this... private function playNextSection(e:MouseEvent):void{ // var val:Number = stepArray[stepCount].pv; //stepArray[stepCount].fnct(val); stepArray[stepCount][fnct](val); textwindow.captionTxt.text = stepArray[stepCount].txt; stepCount++ } If I remove the line for the stepArray function the textwindow.captionText line works. The data is there the array is populated properly but I can't get the function to act like a function. I get this error message: TypeError: Error #1006: value is not a function. at MainIntro/::playNextSection() Thanks, -Gerry On Sep 6, 2008, at 12:47 AM, Mike Chambers wrote: if fnct is a function: stepArray[0].fnct(); if it is a string: stepArray[0][fnct](); The 0 is the index from the array you want to retrieve. mike chambers [EMAIL PROTECTED] On Sep 5, 2008, at 8:30 PM, Gerry wrote: I have an array built from and XML file that I want to step through and one of the nodes will have a function to call. I thought I did this in AS2 before but can't find my code. I'm stuffing my array with the function string cast as an object but I can't seem to find any hints on how I should be calling that function. My array is built like this... [code] //this works fine for each (var step:XML in xmlData..step) { var step_text:String = step.text; var stepFunc:String = step.funct; var stepPause:Number = step.pausev; stepArray.push({txt:step_text,fnct:stepFunc,pv:stepPause}); } [/code] I want to call the stepArray.fnct but can't seem to get it to work nor can I find an example of how I should go about this. Any help or link would be greatly appreciated. ___ 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 -- -jonathan howe :: 404.434.2321 :: 180 High St Apt 26 Portland, ME 04101 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 Call a function from an array
Crap... My bad, I sent a code sample that didn't have the function calls I was getting from the XML. Your sample is exactly what I was looking for. I never included the functions that the array contains because I figured that was assumed. They are just two functions right now that look like this... private function playNextSection(e:MouseEvent):void{ // var val:Number = stepArray[stepCount].pv; var functionCall:String = stepArray[stepCount][fnct]; this[functionCall](val); textwindow.captionTxt.text = stepArray[stepCount].txt; stepCount++ } private function testFunction(num:Number):void{ trace(you called testFunction, num -- +num); } private function testFunctionOne(num:Number):void{ trace(you called testFunctionOne, num -- +num); } Everything is working the way I wanted. Thanks, -Gerry On Sep 6, 2008, at 12:31 PM, jonathan howe wrote: Mike asks an important question, but assuming for the moment the function is in the same class as playNextSection(): What you're retrieving from the XML is a String. So the line stepArray[stepCount][fnct](val); isn't going to call a function. It's going to try to treat a string as a function... and the main way to do that is via [ ] notation. I think it's most readable to separate it into two steps: var functionName:String = stepArray[stepCount][fnct]; this[functionName](val); // assuming it's in this class. You may also have to cast this[functionName] this as a function; can't test right now -jonathan On Sat, Sep 6, 2008 at 12:09 PM, Mike Chambers [EMAIL PROTECTED] wrote: Where is the actual function? You cant store a function in XML, on the name. You can then use that name to construct a call to the function. Where is the function? mike chambers [EMAIL PROTECTED] mike chambers [EMAIL PROTECTED] On Sep 6, 2008, at 7:40 AM, Gerry wrote: Mike, Neither of these options are working. -Gerry Here's what my XML looks like: steps step textNEW TEXT./text functtestFunction/funct pausev1.5/pausev /step step textNEXT TEXT to display ./text functtestFunctionOne/funct pausev2.5/pausev /step /steps I have a button that is named mentorNext with this event listener.. mentorNxt.addEventListener(MouseEvent.CLICK,playNextSection); the function playNextSection looks like this... private function playNextSection(e:MouseEvent):void{ // var val:Number = stepArray[stepCount].pv; //stepArray[stepCount].fnct(val); stepArray[stepCount][fnct](val); textwindow.captionTxt.text = stepArray[stepCount].txt; stepCount++ } If I remove the line for the stepArray function the textwindow.captionText line works. The data is there the array is populated properly but I can't get the function to act like a function. I get this error message: TypeError: Error #1006: value is not a function. at MainIntro/::playNextSection() Thanks, -Gerry On Sep 6, 2008, at 12:47 AM, Mike Chambers wrote: if fnct is a function: stepArray[0].fnct(); if it is a string: stepArray[0][fnct](); The 0 is the index from the array you want to retrieve. mike chambers [EMAIL PROTECTED] On Sep 5, 2008, at 8:30 PM, Gerry wrote: I have an array built from and XML file that I want to step through and one of the nodes will have a function to call. I thought I did this in AS2 before but can't find my code. I'm stuffing my array with the function string cast as an object but I can't seem to find any hints on how I should be calling that function. My array is built like this... [code] //this works fine for each (var step:XML in xmlData..step) { var step_text:String = step.text; var stepFunc:String = step.funct; var stepPause:Number = step.pausev; stepArray.push({txt:step_text,fnct:stepFunc,pv:stepPause}); } [/code] I want to call the stepArray.fnct but can't seem to get it to work nor can I find an example of how I should go about this. Any help or link would be greatly appreciated. ___ 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
Re: [Flashcoders] fun with embedFonts - NOT
that's awesome guys - thanks for the tips are there any file size issues with linking the font from the library as opposed to having a text field off screen? a On 5 Sep 2008, at 19:27, sebastian wrote: nice tip, but it's not absolutely necessary to get them to work, though it may be 'faster' than trying to do it the 'right' way [whatever that means, fonts are really precarious]. Bob Wohl wrote: Hello, Have you tried to place a text field off screen/stage and embed the font family (each style needs to be embeded in it's own text field - bold, italic etc) that you are trying to use. I remember there being some buggy- ness when trying to embed in AS2 and that was one of the work arounds that I had to use. hth. B. On Fri, Sep 5, 2008 at 10:05 AM, allandt bik-elliott (thefieldcomic.com) [EMAIL PROTECTED] wrote: Hi guys I'm in AS2 and trying to create a textfield, embed fonts in and apply a stylesheet - if i use embedfonts it doesn't render but if i omit it, everything renders fine (but the fonts aren't embedded so won't render properly elsewhere) i can't see what's going wrong - could you take a look please? private function setupCopy():Void { _tfMoreText = _mcPanelViewer.createTextField(_tfMoreText, _mcPanelViewer.getNextHighestDepth(), _nTypeStartX, _nTypeStartY, _nPanelTotalWidth, 30); //_tfMoreText.embedFonts = true; // making the text disappear _tfMoreText.html = true; _tfMoreText.styleSheet = _cssStyles; _tfMoreText.selectable = true; _tfMoreText.border= true; _tfMoreText.borderColor = 0x99; _tfMoreText.htmlText = _sMoreText; trace(_tfMoreText.htmlText); // traces 'p class=bodyTextspan class=whiteMy text/span/p' } fonts are fun thanks guys a ___ 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] fun with embedFonts - NOT
I would guess embedding fonts off screen in a text field will be 'slightly' more kb as you are loading a text field that is loaded but not used AND embedding the font; whereas in the first case you are just embedding the font in the library. But we are taking a very small difference for sure. allandt bik-elliott wrote: that's awesome guys - thanks for the tips are there any file size issues with linking the font from the library as opposed to having a text field off screen? a On 5 Sep 2008, at 19:27, sebastian wrote: nice tip, but it's not absolutely necessary to get them to work, though it may be 'faster' than trying to do it the 'right' way [whatever that means, fonts are really precarious]. Bob Wohl wrote: Hello, Have you tried to place a text field off screen/stage and embed the font family (each style needs to be embeded in it's own text field - bold, italic etc) that you are trying to use. I remember there being some buggy-ness when trying to embed in AS2 and that was one of the work arounds that I had to use. hth. B. On Fri, Sep 5, 2008 at 10:05 AM, allandt bik-elliott (thefieldcomic.com) [EMAIL PROTECTED] wrote: Hi guys I'm in AS2 and trying to create a textfield, embed fonts in and apply a stylesheet - if i use embedfonts it doesn't render but if i omit it, everything renders fine (but the fonts aren't embedded so won't render properly elsewhere) i can't see what's going wrong - could you take a look please? private function setupCopy():Void { _tfMoreText = _mcPanelViewer.createTextField(_tfMoreText, _mcPanelViewer.getNextHighestDepth(), _nTypeStartX, _nTypeStartY, _nPanelTotalWidth, 30); //_tfMoreText.embedFonts = true; // making the text disappear _tfMoreText.html = true; _tfMoreText.styleSheet = _cssStyles; _tfMoreText.selectable = true; _tfMoreText.border= true; _tfMoreText.borderColor = 0x99; _tfMoreText.htmlText = _sMoreText; trace(_tfMoreText.htmlText); // traces 'p class=bodyTextspan class=whiteMy text/span/p' } fonts are fun thanks guys a ___ 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 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] getURL and ExternalInterface
in AS2 externalinterface is your friend and it works PERFECT with swfaddress and swfobject. There are some strange issues with IE though, so make sure you test well on that platform. read this for more information and a working example on all OS/platform combos I know of: http://blog.intuitymedialab.eu/2007/07/13/actionscript-javascript-communication-externalinterface/ seb. Hans Wichman wrote: Hi, I read somewhere that using getUrl for javascript calls while using externalinterface at the same time will lead to problems (eg when using swfaddress). Can anyone tell me if opening an url through getUrl will cause these problems as well, or just javascript? Any work arounds? What is the exact nature of the problem? As2 btw! regards, Hans ___ 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] Flashcoders archive
not only do i get the same issue, but all the links are 'broken' failed to connect and private archive not found are the errors I get. :( Juan Delgado wrote: Hi Dave list, I'm trying to workout if one of my messages made it to Flashcoders, but i'm having problems accessing the archive. Starting from here: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders I end up in the login form: http://chattyfig.figleaf.com/mailman/private/flashcoders/ But after successful login I get the Flashnewbie archive event though the URL clearly displays flashcoders. Is this intended? Is the archive somewhere else? Cheers! Juan ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders