Re: [Flashcoders] Calling class function from xml object in a class onLoad
Den 4. feb. 2006 kl. 12.45 Peter Måseide wrote: ... , but I don´t want to do it properly. That came out the opposite of what I really ment.. :) Do anybody have any suggestions for the problem? Peter Peter Måseide - [EMAIL PROTECTED] - Mob 40858675 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] UGENT -- using variable in absolute path --Deserate!
_root[tempUSname].text = _global.c1schoolName; good luck. On 04/02/06, dls [EMAIL PROTECTED] wrote: Sorry for the urgency, but I have a morning deadline today. Have a series of dynamic textfield on my stage named: usName1 , usName2, etc. I am trying to populate specific fields with some text. I am trying to choose which field is populated dynamically. (I have hard coded the _root.currentNameNumber for the example below) _global.c1schoolName = Fenwick; _root.currentNameNumber = 1; _root.tempUSname = usName+currentNameNumber; trying to dynamically choose the text field usName1 this is where it breaks! _root.tempUSname.text = _global.c1schoolName; If I hard code the text box name it works OK _root.usName1.text = _global.c1schoolName; ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Yotam Laufer | Flash Developer | mobile +44 (0) 79 205 17 212 | skype: ubermutt ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] UGENT -- using variable in absolute path --Deserate!
Thank you! Is this similar to the eval function? --dan _root[tempUSname].text = _global.c1schoolName; good luck. On 04/02/06, dls [EMAIL PROTECTED] wrote: Sorry for the urgency, but I have a morning deadline today. Have a series of dynamic textfield on my stage named: usName1 , usName2, etc. I am trying to populate specific fields with some text. I am trying to choose which field is populated dynamically. (I have hard coded the _root.currentNameNumber for the example below) _global.c1schoolName = Fenwick; _root.currentNameNumber = 1; _root.tempUSname = usName+currentNameNumber; trying to dynamically choose the text field usName1 this is where it breaks! _root.tempUSname.text = _global.c1schoolName; If I hard code the text box name it works OK _root.usName1.text = _global.c1schoolName; ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Yotam Laufer | Flash Developer | mobile +44 (0) 79 205 17 212 | skype: ubermutt ___ 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] UGENT -- using variable in absolute path --Deserate!
yes, it evaluates the expression within the brackets. On 04/02/06, dls [EMAIL PROTECTED] wrote: Thank you! Is this similar to the eval function? --dan _root[tempUSname].text = _global.c1schoolName; good luck. On 04/02/06, dls [EMAIL PROTECTED] wrote: Sorry for the urgency, but I have a morning deadline today. Have a series of dynamic textfield on my stage named: usName1 , usName2, etc. I am trying to populate specific fields with some text. I am trying to choose which field is populated dynamically. (I have hard coded the _root.currentNameNumber for the example below) _global.c1schoolName = Fenwick; _root.currentNameNumber = 1; _root.tempUSname = usName+currentNameNumber; trying to dynamically choose the text field usName1 this is where it breaks! _root.tempUSname.text = _global.c1schoolName; If I hard code the text box name it works OK _root.usName1.text = _global.c1schoolName; ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Yotam Laufer | Flash Developer | mobile +44 (0) 79 205 17 212 | skype: ubermutt ___ 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 -- Yotam Laufer | Flash Developer | mobile +44 (0) 79 205 17 212 | skype: ubermutt ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] How do you code your Flash applications?
getNextHighestDepth()+10*152/36%23*Math.random()*362; LOL ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Any one can explain about Flash media server
You can have a look at these samples here, they might be inspiring for your application. http://www.macromedia.com/devnet/flashmediaserver/sample_apps.html You should also have a look at the tutorials and info in macromedia's site which are pretty good. Daniel On 2/4/06, hidayath q [EMAIL PROTECTED] wrote: Hi guyz, I want to know about the Flash media server and how to create and small application using it. S.Hidayath ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] haXe Beta 1 Release
Hi lists, I'm pleased to announce the first Beta release of haXe available now on http://haxe.org haXe is a new programming language that can be used for Flash development but also ServerSide and JavaScript development. Some haXe features that you might like : * haXe is available for Flash Players 6-7-8. It will support also Flash 8.5 in the near future, bringing you Flash newest feature without needing to learn a new language everytime. * haXe is very conservative about Flash API. You can use all the Flash API like you were used to do in ActionScript. * porting your code from AS2 to haXe is very easy, and you should notice additional performances when running it. * haXe have automatic Delegate creation. That means that you don’t need to worry about which context your methods will be executed in. * haXe has a Flexible Type System. It’s not dynamicly typed since we want to be able to scale easily and let the compiler do a lot of checks when we modify the source. It’s not staticly typed either and you don’t have to type every variable you’re using. haXe Beta 1 should work very well for Flash development, and will even improve in the upcoming weeks. You can visit now the haXe website on http://haxe.org Best, Nicolas Motion-Twin ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] if not working. (urgent help again?)
Don't know what's up, but the following if statement doesn't work... both variables trace to be 5. both values were loaded from an xml document and assigned variable names. if(_root.c7parent == _root.c3id){ //do something } oddly, if I use the following code it works!!??? could this be some sort of data type problem? if(_root.c7parent != _root.c3id){ //do something } Thanks in advance ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
working with numbers loaded from XML was [Flashcoders] if not working. (urgent help again?)
I am really stumped and desperate here! seem to be having trouble working with variables brought in from XML the value of the variables are numeric. when I reference them in code for comparison, they don't seem to work example _root.first traces to show 5 _root.second traces to show 5 if (_root.first != _root.second) { do something }; should fail, but seems to behave as if true I'm thinking it's a problem with referencing the xml object instead of a numerical value, but I'm at my wits end here. --dan ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: working with numbers loaded from XML was [Flashcoders] if not working. (urgent help again?)
It is hard to see how they are brought in from XML in your code extract. Have you run the text through parseInt to convert them from strings to numbers? Ron dls wrote: I am really stumped and desperate here! seem to be having trouble working with variables brought in from XML the value of the variables are numeric. when I reference them in code for comparison, they don't seem to work example _root.first traces to show 5 _root.second traces to show 5 if (_root.first != _root.second) { do something }; should fail, but seems to behave as if true I'm thinking it's a problem with referencing the xml object instead of a numerical value, but I'm at my wits end here. --dan ___ 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: working with numbers loaded from XML was [Flashcoders] if not working.(urgent help again?)
Everything brought in via xml is considered to be a String by Flash. When you parse the xml you need to cast the values as the correct data type, or use something like parseInt() to convert a string to a numeric value. Brooks ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] How to alter all movieClips with as2
? On 2/2/06, kevin kroe [EMAIL PROTECTED] wrote: i tought about it, but if i do it, all movieClips on Stage will have this property? I think doing it, this property will apear only when i do some:someObj = new someObj(), am i wrong? On 2/2/06, Mike Britton [EMAIL PROTECTED] wrote: class someObj extends MovieClip { public var someProperty:String; function someObj() {} } ___ 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: working with numbers loaded from XML was [Flashcoders] if not working. (urgent help again?)
Rob, First, Thanks for your help! I haven't used parseInt before, I'll start hunting for info on it right away. Anything you could share would be appreciated! When I publish and use List Variables in the Debug menu the variables brought in from xml show up as objects, not values. my use of the XML object is shown below. Please forgive my ignorance, --dan var myXML = new XML(); myXML.onLoad = processXML; myXML.ignoreWhite = true; myXML.load(school_list.xml); function processXML(success) { if (success == true) { _root.first = myXML.firstChild.childNodes[0].childNodes[0].childNodes[0]; _root.second = myXML.firstChild.childNodes[1].childNodes[0].childNodes[0]; _root.gotoAndPlay(map); } } stop(); It is hard to see how they are brought in from XML in your code extract. Have you run the text through parseInt to convert them from strings to numbers? Ron dls wrote: I am really stumped and desperate here! seem to be having trouble working with variables brought in from XML the value of the variables are numeric. when I reference them in code for comparison, they don't seem to work example _root.first traces to show 5 _root.second traces to show 5 if (_root.first != _root.second) { do something }; should fail, but seems to behave as if true I'm thinking it's a problem with referencing the xml object instead of a numerical value, but I'm at my wits end here. --dan ___ 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] using MCL to keep track of total bytes loaded.
hi. i have a question on using the MovieClipLoader class to load an array of swf files. i just want to add the loadedBytes of each swf to another variable so i can constantly compare the loaded to the total of all swf files. in the end, i need to figure out the percentage of the total swfs combined weight is loaded. i've started off a little here but am not sure how to compare the values or if i'm adding it correctly. can anyone see if i'm approaching this correctly so far? here's my code: // An array that holds the paths to external swf files. var mainSwfArray:Array = new Array( { path: one.swf, id: one_mc, depth: 6 }, { path: two.swf, id: two_mc, depth: 8 }, { path: three.swf, id: three_mc, depth: 18 }, { path: four.swf, id: four_mc, depth: 16 }, { path: five.swf, id: five_mc, depth: 14 }, { path: six.swf, id: six_mc, depth: 12 }, { path: seven.swf, id: seven_mc, depth: 10 } ); var totalWeight:Number = 5677376; // the total weight of the swf files in the mainSwfArray (in bytes). var loadedWeight:Number = 0; // we'll add to this variable as the movies get loaded. var mainMCL = new MovieClipLoader(); var mainMclListener = new Object(); mainMCL.addListener( mainMclListener ); // onLoadProgress() mainMclListener.onLoadProgress = function( targetMC, loadedBytes, totalBytes) { loadedWeight += loadedBytes; // then do a test to find out the percentage loadedWeight is of totalWeight. i need to know when it's reached 10%, 20%, 30%, etc... } thanks. -- matt. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: working with numbers loaded from XML was [Flashcoders] if not working. (urgent help again?)
Would this be a correct use of parseInt? parseInt (_root.first) would parseXML parse all of the XML at one time? --dan ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: working with numbers loaded from XML was [Flashcoders] if notworking. (urgent help again?)
Would this be a correct use of parseInt? parseInt (_root.first) Yes, but it's usually a best idea to pass the number base as a parameter - in this case, 10 for decimal var xx = parseInt (_root.first, 10); If you don't, it will still work, but if you have some number with trailing zeros like 071 on the string it'll think they're octal numbers (on this example, converting it to 57 instead of yhe expected 71). - zeh ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] using MCL to keep track of total bytes loaded.
No, you will have problems with that implementation. You can't just add loadedBytes to your total. Say you are loading just one movie clip, you start off with zero, then 10 bytes come in, so loadedWeight is now 10. Next, 10 more come in so loadedBytes reports 20, which is added to your total, leaving loadedWeight at 30, which is incorrect. Instead, you can have a function that loops through each movie clip to test for loadedBytes. mainMclListener.onLoadProgress = function( targetMC, loadedBytes, totalBytes) { var totalBytes:Number = 0; var numClips:Number = mainSWFArray.length; for (var i:Number = 0; i numClips; i++) { totalBytes += baseTimeline [mainSWFArray.id].getBytesLoaded(); } // then do a test to find out the percentage loadedWeight is of totalWeight. i need to know when it's reached 10%, 20%, 30%, etc... } The baseTimeline reference should be replaced with a reference pointing to the parent movie clip. This is a bit inefficient, though. If you want, I can show you a more efficient way of doing it using a single setInterval() call. Nathan http://www.nathanderksen.com On Feb 4, 2006, at 9:26 AM, Matt Ganz wrote: hi. i have a question on using the MovieClipLoader class to load an array of swf files. i just want to add the loadedBytes of each swf to another variable so i can constantly compare the loaded to the total of all swf files. in the end, i need to figure out the percentage of the total swfs combined weight is loaded. i've started off a little here but am not sure how to compare the values or if i'm adding it correctly. can anyone see if i'm approaching this correctly so far? here's my code: // An array that holds the paths to external swf files. var mainSwfArray:Array = new Array( { path: one.swf, id: one_mc, depth: 6 }, { path: two.swf, id: two_mc, depth: 8 }, { path: three.swf, id: three_mc, depth: 18 }, { path: four.swf, id: four_mc, depth: 16 }, { path: five.swf, id: five_mc, depth: 14 }, { path: six.swf, id: six_mc, depth: 12 }, { path: seven.swf, id: seven_mc, depth: 10 } ); var totalWeight:Number = 5677376; // the total weight of the swf files in the mainSwfArray (in bytes). var loadedWeight:Number = 0; // we'll add to this variable as the movies get loaded. var mainMCL = new MovieClipLoader(); var mainMclListener = new Object(); mainMCL.addListener( mainMclListener ); // onLoadProgress() mainMclListener.onLoadProgress = function( targetMC, loadedBytes, totalBytes) { loadedWeight += loadedBytes; // then do a test to find out the percentage loadedWeight is of totalWeight. i need to know when it's reached 10%, 20%, 30%, etc... } thanks. -- matt. ___ 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: working with numbers loaded from XML was [Flashcoders] if notworking. (urgent help again?)
Thank You, Everyone--- WORKING LIKE A CHARM! Now get away from your computers and go have a great Saturday! Would this be a correct use of parseInt? parseInt (_root.first) Yes, but it's usually a best idea to pass the number base as a parameter - in this case, 10 for decimal var xx = parseInt (_root.first, 10); If you don't, it will still work, but if you have some number with trailing zeros like 071 on the string it'll think they're octal numbers (on this example, converting it to 57 instead of yhe expected 71). - zeh ___ 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] How do you code your Flash applications?
The whole idea is that you keep things at *predictable*, and whenever possible explicitly defined, depths so that things are easy to manage. If you need getNextHighestDepth, that means you don't know what the current highest depth being used is, and that means you aren't in control of the z-depth of your objects. That's a bad thing. Yes, keep things predictable, and easy to manage. There are only two reasons you need control over the z-depth of your display object: 1) to visually layer your objects for appropiate overlapping of the items relative to each other. (usually after you z-position your objects to begin with you don't touch them again except in the case of floating windows or similar, which requires a 'put me on top' behavior) 2) to keep from accidently removing a display object through duplicate depths. I've also always had to know exactly what depths my display objects were, as I am generally more of the control friek. But I realized that I also lay out a lot of my visual elements in the Flash IDE and never seemed to care about the actual depth # in that setting. It was enough to know how everything was z-ordered the way I wanted in relationship to each other. I finally made my own DepthManager, which provides for extreme depths for cursors and tool-tips like MM's vs2 components, but without screwing up getNextHighestDepth() for those who would still use it. ( API: MovieClip.bringToFront(); MovieClip.bringForward(); MovieClip.sendBackward(); MovieClip.sendToBack(); where MovieClip.bringForward(); MovieClip.sendBackward(); can have one parameter, either of type MovieClip or type Number MovieClip: brings the calling MC directly in front of the argument MC, or sends directly behind Number: brings or sends calling MC forward or backward x number of steps. In the case of a 0, bringForward(0) would bring the MC to the front, sendBackward(0) to the back. In the case of a negative number, bringForward(-2) would bring the MC to the front minus two, or 3rd from the top of the visual stacking order. this provides for complete control in arranging visual objects in any order, relative to each other by name and/or by stacking order. I've never needed to know or care about keeping track of depth numbers since, though that doesn't mean I don't keep track of z-order (relational). And frankly I don't have the time or patience anymore to always be managing depth details when there's so much more to worry about. I would hate having all of my classes cluttered with two properties for every one visual object. private var vScroll:ScrollBar; private var vScrollDepth:Number; I'll try and get my code cleaned up a bit (I've been bad and not fully commented the class) for anyone interested. It will still allow you to set depths explicitly, as well as a padding that is currently at 2 or 3, but could be changed to 10. To be honest, I haven't yet found an instance where I've needed the depth number explicitly, but it's available. This and other classes that simplify implementation are one of the best ways to keep your code clean. Tyler ps oops, didn't realize I wrote so much. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] using MCL to keep track of total bytes loaded.
No, you will have problems with that implementation. True. To make it work, just change up a few things: mainMclListener.onLoadProgress = function( targetMC, loadedBytes, totalBytes) { // loadedWeight will increment only once per MC, after it is fully loaded // currentLoaded will tell us the loadedWeight from previous SWFs combined with this ones progress var currentLoaded = loadedWeight + loadedBytes; // then do a test to find out the percentage currentLoaded is of totalWeight. i need to know when it's reached 10%, 20%, 30%, etc... } mainMcListener.onLoadComplete = function( targetMC ) { var progress = mainMcListener.getProgress( targetMC ); loadedWeight += progress.bytesTotal; } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] How to alter all movieClips with as2
? hmmm, we all seem to be speaking in short half sentences, or punctuation. The prototype property is fully accessible in AS2, and because of general shortcommings in Flash. (MovieClips, for example, are a cross-breed of the common prototype-based class and a sprite of magic underscored properties carried over from the ver beginnings of Flash) Macromedia uses the prototype for their vs 2 components' DepthManager class: function DepthManager() { MovieClip.prototype.createClassChildAtDepth = createClassChildAtDepth; MovieClip.prototype.createChildAtDepth = createChildAtDepth; ... _global.ASSetPropFlags(MovieClip.prototype, createClassChildAtDepth,1); _global.ASSetPropFlags(MovieClip.prototype, createChildAtDepth,1); ... I suggest using it sparingly. Make sure adding it to the prototype is the only thing that makes sense. This because it's always hard to track down bugs added to the prototype when they could have been added from anywhere. Tyler ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] How to alter all movieClips with as2
The prototype property is fully accessible in AS2, and because of general shortcommings in Flash. uh, it might help to finish my own sentences. correction: ...and because of general shortcomings in Flash it is sometimes necessary, even if not recomended. ...continue Tyler ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Grab GPS to XML to Flash
Is there any commercial software out there that can grab GPS coordinates from within a Pocket PC and create an XML file that can be read by Flash? Thanks. Stephen ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders