Re: [Flashcoders] How to expand import * statements?
FlashDevelop does that for you in AS2 (and I think AS3, I just haven't gotten to play with that yet). I've pretty much stopped writing imports manually. :) -Andy On Mon, Mar 24, 2008 at 10:21 AM, Merrill, Jason [EMAIL PROTECTED] wrote: FWIW, (just noticed you said AS 2.0... the following only works in AS3 in Flex2/3 ) in Flexbuilder if you type in a dummy var statement: private var b:MyClassIAmUsing (where the class name auto-completes) it will automatically add the import statement if you haven't already. I use this technique a lot to ease my laziness - saves me from figuring out the exact path. If you need to, after the class import statement is inserted , you can delete the var statement. Jason Merrill Bank of America GTO and Risk LLD Solutions Design Development eTools Multimedia Bank of America Flash Platform Developer Community Are you a Bank of America associate interested in innovative learning ideas and technologies? Check out our internal GTO Innovative Learning Blog subscribe. ___ 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] clean scripting
Here's my understanding of the reason behind this: AS2 is basically just syntactic sugar over AS1, and gets compiled down to the same thing. When defining a class you're actually defining things on the prototype, so doing this: -- class MyClass { public var myArray:Array; public function MyClass() { myArray = []; } public function push(o:Object):Void { myArray.push(o); } } -- would be the same as: -- MyClass = function() { this.myArray = []; } MyClass.prototype.push = function(o) { this.myArray.push(o); } -- If you set the value of the member variable at declaration: -- public var myArray:Array = new Array(); -- It turns into this: -- MyClass.prototype.myArray = new Array(); -- Since you have just assigned an array instance to the prototype of the class, that gets shared between all instances of the class (basically, the value you set there is the initial value given to the myArray member of the class on instantiation). Well, assuming my understanding is correct. :) -Andy On Wed, Mar 12, 2008 at 2:02 PM, Dave Mennenoh [EMAIL PROTECTED] wrote: So yea...WTF? I can't believe after my years of AS2 coding that it would have taken me this long to notice. I think I muttered those exact words. Bizzare behavior. Though I don't think I have ever run into it. Someone taught me long ago not to initialize class variables in their definitions. So I just never have done that. Really good to know though. Dave - Head Developer http://www.blurredistinction.com Adobe Community Expert http://www.adobe.com/communities/experts/ ___ 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] Flash is full of surprises. I will show you how to move movie-clip using a reference to another deleted clip.
So, the case he brought up was different from what you said. In your case you're creating differently named movie clips, and explicitly assigning them to the mc variable. In the original code, a new movie clip was attached with the same name, but NOT assigned to the variable. After doing so you would expect the variable to not work, but it ended up pointing to the new clip. -Andy On Mon, Mar 10, 2008 at 4:27 PM, Glen Pike [EMAIL PROTECTED] wrote: Sorry if I am speaking out of turn, but isn't this point a bit moot (redundant)? How else would you expect to be able to attach movieclips and manipulate them in a loop as you would normally? e.g. function doClips() { var mc:MovieClip; for(var i = 0;i 10;i++) { mc = attachMovie(star, star_mc_ + i, getNextHighestDepth()); //mc.removeClip(); mx._x = 100 * i; } //would expect to manipulate the last one. mc._y = 100; } doClips(); //compile error, but would not work anyway. mc._y = 200; //would work. star_mc_9._y = 200; I bet the reference goes out of scope once you exit the function you are in? If not, then that maybe a bug. Glen Andy Herrman wrote: So you're saying variables like mc are effectively pointers? Well crap. I thought I didn't have to worry about pointers when I wasn't working in C... :) (I say after just debugging some really weird memory issue in C++ code...) -Andy On Mon, Mar 10, 2008 at 4:08 AM, strk [EMAIL PROTECTED] wrote: On Sun, Mar 09, 2008 at 06:50:58PM +0300, Pavel Empty wrote: //Create a clip from the library and store its reference to mc variable. var mc:MovieClip = _root.attachMovie(Star, star_mc, _root.getNextHighestDepth()); 'mc' is a soft reference to the Star instance. //Destroy the clip mc.removeMovieClip(); 'mc' becomes a dangling reference, which means it'll be looking for a substitute with same target name when dereferenced. //Create another star clip once again with the same name star_mc //Notice that I do not assign the clip reference to mc variable. _root.attachMovie(Star, star_mc, _root.getNextHighestDepth()); //And now I move mc. It references the first clip, which was destroyed. //I expect nothing to happen, but... mc._x = 100; The second clip moves! That is, the second clip was referenced using mc. Dereferencing 'mc' here yelds the new Star insatnce, having the same target path as the original one. --strk; ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Glen Pike 01736 759321 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Flash is full of surprises. I will show you how to move movie-clip using a reference to another deleted clip.
So you're saying variables like mc are effectively pointers? Well crap. I thought I didn't have to worry about pointers when I wasn't working in C... :) (I say after just debugging some really weird memory issue in C++ code...) -Andy On Mon, Mar 10, 2008 at 4:08 AM, strk [EMAIL PROTECTED] wrote: On Sun, Mar 09, 2008 at 06:50:58PM +0300, Pavel Empty wrote: //Create a clip from the library and store its reference to mc variable. var mc:MovieClip = _root.attachMovie(Star, star_mc, _root.getNextHighestDepth()); 'mc' is a soft reference to the Star instance. //Destroy the clip mc.removeMovieClip(); 'mc' becomes a dangling reference, which means it'll be looking for a substitute with same target name when dereferenced. //Create another star clip once again with the same name star_mc //Notice that I do not assign the clip reference to mc variable. _root.attachMovie(Star, star_mc, _root.getNextHighestDepth()); //And now I move mc. It references the first clip, which was destroyed. //I expect nothing to happen, but... mc._x = 100; The second clip moves! That is, the second clip was referenced using mc. Dereferencing 'mc' here yelds the new Star insatnce, having the same target path as the original one. --strk; ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Anyone know of good mac app that will trace outside of Flash
I've been using Alcon: http://osflash.org/projects/alcon It's lighter weight and much simpler than xray and has been quite useful. You can run it from the provided exe or from the SWF. The SWF should work fine on the Mac. -Andy On Feb 7, 2008 7:07 AM, Sidney de Koning [EMAIL PROTECTED] wrote: Hi Ali, I use XRAY from Blitz (http://osflash.org/xray) its is a very good debug / logger tool. and it just uses a SWF that you run. Cheers, Sid Alistair Colling wrote: Oops, sorry pressed send too quick on that one, here's the complete message Hiya, I have been using XTrace (http://mabblog.com/xtrace.html) and it is a great application as it allows me to view my trace messages with different colours outside of the Flash IDE. My problem is that after a short while the window disappears so I can't reference my trace messages while I edit my code in Textmate. Does anyone know of another tracing app that would float above all apps as XTrace does and woul allow me to look over trace messages in this way? Cheers! Ali ___ 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] DataGrid: Extra Row
You say your loop is going the correct amount of times, but have you checked the array? Try looping over the array and tracing all the elements (along with the length of the array). Does what you get match what you expect? -Andy On Feb 5, 2008 11:45 AM, Lehr, Theodore M (N-SGIS) [EMAIL PROTECTED] wrote: I am populating a datagrid via: data_array = new Array(); for (j=0; jthis.firstChild.childNodes.length; j++) { var lessonTitle:String = this.firstChild.childNodes[j].childNodes[0].firstChild.nodeValue; var desc:String = this.firstChild.childNodes[j].childNodes[1].firstChild.nodeValue; data_array.push({AvailableLessons:lessonTitle, Description:desc}); } dg.dataProvider = data_array; The loop is looping the correct amount of times but my grid is ending up with an extra empty row. Any ideas why? Ted ___ 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 to call class method from a movieclip?
If you want your contentMC class to be able to call methods on your myClass then you should probably pass the myClass instance to the contentMC. Basically, add a parameter to contentMC's constructor of type myClass, and pass a reference to 'this' when you create it. Something like this: public class myClass extends Sprite{ public function myClass() { var contentMCs:MovieClip; = new contentMC(this); } public function myMethod(){ } } On an unrelated note: standard practice has class names start with a capital letter, not lowercase like you have. It helps to differentiate between variable names and class names. -Andy On Jan 30, 2008 8:42 AM, Irene Johansson [EMAIL PROTECTED] wrote: Hello! I am having a big problem, hope someone can help me. I have made a class which i import in my flash file. The first and only frame of the file looks like this: import myClassFolder.*; var myClassInstance:myClass = new myClass(this.stage); stop(); Inside the class i am attaching a movieClip from a library and declaring a methof: public class myClass extends Sprite{ var contentMCs:MovieClip = new contentMC(); ... } public function myMethod(){ } The contentMC contains 8 frames, each of the frame has a movieClip. In the frame 2 of the contentMC MovieClip i want to call myMethod of the myClass. Anyone who know how to do this? Thanks in advance Irene ___ 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] buttons lined up next to each other- rollout not work
Try using a variable local to the for loop for the target: //this also sets the event handling in one shot for (i=0; i5; i++) { clipName = this[clip+i]; var myTarget= _root[text+i] trace(target); clipName.onRollOver = function() { Tweener.addTween(this.person,{_alpha:100, delay:0, time:2}); Tweener.addTween(this.whiteborder,{_alpha:100, delay:0, time:2}); Tweener.addTween(myTarget,{_alpha:100, delay:0, time:2}); trace(onrollover+myTarget); }; clipName.onRollOut = function() { Tweener.addTween(this.person,{_alpha:30, delay:0, time:1}); Tweener.addTween(this.whiteborder,{_alpha:0, delay:0, time:1}); Tweener.addTween(myTarget,{_alpha:0, delay:0, time:2}); }; } My guess is target is declared outside the for loop, so you're having some problems with closure. I don't know if AS's closure works the same way as C#'s, but if it does then this could be the problem. This article is specific to C#, but it does a good job of going over how closures and anonymous methods work, and might be helpful to understand this (assuming I'm right in that AS's behavior matches C#'s for closure) http://www.theserverside.net/tt/articles/showarticle.tss?id=AnonymousMethods search for the Captured local variables and code visibility section for an example of the possible differences between what you have and what I suggested. -Andy On Jan 16, 2008 2:13 AM, Dwayne Neckles [EMAIL PROTECTED] wrote: OK on rollover the correponding text clip fades in on rollout it fades out.. during debuging.. all of the targets are text4 and it shouldnt be.. clip0 should control text0 and etc.. but what happens is that clip0 to clip4 controls text4... which is wrong, any suggestions? Code below: //this also sets the event handling in one shot for (i=0; i5; i++) { clipName = this[clip+i]; target= _root[text+i] trace(target); clipName.onRollOver = function() { Tweener.addTween(this.person,{_alpha:100, delay:0, time:2}); Tweener.addTween(this.whiteborder,{_alpha:100, delay:0, time:2}); Tweener.addTween(target,{_alpha:100, delay:0, time:2}); trace(onrollover+target); }; clipName.onRollOut = function() { Tweener.addTween(this.person,{_alpha:30, delay:0, time:1}); Tweener.addTween(this.whiteborder,{_alpha:0, delay:0, time:1}); Tweener.addTween(target,{_alpha:0, delay:0, time:2}); }; } Date: Tue, 15 Jan 2008 21:32:41 -0800 To: flashcoders@chattyfig.figleaf.com From: [EMAIL PROTECTED] Subject: Re: [Flashcoders] buttons lined up next to each other- rollout not work No such problem here with either adjacent or overlapping buttons. Please post your code. Here's mine for four buttons named btn1, btn2, etc.: for (i = 1; i 5; i++) { this[btn + i].onRollOut = function() { trace(this._name); }; } Marc At 09:06 PM 1/15/2008, you wrote: This is probably a classic issue.. I have 5 buttons lined up next to each with no space between but they arent overlapping. I have rollover and rollout events.. but the rollout event doesnt work when i roll over to the next button.. the onrollout event works only when i rollout on to negative space..which sucks is there a workaround ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders _ Share life as it happens with the new Windows Live. http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008___ 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] Classes added
So then it is safe to do import flash.display.*; Only if you're not going to run into any naming conflicts. I generally find it's better to only import the classes you're going to use, for a couple reasons. 1) It reduces the chance of naming conflicts (like two packages having Button classes in them). The only time you'll have to deal with naming conflicts here is if you actually need to use classes with the same name from two different packages. If you import the entire packages there's a higher chance of conflict. 2) It makes it much easier to tell, at a glance, what a class depends on. This can be beneficial in many cases. -Andy On Jan 15, 2008 11:52 AM, Helmut Granda [EMAIL PROTECTED] wrote: nothing will actually be added; Sprite is an intrinsic class, importing it merely works as typing and as a definition for compilation (the class is already in the player so it's not added to the SWF). So then it is safe to do import flash.display.*; and not to worry about bundling up the SWF eh? var mySprite:Sprite = new Sprite; and //notice the end () var mySprite:Sprite = new Sprite(); I tried to google it but didnt know exactly how to find it.. The first one is slightly uncommon, but both do the same thing. Zeh Thanks Zeh, that is what I thought but I wasn't sure. specially when I instantiate my Classes there was no difference on the way I was using them, of course unless I needed to pass some parameters. ___ 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] extends implements
I normally just declare the extends, as the docs for the base class would already show that it fits the interface. However, in my AS2 code (I'm also working in java, C#, and C++ right now) I've started declaring the interfaces as well. The reason I started doing that is that the documentation generator I'm using (as2api) doesn't seem to properly inherit the documentation from the interface unless I explicitly declare it. -Andy On Jan 10, 2008 3:11 AM, Hans Wichman [EMAIL PROTECTED] wrote: Hi folks, I was wondering about your personal/professional preference regarding the following. Say you have an interface IEvent and a base class Event which implements IEvent. Now you are creating an event subclass MyEvent which can: - implement IEvent - extend Event - both In other words, would you when choosing to extend Event still declare it as an implementation of IEvent for the sake of readability: class MyEvent extends Event implements IEvent OR simply class MyEvent extends Event I see pro's and con's to the both of them, but I guess I'm looking to see if there is some sort of 'why declaring blablahb is evil'. I guess I'm used to adding the implements clause as well, since it allows me to change the superclass and testing whether I still adhere to the required interface by compiling that class instead of compiling any source that uses it. In addition I hope it prevents people from declaring variables like var a:Event instead var a:IEvent... tnx in advance. JC ___ 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] Reliable way to split a string into an array of lines?
The fastest (execution, not writing) way would probably be to do your own loop over the string and find all the positions of line breaks (either \r or \n) and use just use substring to pull out the individual lines. If you do end up trying RegExes I'd be very interested in how you do it. The only regex library I've found for AS2 doesn't compile with MTASC (looking at the code I don't know why anything would compile it), which is causing me significant annoyance. If you find one that works with MTASC I'd love to know about it. :) -Andy On 9/12/07, Danny Kodicek [EMAIL PROTECTED] wrote: I'm looking for a simple, reliable method for splitting a string into its constituent lines (at the hard line breaks - this isn't a text wrapping thing). The problem is that line breaks could be Chr(10) or Chr(13), or indeed both. I've done this: myArr = myStr.split(String.fromCharCode(10)).join(String.fromCharCode(13)).split(Str ing.fromCharCode(13)) I'm guessing I'm better off going the RegEx route, but I was wondering if there's a quicker, simpler way. 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] What would cause this...
Just as a sanity check, are you sure your handlers for those other events are set up properly? Could you post the code? It might be easier to tell what's wrong if we can see it. -Andy On 9/12/07, Max Kaufmann [EMAIL PROTECTED] wrote: I'm downloading a SWF using the Loader class. It dispatches open and progress events, and gets to a point where the bytesTotal == bytesLoaded, however it never actually gets gets the content and it never dispatches complete, init, or any of the error events. Anyone else encountered this problem? max ___ 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] toString(aArray[i]) ?? does this work
Ah, since the local scope is the object in the array then just using `toString()` without any arguments would work (just doing `this.toString()` basically). Can you provide the code where you populate the array? It's possible you're adding something other than the movie clips to the array (or maybe some type info is being lost). I'm actually not sure how the `i` variable is handled in this case. If you're always getting 126 then Flash might be keeping a reference to the variable and evaluating it when the function runs, instead of evaluating it when creating the function. This might be how things work, I really don't know. A different way to handle it would be to do this: aArray[i].myArrayIndex = i; aArray[i].onPress = function() { ... } and then within the function use `this.myArrayIndex` instead of `i`. This way you're storing the index for the object within the object itself, so you can query it whenever you want without worrying about the scope chain. One other thing, just as a sanity check. You said you did this: setInterval(rollOvers,10); //calls function 100/second to If that's the actual code then you're going to have problems. That will run your rollOvers function every 10 milliseconds. You probably only want it run once (no point in changing the onPress functions when they've already been assigned). You're going to want to store the interval's ID and then clear it: var rollOversInterval:Number = setINterval(rollOvers, 10); function rollOvers() { clearInterval(rollOversInterval); /* rest of the function */ } If for some reason you do need to update the onPress functions you should really only do it when an event occurs that would require it, instead of constantly doing so. -Andy On 9/11/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Andy, I see what you are saying, I think. That the .toString() has to be used as a method directly being addressed by the object. Like I said that what I think you are saying. How ever it seems I still can not get the string myMCinArray1 or myMCinArray2 or myMCinArray3 etc when I use the toString on an array Element. By the way, the scope in this case is actually the Array lement(MovieClip) -see coded snippet setInterval(rollOvers,10); //calls function 100/second to function rollOvers(){ for (i=0; iaArray.length; i++) { aArray[i].onPress = function() { var myStr:String = aArray[i].toString(); //* THIS LINE trace(myStr);// still traces [object object] trace(i); //gives me 126 .which is the array length. if I could get this to give me the value of the Array element clicked I would fine too. }; } } Again any follow up on this post would be appreciated. Paul V. - Original Message - From: Andy Herrman [EMAIL PROTECTED] To: [EMAIL PROTECTED]; flashcoders@chattyfig.figleaf.com Sent: Tuesday, September 11, 2007 12:00 PM Subject: Re: [Flashcoders] toString(aArray[i]) ?? does this work I think what you really want is this: var myStr:String = aArray[i].toString(); I don't know of any global toString() function. What's probably happening is that you're doing the equivalent of `this.toString(aArray[i])`. The scope object's toString function ignores all arguments and gives you the string representation of itself (which will be what you said you're seeing unless it has a custom toString() implementation). -Andy On 9/10/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Quick question, can I toString an array element. ie: var myStr:String = toString(aArray[i]);// where 'i' is the increment. I am having an issue with this. when I trace myStr it traces [object object] instead of what I intended/expected mcMovieClipName14 as a string. Any insite would be appreciated. Thanks in advance, Paul V. ___ 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] toString(aArray[i]) ?? does this work
You say [object Object] is the correct output if the object is a movie clip. This isn't the behavior I see. Any time I trace a movie clip I get the clip's name (level0.foo.bar.whatever), not the generic object results. -Andy On 9/11/07, Hal Leonard [EMAIL PROTECTED] wrote: Try toString(aArray[i]._name) instead I'm not 100% sure what you're storing in your array, but it sounds like you're storing movieClip objects in there, in which case the result [object Object] would be the correct output. Hal -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Monday, September 10, 2007 8:30 PM To: Flash Coders Subject: [Flashcoders] toString(aArray[i]) ?? does this work Quick question, can I toString an array element. ie: var myStr:String = toString(aArray[i]);// where 'i' is the increment. I am having an issue with this. when I trace myStr it traces [object object] instead of what I intended/expected mcMovieClipName14 as a string. Any insite would be appreciated. Thanks in advance, Paul V. ___ 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] How to share class library across a network?
Try mapping the network share to a drive letter (I'm assuming you're in Windows here). Some tools don't work well with network paths, but if you map the shared folder to a drive letter then it would appear to those tools as a local path. That might help fix your compile errors. -Andy On 9/11/07, Alistair Colling [EMAIL PROTECTED] wrote: Hi there, I would like to share my class library with other developers on my local network. We are soon to be using Version Cue or something similar but in the meantime it would be good if we could al be working from the same class library (there are only 2 of us). Almost every time we exchange a file lots of compiler errors are thrown up even though the class paths are set correctly, this is usually rectified after restarting the computer or Flash. I have copied my class library to a network share but when I compile a SWF from Flash I get lots of compiler errors starting with line 6 of toplevel.as 'The class or interface 'Boolean' could not be loaded' 'The class or interface 'Object' could not be loaded' 'The class or interface 'Number' could not be loaded' If I point my class path (set in my AS preferences for the Flash app) to an exact copy of the same folder but on my local drive everything works fine! If someone could help me out here I would be really grateful, this is proving a real headache! Cheers, Ali ___ 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] Displaying Progress of calls to external scripts
Is it possible the server that's providing the XML isn't providing the content length in the response headers? Without this Flash won't know what the total size is, which could explain why you're getting 0. -Andy On 9/11/07, Paul Steven [EMAIL PROTECTED] wrote: I am calling several external scripts in my app using the URLLoader. These calls return xml data. I am trying to display the progress of the data flow using the event.Progress as follows but I am not getting very good results. It is currently displaying the following. Loaded: 349 Total: 0 Percent Infinity Perhaps this is not possible? _loader.addEventListener(ProgressEvent.PROGRESS, handleProgress); var request:URLRequest = new URLRequest(scriptPath); request.method = URLRequestMethod.POST; var variables:URLVariables = new URLVariables(); variables.xml = dataToSend; request.data = variables; _loader.load(request); private function handleProgress(event:ProgressEvent):void { var percent:Number = Math.round(event.bytesLoaded / event.bytesTotal * 100); _sessionInstance.progressTxt = Loaded: + event.bytesLoaded + \n + Total: + event.bytesTotal + \n + Percent + percent; } ___ 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] Traversing through Object goes backwards
Objects work pretty much like hashtables (from my understanding). Hashtables generally don't guarantee any kind of ordering. Flash may enforce some kind of ordering (y seems to be going in reverse order of when things were added) but I don't know of any ordering and generally treat it as arbitrary. Now, if you were using Arrays then your ordering would be guaranteed (for-in loops go backwards through the array I believe). -Andy On 9/11/07, Mendelsohn, Michael [EMAIL PROTECTED] wrote: Hi list... I want object y, below, to output in the same order as x. Is it possible? Thanks, - Michael M. x = {a:first, b:second, c:third}; for (i in x) { trace(i + : + x[i]); } /* output: a: first b: second c: third */ y = new Object(); y[a] = first; y[b] = second; y[c] = third; for (i in y) { trace(i + : + y[i]); } /* output: c: third b: second a: first */ ___ 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] state array for combo box?
state array? I'm not sure what you mean. -Andy On 9/9/07, Corban Baxter [EMAIL PROTECTED] wrote: anyone have a simple state array for a combox i could steal? :) thanks! -- -cb ___ 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] Function call from a function
You're having scope issues. When the onRelease function is called its scope is the movie clip (closer_mc), not the class. Try this: At the top of your class' file: import mx.utils.Delegate; Then define the onRelease function this way: target_mc.closer_mc.onRelease = Delegate.create(this, removeMC); The Delegate will cause the removeMC function to be called with the class as scope (or whatever object you put as the first argument to create). -Andy On 9/7/07, Lee Marshall [EMAIL PROTECTED] wrote: I have created a Class that has 2 functions within it Function 1 loads a movie clip Function 2 removes the movieclip I have a button setup in function 1 that reads like this: target_mc.closer_mc.onRelease = function() removeMC(); }; Of which contains a removeMovieClip(); Except it doesn't does anybody have any advice on calling functions from within a function? Many thanks ___ 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] Can't access
My guess is that your this variable is getting mixed up. I'm not familiar with the Delegate.function usage, but that function may be being called with a scope you're not expecting. Try just using a regular function there. You've already set up the 'ref' member of the 'swfListen' object, so 'this.ref' should give you what you want. -Andy On 9/6/07, Lee Marshall [EMAIL PROTECTED] wrote: I am trying to construct a class that loads in an external SWF. I have a movieclip in the external SWF called 'closer_mc' which I cannot get access to. I keep getting undefined in my output. Can anyone suggest anything? Cheers Code: class PopupIll { //Initialise variables public var t:MovieClip; public var a:MovieClip; public var closer_mc:MovieClip; public var popX:Number; public var popY:Number; public var popMovie:String; //Constructor function public function PopupIll(movieName:String, target:MovieClip, newX:Number, newY:Number, depth:Number, a:MovieClip) { t = target; t._x = newX; t._y = newY; var swfListen:Object = new Object(); swfListen.ref = t; swfListen.ref2 = t.closer_mc; //Create listener object var swfMCLoader:MovieClipLoader = new MovieClipLoader(); //Create MovieClipLoader swfListen.onLoadError = function(target_mc:MovieClip, errorCode:String, status:Number) { trace(Error loading image: +errorCode); }; swfListen.onLoadStart = function(target_mc:MovieClip):Void { //trace(onLoadStart: + target_mc); }; swfListen.onLoadProgress = function(target_mc:MovieClip, numBytesLoaded:Number, numBytesTotal:Number):Void { var numPercentLoaded:Number = numBytesLoaded/numBytesTotal*100; //trace(onLoadProgress: + target_mc + is + numPercentLoaded + % loaded); }; swfListen.onLoadComplete = Delegate.function(target_mc:MovieClip, status:Number):Void { //trace(onLoadComplete: + target_mc); //swfMCLoader.unloadClip(illHolder_mc); trace(this.ref.closer_mc); this.ref.closer_mc._x = 100; this.ref.closer_mc.onRelease = function() { this.ref.removeMovieClip(); }; //swfMCLoader.removeListener(swfListen); }; swfMCLoader.addListener(swfListen); swfMCLoader.loadClip(movieName,t); } } Lee Marshall. Senior Media Designer/Developer Transart Educational Marketing Systems Clare Hall Parsons Green St Ives Business Park St Ives Cambridgeshire PE27 4WY Tel Direct Dial: +44(0)1480 499213 Tel General Enquiries: +44(0)1480 499200 Fax: +44(0)1480 499201 email: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] web: www.transart.co.uk http://www.transart.co.uk/ Confidentiality notice: Please note that the information contained herein is highly confidential and may also be privileged and is for the named recipient(s) only, on no account should any part or details be disclosed to any third party without the prior written consent of Transart. In the event that you are not the intended recipient then please delete it and any copies that you have made and contact me on the above number. General statement: Any statements made, or intentions expressed in this communication may not necessarily reflect the view of Transart. Be advised that no content herein may be held binding upon Transart or any associated company unless confirmed by the issuance of a formal contractual document or purchase order. ___ 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] Strange FMS application initialization problem
Our production servers have run into a strange problem initializing application instances and I'm wondering if anyone else has seen it (I couldn't find any mention of it online, but my google skills aren't the best). Sometimes when an application is initializing and loading its dependent files we get the following error in the logs: Sending error message: Unknown exception. - At this point all the loading stops and the application starts. Since the required files weren't loaded the application breaks in various ways (lots of reference errors for things not being defined). Sometimes we've seen this happen before any of our files have been loaded, sometimes after one or two of them are loaded (our application has a large number of files). I can't find anything online, and haven't had any luck reproducing it consistently. Has anyone seen this before? Any idea what could be causing it? -Andy ___ 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] FMS2 Installation Failure
Hmm, the only problem I remember having when installing was windows firewall blocking the ports, but it sounds like you already disabled that. Are you sure you have the hostname and application names correct in the test app you're using? -Andy On 9/3/07, Daniel Calderón [EMAIL PROTECTED] wrote: Hello to everyone I have installed FMS2, Flash 8; Flash Player and plug in as said as installation guide. After installation, I ran an example showns in Examples found in Adobe, posted to practice for developers. I cant run the examples, and shows an error NetConnection.connect.failure. I believe that I installed in the correct way the FMS2 software, and I cant find why is that error. PD: I have been installed the software FMS2 in other PC and ran perfectly, but in my personal PC shows the failure. Another thing in that I desactivate the windows firewall. Could anyone help me in this matter? I want to try this software but I cant run properly!! Thanks for your time Daniel C. _ News, entertainment and everything you care about at Live.com. Get it now! http://www.live.com/getstarted.aspx___ 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] Iterator question
Why not use a hashtable instead of an array? Give your elements all unique IDs (you could even just do an incrementing integer). A hashtable would give you faster lookup (don't have to iterate over the array searching for it) and you can remove hashtable entries without messing up any kind of ordering. -Andy On 8/27/07, dr.ache [EMAIL PROTECTED] wrote: hi. dont delete the elements from your array. when you call page.destroy() method generate another array in which you push a true, whenever onElementKilled is called.Check also, if the array contains as much elements as your children array contains. If true, delete the whole array with childs. possible? dr.ache Jiri Heitlager | dadata.org schrieb: Hello list, i have a page object that contains has a Array that holds pageElements. This is a storage for elements with an iPageElement interface. The page object has an destroy() method. When page.destroy() is called, it will loop trough the page.pageElements Array using an iterator. Every iPageElement broadcasts an onElementKilled message when is has been destroyed. When a pageElement broadcast this message, the page need to continue in deleting the next element in the page.pageElement Array. The callback method onElementKilled in the page instance, searches for the element that has been deleted and then removes it from the page.pageElements Array. This is where i think a problem rises, because if the page.pageElements array is updated during the process, the index does not match the element to remove anymore. How can I solve this potential risk? Another question, the array that is passes into the iterator is a reference to the pageElements Array. Does this mean, that if I delete an element from this array from within the iterator, the page.pageElements array is modified? I hope my question is clear.. thank you in advance. Jiri Below a snippet: private function getPageElementIterator() : Void { return new PageElementIterator(this.pageElements) } //initiated the deleting proces, by starting with the first element. public function destroyPageElements() : Void { destroyElement(this.pageElements[0]); } private function destroyElement(element:iPageElement) : Void { curElement.addEventListener('onElementKilled' , this) curElement.destroy(); } private function onElementKilled(eventObj:Object) : Void { var killElement:iPageElement = eventObj.target; var iter:PageElementIterator = this.getPageElementIterator(); while(iter.hasNext()){ var curElement:iPage = iPage (iter.next()); if(killElement == curElement) { //deleted the element now clear the listener and continue killElement.removeEventListener('onElementKilled' , this) /* * POTENTIAL RISK, if a new element is added, then the index, does not match the right element anymore * * get the current index from the deleted element by checking what * the currentIndex of the iterator is, and remove it from this.pageElements Array */ this.pageElements = this.pageElements.splice((iter.getCurrentIndex() , 0) //get the next element in the iterator array if(iter.hasNext()) this.destroyElement( iPage(iter.next()) ); delete killedElement; break; } } } if(this.pageElements.length == 0){ trace('all page elements have been removed') } } ___ 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] Real Player 11 messing up Flash application UI
Just ran into another issue, and this one is actively breaking things, not just causing UI annoyances. RP11 seems to be doing something to prevent LocalConnections from being cleaned up. Our application uses a couple SWFs for the UI, using LocalConnections to communicate between them. One of these SWFs gets reloaded sometimes (the frame it's in can be navigated away from at times). Normally everything works fine because the unloading of the SWF when the page changes cleans up the LocalConnections. However, with RP11 installed the cleanup doesn't seem to happen. The first time the SWF loads it works fine, but every time after that it fails to open the LocalConnection, completely breaking the application. I submitted this issue using their feedback form, but I don't know if anything will come of it. -Andy On 8/20/07, Troy Rollins [EMAIL PROTECTED] wrote: On Aug 20, 2007, at 2:58 PM, Andy Herrman wrote: I haven't been able to find any documentation about how they're detecting it. Anyone played around with this yet? Are there any known methods to prevent that toolbar from appearing? This is hideously bad news. Adobe should fire up the legal department and chase Real off the planet. I'm sure they could come up with some kind of grounds. Or maybe we could start a class action suit for breaking our content. -- Troy RPSystems, Ltd. http://www.rpsystems.net ___ 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] Real Player 11 messing up Flash application UI
I created a new page on the osflash wiki for documenting RP11 issues. If anyone finds any new ones please add them there. Hopefully having a central place to document the problems we find will increase the chances of Real doing something about them. http://osflash.org/flashcoders/realplayer_bugs -Andy On 8/23/07, Andy Herrman [EMAIL PROTECTED] wrote: Just ran into another issue, and this one is actively breaking things, not just causing UI annoyances. RP11 seems to be doing something to prevent LocalConnections from being cleaned up. Our application uses a couple SWFs for the UI, using LocalConnections to communicate between them. One of these SWFs gets reloaded sometimes (the frame it's in can be navigated away from at times). Normally everything works fine because the unloading of the SWF when the page changes cleans up the LocalConnections. However, with RP11 installed the cleanup doesn't seem to happen. The first time the SWF loads it works fine, but every time after that it fails to open the LocalConnection, completely breaking the application. I submitted this issue using their feedback form, but I don't know if anything will come of it. -Andy On 8/20/07, Troy Rollins [EMAIL PROTECTED] wrote: On Aug 20, 2007, at 2:58 PM, Andy Herrman wrote: I haven't been able to find any documentation about how they're detecting it. Anyone played around with this yet? Are there any known methods to prevent that toolbar from appearing? This is hideously bad news. Adobe should fire up the legal department and chase Real off the planet. I'm sure they could come up with some kind of grounds. Or maybe we could start a class action suit for breaking our content. -- Troy RPSystems, Ltd. http://www.rpsystems.net ___ 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] Intro to OOP using ActionScript: patterns derail!
The fancy names are kind of useful actually. Most of the patterns I've learned but I didn't know the fancy/official names for them. This caused some confusion when talking with my coworker as he would be simply using the names instead of the concepts and I'd have to stop and figure out which one he meant, or I'd spend extra time explaining what I was talking about when I could have just said the name and been done with it. The names are useful as a common/shared way of referencing complex concepts. That said, the concepts are much more important than the names, as you can get by just fine with only the concepts, but fail miserably on with just the names. :) -Andy On 8/22/07, Ron Wheeler [EMAIL PROTECTED] wrote: Dave Mennenoh wrote: How do you handle onLoad's famous scope? ... It is not magic or advanced. If a pattern was shown to a new programmer without giving it a fancy name, they would just accept it as the best way to do the task and would never give it moment's thought. Right. Delegate - ie Proxy. I agree. I wasn't saying patterns shouldn't be taught, or used - I doubt you could teach a Flash class these days without teaching Observer, but you might not ever call it that. In fact, I wonder who does call it that in a class? Actually, the more I think about it, I think for students it might be best not to call these patterns and just teach them. Then, once they know how to use them, tell them what they are. It's a bit like teaching encapsulation I think - if you just show your students how to write classes, and they see how classes work for organizing code, they will likely just use them. That is what I have been saying from the start of this discussion. You do not have to teach the fancy names. Just teach them to use proper coding practices. OOP and Design Patterns are just names that we use to group a bunch of best practices into theories so we can discuss the theory and have a framework to critique code. I have a feeling that for most of us, the word polymorphism is not much of a help and I see no reason to even use the word on 14 year olds until the last week of class and only then as a warning that someday someone might try to use it on them in a discussion about design. Ron Dave - Head Developer http://www.blurredistinction.com Adobe Community Expert http://www.adobe.com/communities/experts/ ___ 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] flash media server2 installation query
Check to make sure the windows firewall isn't blocking connections to FMS. I had that problem when I first installed it on my machine. -Andy On 8/20/07, Jeff Harrington [EMAIL PROTECTED] wrote: You should definitely read the docs, but here it is quick. You don't need Apache or IIS - it's a standalone media server. You make an application - say call it - myApp in the applications folder. Then your flvs go into applications/myapp/streams/video/myFlv.flv The URL will be: rtsp://localhost:1935/myApp/video/myFlv Use the MediaServer Control swf to monitor connections etc... and read the manual and check out the example code. Jeff http://jeffharrington.org creativity wrote: Hi, i was just trying to use flash media server on windowsxp machine without IIS but with apache. I have installed windows version of flash media server2. I also downloded sample files and followed instructions, but video is not playing. whether i need to use linux version or is there a simple way to check flash media server is working properly. What will be the path for video if mediaserver is installed in macromedia folder under program files. ___ 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] Real Player 11 messing up Flash application UI
For those who don't know, Real Player 11 (in beta right now) added a feature that lets users download videos embedded in flash applications (like youtube, google video, etc). It does this by adding an entry to Flash's rightclick menu and by having a mini-toolbar appear at the top left of the flash movie when it loads and when the mouse goes over the movie. Does anyone know what method it uses to determine if a SWF is used to play a video? It seems to think that our Flash application serves video even though it doesn't, and the toolbar thingy they're adding is showing up over par of the UI and could confuse users. I haven't been able to find any documentation about how they're detecting it. Anyone played around with this yet? Are there any known methods to prevent that toolbar from appearing? ___ 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] Classes 101 [was: Version control and Flash ]
The reason I don't like extending MovieClip is that it gives the user of my classes too much control over the internals of my class. Specifically, if I'm wrapping MovieClip I'm generally creating something with a lot of special behavior, which sometimes causes restrictions on things like position and size. If I extend MovieClip then all the built in MovieClip functions and properties are user-visible, so there's really nothing stopping someone from just doing myClass._width, etc. By using Composition I can restrict the public API to my class to exactly those methods I want exposed. All the extra internal state that MovieClip makes visible is no longer visible to the user of my class. Now granted, if I'm the only one using my classes then you could argue that there's really no difference, as I should just stick to using the functions. However, I like to code defensively and assume that, at some point, others will be using/modifying my code. Using Composition makes it much easier to do that. -Andy On 8/13/07, Michael Trim [EMAIL PROTECTED] wrote: Not all classes have to extend MovieClip (in fact, most shouldn't, and some would argue none should). Just as an aside, I'd be interested to hear why some would argue that you should never extend MovieClip? (Surely you have to for the Document class) or is this a higher level theoretical argument? ___ 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] fms application class
Your syntax looks fine. What do you mean by it isn't recognized as a method? -Andy On 8/8/07, [p e r c e p t i c o n] [EMAIL PROTECTED] wrote: Hi folks, i know htis isn't the fms list, but can anyone tell how to define a method in the asc file... for example i tried to define a method like this application.helloServer = function() { trace(hello from server); } but it isn't recognized as a method... i'm trying to not have to define it on the client side as a member of the NetConnection object... thanks 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] fms application class
The only way for a client to call a method is for that method to exist on the Client's object. That's just the way the Flash RPC stuff works. You can either add it to the Client prototype (which I don't like) or add it to the client object after they connect (my preferred way). For instance: application.onConnect = function(oClient, oParams) { this.acceptConnection(oClient); oClient.helloServer = function() { trace(Hello Server); }; } Or, you can get fancy and do some delegate-style work so that your actual function is defined on application (or some other object): application.helloServer = function() { trace(Hello Server); } application.onConnect = function(oClient, oParams) { this.acceptConnection(oClient); oClient.oScope = this; oClient.helloServer = function() { this.oScope.helloServer.apply(this.oScope, arguments); }; } The reason you're getting an error about the function not existing is that it doesn't. When the client makes a call the server looks for a function of the given name on the client's object. If it doesn't exist you get an error. I hope that helps! -Andy On 8/8/07, [p e r c e p t i c o n] [EMAIL PROTECTED] wrote: hi Andy, the server logs indicate that the method isn't defined... however if i define it using Client.helloServer = function() it seems to work, but my concern is that this isn't really remote...i want the client to call the application's method thanks p On 8/8/07, Andy Herrman [EMAIL PROTECTED] wrote: Your syntax looks fine. What do you mean by it isn't recognized as a method? -Andy On 8/8/07, [p e r c e p t i c o n] [EMAIL PROTECTED] wrote: Hi folks, i know htis isn't the fms list, but can anyone tell how to define a method in the asc file... for example i tried to define a method like this application.helloServer = function() { trace(hello from server); } but it isn't recognized as a method... i'm trying to not have to define it on the client side as a member of the NetConnection object... thanks 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 ___ 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] garbage collection and asychronous execution
Which is probably a good argument for always using the other form of setInterval: setInterval(this, test, 1000); I assume in this case the object wouldn't be garbage collected because setInterval's internals now has a reference to it. -Andy On 8/6/07, Mark Winterhalder [EMAIL PROTECTED] wrote: On 8/6/07, Mark Hawley [EMAIL PROTECTED] wrote: That isn't a reference to a function -- it's a reference to a object method. The object has to hang around. No, it's a reference to a function. The VM doesn't know anything about methods. The interval keeps a reference to the function, the object gets garbage collected, then the function gets called. It doesn't need an object. In fact, if you'd add a trace( this ), it would be undefined. Mark ___ 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] Prevent flash from caching the loaded assets
Yes, the SWF would be easy to decompile, but I think as soon as you start worrying about someone decompiling the SWF to cheat you're pretty much out of luck, as they can always decompile your game's SWF instead and find out everything there is to know about the game. That would probably give them a lot more options for cheating. :) If you want to go the AMFPHP route (which I'm not familiar with at all) and sending a large array is having problems, why not split it up? Send a couple smaller arrays and then combine them on the client side. -Andy On 8/6/07, Niels Endlich [EMAIL PROTECTED] wrote: It seems to me that the swf is easy to decompile and the photo also... We were working on sending an array with amfphp which contains the pixel information and use BitmapData setPixel to plot the image. But it seems that AMFPHP isn't able to send such a large array (800x600pix). Has anyone done somthing like this before? -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens eric e. dolecki Verzonden: maandag 6 augustus 2007 20:51 Aan: flashcoders@chattyfig.figleaf.com Onderwerp: Re: [Flashcoders] Prevent flash from caching the loaded assets http://foo.domain.com/images/imageContainer.swf?e=; + getDate() all images could be in 1 swf and called out. On 8/6/07, Ian Thomas [EMAIL PROTECTED] wrote: That's a wonderfully neat idea. :-D Ian On 8/6/07, Jack Doyle [EMAIL PROTECTED] wrote: If you're able to store the images in SWF format instead of something like JPG, you could set up your SWFs so that they're covered with a black rectangle MovieClip by default and then you flip the _visible property to false in your application when you load them in. That way, if people try to look at the SWF from the browser's cache, they'll just see a big black rectangle but within your app, the photo is visible. Just a thought. Jack ___ 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@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] stage.stageWidth annoyance
I can't speak to AS3, but in AS2 I have to do an interval which constantly checks the stage width. Initially it's the size given at build time, then it switches to 0, then some time later it switches to the actual size. I have all my initialization wait until I see the size set to something other than 0 or 1 (I set everything to 1x1 at build time so I can detect it). I'd hope it's better in AS3, but maybe not. -Andy On 8/7/07, mario gonzalez [EMAIL PROTECTED] wrote: Anyone??? Is using timeout for this just standard practice? mario gonzalez wrote: When I compile the SWF (flash 9 / as3.0) I have a function which uses stage.stageWidth to create a grid. For the children of any object, I of course use Event.ADDED_TO_STAGE to avoid getting a null reference to stage. However this is for my document class. The hacky work around that I have is to put the function on a timeout. I feel like this shouldn't have to be done, and there must be some way of getting the right dimensions of the stage from flash on creation. Does this happen to other people? ___ 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] Prevent flash from caching the loaded assets
I think the caching is controlled by the browser, not Flash itself, so I don't believe there's a way within flash to prevent caching. Maybe you could do some trickery with the images that makes it harder for the person looking at the cached stuff to see it. Like, split up the main image into multiple ones and maybe apply some transformations to the images, and then have the flash movie undo the transformations and compose the images back into the main one? -Andy On 8/6/07, Niels Endlich [EMAIL PROTECTED] wrote: We are making a game in which people have to quess what's on a photo while viewing it through a little moveable hole. The images will be loaded from the server. The problem is caching. To cheat is easy... watch the cached files. Is there a way to prevent flash from caching the loaded assets or does anyone has an other solution? Thanks, Niels ___ 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] Q: loop speed AS2 and AS3
Wow. I know Flash 9 was faster than 8, but I didn't realize it was that big a difference. Anyone know what the difference is in image processing speed? I've been looking at porting an application we have to Flash that does a bunch of image processing (needs to be able to download raw image data at runtime, decompress it and then render it) but from what I heard from other Flash users Flash 7/8 isn't fast enough to handle that. -Andy On 7/27/07, greg h [EMAIL PROTECTED] wrote: Hi moveup, Here is pretty much a repeat on my response when you asked this same question back on 12/22/06 here on this list ;-) Loops and then some ... Props to Mike Lyda for running the following tests over time (and to JD for originally bringing it to my attention.) Mike Lyda runs performance tests across various engineshttp://oddhammer.com/actionscriptperformance/(JavaScript vs. ActionScript vs Java) November 24, 2006 Flash ActionScript performance vs JavaScript (includes Flash Player 9) http://oddhammer.com/actionscriptperformance/set4/ JD on EP May 22, 2006 AS3 performance tests http://weblogs.macromedia.com/jd/archives/2006/05/as3_performance.cfm (Note: Mike subsequently updated the tests with the GA version of Flash Player 9 on November 24, 2006) Beyond, raw comparisons, last month Adobe Flex PM Matt Chotin presented on ActionScript 3 Performance tips. Slides and Code here: ActionScript 3 Performance http://weblogs.macromedia.com/mchotin/archives/2007/06/slides_and_samp.cfm Ted Patrick presented on the same last year at MAX. This google search surfaces stuff on Ted's site regarding performance: http://www.google.com/search?q=site%3Aonflex.org%20performancehttp://www.google.com/search?q=site%253Aonflex.org%2520performance hth, g ___ 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] Backend compiled Java or scripted PHP?
I haven't done any work in PHP so I can't really comment on its usefulness, but I've found doing web stuff in Java isn't particularly hard. There are a number of possibilities for doing Java work on the server that makes it easier too. We use Apache Tomcat here. It handles all the HTTP handling and such and makes things pretty easy, and we do some very complex processing. However, as others have mentioned, if you're just doing simple processing tasks then it's most likely overkill. As far as building up a skillet, I think Java is more generally useful (you'll be doing server work but the skills you learn can be applied to client code as well, and even embedded stuff to some extent, though I haven't done any of that). PHP, on the other hand, tends to be more limited in where it's used (from my understanding). -Andy On 7/19/07, Joshua Sera [EMAIL PROTECTED] wrote: You have to worry much less about Memory leaks, and syntactically, the language is simpler than C++, so saying that it's become more complicated than C++ is total bull. Still, they're just different beasts. I'd rather write most web apps in PHP, but you could never write your own server in PHP either. PHP is really just about doing things with HTML. The filesystem, image manipulation, and other functions are secondary to that. Java is meant for applications, which means that you can make it mangle HTML, but it takes longer. You could never write a server in PHP, but if you wanted to throw a simple XML file at a Flash application, Java would be total overkill. --- Weldon MacDonald [EMAIL PROTECTED] wrote: I've been using ActionScript for a while now, but my next project will require a lot more server side work. In the past I've used PHP, but only in a pidgin kind of way. alternatively, I have some Java skills, though not specifically for the web. Either way I have to spend some time developing an appropriate skill level, the question becomes, which skills. The times I've used PHP, it seemed straight forward enough, and from what I've read Java is a little trickier to implement on the web (correct?). On the other hand, PHP is a pretty specific niche whereas Java has a much wider usefulness (correct?) There are a lot of strong opinions out there. Andreessen: PHP succeeding where Java isn't http://news.com.com/2100-1012-5903187.html?tag=tb and in response, How they can compare PHP with Java at all? (most people who are praising PHP are either bad programmers or they are not programmers at all) http://news.com.com/5208-1012_3-0.html?forumID=1threadID=10712messageID=78718start=0 PHP is faster to develop, java is faster to run, or is that runs faster? PHP is harder to maintain, and Java has more tools ...etc... What's a guy to beloieve? Any opin... any more opinions? ___ 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 Get the free Yahoo! toolbar and rest assured with the added security of spyware protection. http://new.toolbar.yahoo.com/toolbar/features/norton/index.php ___ 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] Using createEmptyMovieClip to create MovieClips within MovieClips
I've never seen createEmptyMovieClip or attachMovie take time. I'm pretty sure those are blocking actions, so once it's returned the clip exists. -Andy On 7/16/07, o renken [EMAIL PROTECTED] wrote: theres a little time needed to create the MC..i think thats the reason for your undefined. try to make an interval which checks if your first mc ist created and create the sub-mc then... cheers olee 2007/7/16, John laPlante [EMAIL PROTECTED]: I'm writing a component and have created a MovieClip with createEmptyMovieClip. When I try to create sub-MovieClip inside the first MC with createEmptyMovieClip, it is undefined. This must be a basic Flash thing. I haven't used createEmptyMovieClip too much. I tried private var ItemContainer:MovieClip; private var CContainer:MovieClip; this.createEmptyMovieClip(ItemContainer, this.getNextHighestDepth()); this.ItemContainer.createEmptyMovieClip(CContainer, this.getNextHighestDepth()); When I trace ItemContainer, it comes up as _level0.testDualListJumble.ItemContainer. I tried chaning the parent mc to _level0.testDualListJumble.ItemContainer - _level0.testDualListJumble.ItemContainer.createEmptyMovieClip(CContainer, this.getNextHighestDepth()); ___ 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 -- http://www.renkster.de/#/about/ ___ 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] Question on old AS1 code
The HTTP vs HTTPS stuff should be completely handled by the browser, so I don't think the plugin would have any issues. One thing I find helpful for debugging these kinds of problems is Fiddler (http://www.fiddlertool.com/fiddler/). This will log all requests IE makes and the responses to them. Try installing it, starting it up (it adds a button to the IE toolbar), and then loading your SWF. You'll be able to see what files are being requested. You can see if you're getting 404 errors, or even if they're being requested properly. This might help track down the problem. -Andy On 6/22/07, Vaughn, David (Contractor) (J6B) [EMAIL PROTECTED] wrote: Hello all. This is my first post on the group, but I'm a regular member of the FlashNewbies list. I'm a fairly new Flash developer using Flash 8, web player 9, and IE6. Hopefully the members of this list can offer some guidance with a problem. Background: I've been asked to review some old Flash 5 or 6 code from another developer built in 2001 or early 2002. The code is completely undocumented and the original developer is unavailable. The FLA and AS files load a few external JSP files and produce a detailed graph from those files. On an HTTP server the files work as expected and have been working properly for several years. Problem: Recently the web team moved the files to an HTTPS server. The background graphics load normally but the external data is completely blank. I have access to the FLA and AS files and have reviewed the code. Being a new developer I can't detect any obvious problems with the FLA or AS files. The external data files are referenced by name only, not by an explicit file path. I have been assured by the web team that the necessary files are all present and located within the same folder. Question: Are there any known compatibility or security problems between Flash player 9, AS1 code and using HTTPS servers? Any ideas what might be causing this problem? I do not have direct access to the servers so I cannot give specifics about how the servers are configured, but I can forward questions to the web team. Also, the code is proprietary so unfortunately I'm not able to post or share the actual code. Any suggestions are welcomed and appreciated. Regards, Dave ___ 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] Combo Box Component Errors
I responded to your direct e-mail with a more detailed explanation, but for the benefit of the list: The way to fix this is to either do: this._lockroot = true; at the top of the AS code in the SWF that contains the combo boxes, or do: loadedMovie._lockroot = true; in the loader movie, where loadedMovie is the movie clip that the movie was loaded into. -Andy On 6/21/07, Lord, Susan Ms. (CONTR) [EMAIL PROTECTED] wrote: Hi there, I am having a unique problem using the combo box component. When I run the file on its own, it works great, but when I load the swf into my main file it stops working. Now to eliminate possibilities for other errors I created 2 files to test this and removed all other programming and am still having the same error. Would you mind taking a look and seeing if you can see my error? ** Sorry for the double post newbies.** In the test file, I drug 4 combo box components to the stage and gave them the instance of combo1, combo2, combo3 and combo4. Here is the code in the test file: // Combo Boxes **\\ function change(evt) { trace(evt.target.selectedItem.label); trace(evt.target); for (var i = 1; i=numComboBoxes; i++) { thisComboBox = this[combo+i]; trace('combo'+i+ +thisComboBox.value); } } numComboBoxes = 4; for (var i = 1; i=numComboBoxes; i++) { var thisComboBox = this[combo+i]; dataNum=0; thisComboBox.addItem({data:dataNum++, label:}); thisComboBox.addItem({data:dataNum++, label:aa}); thisComboBox.addItem({data:dataNum++, label:bb}); thisComboBox.addItem({data:dataNum++, label:cc}); thisComboBox.addItem({data:dataNum++, label:dd}); thisComboBox.addItem({data:dataNum++, label:ee}); thisComboBox.addItem({data:dataNum++, label:ff}); thisComboBox.addItem({data:dataNum++, label:gg}); thisComboBox.addItem({data:dataNum++, label:hh}); thisComboBox.addItem({data:dataNum++, label:ii}); thisComboBox.addItem({data:dataNum++, label:jj}); thisComboBox.addItem({data:dataNum++, label:kk}); thisComboBox.addItem({data:dataNum++, label:ll}); thisComboBox.addItem({data:dataNum++, label:mm}); thisComboBox.addEventListener(change, this); thisComboBox.selectedIndex = 0; } ___ Then in a second file I created a loader. Here is the code: stop(); var myLoadedClip_mc:MovieClip =this.createEmptyMovieClip(myLoadedClip_mc, this.getNextHighestDepth) function load(filename:String, target_mc:MovieClip):Void { _loadListener = new Object(); _loadListener.onLoadInit = Delegate.create(this, loadComplete) _fileLoader = new MovieClipLoader(); _fileLoader.addListener(_loadListener); _fileLoader.loadClip(filename, target_mc); } function loadComplete():Void { trace(the clip is now loaded and on timeline as:+myLoadedClip_mc) } movie = testCombo.swf load(movie, myLoadedClip_mc) ___ I am having the same issue. It works by itself, but not in the loader. Any ideas? I am stumped! Thanks! Susan ___ 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] Whats the best way to communicate with the serverside?
It really depends on what kind of data you need to pass around. One other option is to have the server be able to receive XML data and respond with other XML data. Flash can generate and parse XML fairly easily. We do something similar to this in our application, where Flash generates an XML document, sends it to the server and then parses the received XML. Take a look at the XML class's sendAndLoad function. -Andy On 6/5/07, Cary Ho [EMAIL PROTECTED] wrote: I had had this question under another topic, but I thought maybe it needed its own appropriate title. Im looking for a free solutions (aside from Flash CS3 itself) what can help me communicate with the server. Im making a client/server type program with my flash as the client. Currently we use Java at the back end, so the Flash program will be put linked into a jsp program. We use a lot of javascript and dwr(Ajax) to do a lot of our web side processing. This is mainly for all the dhtml we use. So I was thinking using the External Interface (which was earlier suggested) to call my DWR functions and just communicate through this mechanism. Is there any other way or possibly a more appropriate way? ___ 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] Strange ComboBox issues when loaded in a child SWF
I have 2 movies. The main movie has all of the code, and the UI resources movie contains all of the assets, with no code and nothing on the stage. When the main movie loads it displays a loading progress bar, creates an empty movie clip and then loads the UI resources SWF into that empty clip. Once the UI resources are downloaded the UI is constructed by the code in the main movie, but doing everything within the clip that contains the UI resources (basically, treating the UI resources clip as the root, so all attachMovie and createEmpty... calls are done on the UI Resources clip, or one of its child clips). One of the reasons we do it this way is that we want to have a little as possible stored in the FLA, as it's a binary file and is a pain to use with source control. The UI resources movie is actually defined in an XML file and we use swfmill to generate the SWF. The XML file is much easier to use with source control as it's plain text (tracking changes is much easier). So the main movie's FLA is almost completely empty. -Andy On 5/31/07, Hans Wichman [EMAIL PROTECTED] wrote: Hi Andy, one more question, do you load in a clip with all the assets and actually construct an interface within that library, OR do you use runtime shared libraries to accomplish this, if and not, why not;). We are running into problems (as described in the previous post) which forces us to move to a single library as well, and I'm still pondering which option to take. greetz JC On 5/31/07, Andy Herrman [EMAIL PROTECTED] wrote: The application I'm working on gets all of its UI resources from a separate SWF. This will allow us to internationalize/brand the UI by simply providing different resource SWFs. Because the UI resources are all in the child movie I have to construct the UI within the movie clips owned by that movie. My testing shows that if the ComboBox (or any other component) is in the main movie's library I can't instantiate it any of these movie clips, so I need to have it contained in the resources clip (I prefer this anyway as it keeps everything in one place). Unfortunately I've been running into some weird issues with ComboBox when doing this. I've found workarounds for all these issues, which I thought others may find useful. I'm also interested to know if other people have run into them and how they solved them. The first bug I ran into was that the combo box would never open. Originally I set _lockroot to true on the movie clip that contained the combo box. However, in this case the dropdown would always open down, even if there wasn't enough room in the movie to do so (which normally would cause it to open up). I found that doing _lockroot on the UI resources movie fixed this. The second bug I ran into was that a focus rectangle would display around the combo box and the dropdown. This doesn't display when the combo box is simply created in the main movie (which I can't do unfortunately). Also, the focus rectangle for the dropdown does not go away when the dropdown is closed, messing up the UI. The fix I found for this was to do the following, where cbx is the ComboBox: cbx.drawFocus = null; cbx.dropdown.drawFocus = null; The last issue was a fun one. If there were enough entries in the combo box to require scrolling, clicking on the arrows in the scrollbar or dragging the scroll thingy would cause the dropdown to close (it closed on the release of the mouse). This only seems to happen when the combo box is in a child movie. By digging through the ComboBox code and doing a bunch of tests I determined that the combo box's onKillFocus() function was being called after the mouse was released (this never happened when in the main movie, only when in the child movie). onKillFocus takes a single argument, which I think is a reference to the object that was taking focus. In this case the argument was always the dropdown itself (stored in the combo box as __dropdown). The fix for this is a total hack, but seems to work in Flash 7+ (at least in windows). At the very beginning of the code for the movie I put the following: ComboBox.prototype.onKillFocus = function(n) { if(n == this.__dropdown) { /* Skip */ } else { if(this._showingDropdown n != null) { this.displayDropdown(false); } super.onKillFocus(); } } This overrides the ComboBox function to do what it normally does in all cases except for when the focus is being given to the dropdown. The only thing I've found that this breaks is changing focus using the TAB key. If the combo box is open and you hit the TAB key to change focus to something else then it won't close. This was easily fixed by adding a key listener that closes the combo box when it sees TAB is pressed. Has anyone else run into these things? Any better solutions? Any idea why ComboBox is so broken when used in a child movie (Some
[Flashcoders] Strange ComboBox issues when loaded in a child SWF
The application I'm working on gets all of its UI resources from a separate SWF. This will allow us to internationalize/brand the UI by simply providing different resource SWFs. Because the UI resources are all in the child movie I have to construct the UI within the movie clips owned by that movie. My testing shows that if the ComboBox (or any other component) is in the main movie's library I can't instantiate it any of these movie clips, so I need to have it contained in the resources clip (I prefer this anyway as it keeps everything in one place). Unfortunately I've been running into some weird issues with ComboBox when doing this. I've found workarounds for all these issues, which I thought others may find useful. I'm also interested to know if other people have run into them and how they solved them. The first bug I ran into was that the combo box would never open. Originally I set _lockroot to true on the movie clip that contained the combo box. However, in this case the dropdown would always open down, even if there wasn't enough room in the movie to do so (which normally would cause it to open up). I found that doing _lockroot on the UI resources movie fixed this. The second bug I ran into was that a focus rectangle would display around the combo box and the dropdown. This doesn't display when the combo box is simply created in the main movie (which I can't do unfortunately). Also, the focus rectangle for the dropdown does not go away when the dropdown is closed, messing up the UI. The fix I found for this was to do the following, where cbx is the ComboBox: cbx.drawFocus = null; cbx.dropdown.drawFocus = null; The last issue was a fun one. If there were enough entries in the combo box to require scrolling, clicking on the arrows in the scrollbar or dragging the scroll thingy would cause the dropdown to close (it closed on the release of the mouse). This only seems to happen when the combo box is in a child movie. By digging through the ComboBox code and doing a bunch of tests I determined that the combo box's onKillFocus() function was being called after the mouse was released (this never happened when in the main movie, only when in the child movie). onKillFocus takes a single argument, which I think is a reference to the object that was taking focus. In this case the argument was always the dropdown itself (stored in the combo box as __dropdown). The fix for this is a total hack, but seems to work in Flash 7+ (at least in windows). At the very beginning of the code for the movie I put the following: ComboBox.prototype.onKillFocus = function(n) { if(n == this.__dropdown) { /* Skip */ } else { if(this._showingDropdown n != null) { this.displayDropdown(false); } super.onKillFocus(); } } This overrides the ComboBox function to do what it normally does in all cases except for when the focus is being given to the dropdown. The only thing I've found that this breaks is changing focus using the TAB key. If the combo box is open and you hit the TAB key to change focus to something else then it won't close. This was easily fixed by adding a key listener that closes the combo box when it sees TAB is pressed. Has anyone else run into these things? Any better solutions? Any idea why ComboBox is so broken when used in a child movie (Some of it seems to be related to referencing _root, but not all of it). For reference, here's the code for my test case. This goes into one SWF with an empty library, and it requires a UIResources.swf file that has the ComboBox in its library: import mx.utils.Delegate; import mx.controls.ComboBox; //import net.hiddenresource.util.debug.Debug; class MainImpl { public static function main(root:MovieClip) { ComboBox.prototype.onKillFocus = function(n) { if(n == this.__dropdown) { MainImpl.log(Got onKillFocus for dropdown); } else { if(this._showingDropdown n != null) { this.displayDropdown(false); } super.onKillFocus(); } } if(root == undefined) { root = _root; } var test:MainImpl = new MainImpl(root); } private var uir:MovieClip; private var cbx:ComboBox; public function MainImpl(rootMC:MovieClip) { Stage.scaleMode = noScale; Stage.align = LT; uir = rootMC.createEmptyMovieClip('uir', rootMC.getNextHighestDepth()); var l:Object = new Object(); l.onLoadInit = Delegate.create(this, doTest); l.onLoadError = function(target, ec) { MainImpl.log('Error: ' + ec); }; var mcl:MovieClipLoader = new MovieClipLoader(); var b:Boolean = mcl.addListener(l); mcl.loadClip(UIResources.swf, uir); //doTest(); } private function doTest():Void { log('doTest'); uir._lockroot = true; createUI(uir); } private function createUI(root:MovieClip):Void { root.createClassObject(ComboBox, cbxTest, root.getNextHighestDepth()); cbx =
Re: [Flashcoders] combo box problem
Any chance you're loading child SWFs and then trying to attach the combo boxes there? I'm running into some very strange behavior when doing that (will be posting about it in the next day or so once I narrow it down some more). -Andy On 5/30/07, Carl Welch [EMAIL PROTECTED] wrote: I have the same situation. In mine, I am dynamically generating each screen as the user navigates. It will work on the first screen that a series of comboboxes appear, then on the next screen they show up but don't work. I am completely deleting the movieclip that contains them. Then I build a new MC container each time a user goes to a different screen. I thought I was being safe with that set up. Kinda relieved I'm not the only one that has run into this problem, but its imperative that I fix it. --Carl On 5/30/07, Muzak [EMAIL PROTECTED] wrote: Explain your setup and maybe show us some code. The combobox should just work. - Original Message - From: Randy Tinfow [EMAIL PROTECTED] To: flashcoders@chattyfig.figleaf.com Sent: Wednesday, May 30, 2007 6:29 PM Subject: [Flashcoders] combo box problem We're 6 weeks into our last AS2 project, with about a week left for development. Now we hit what seems like a brick wall. We select an item from the dropdown and it works fine the first time. The second time it works okay. The third time it just stops working. There is apparently a reference in the component to the root timeline that prevents it from operating normally. We've tried _lockroot, we've tried swapping depths of __dropdown every single time you click on the combo box. None of our hacks work. We tried the bjc bitcomponent combobox and it looks horrendous and doesn't seem to fire any of the events, either. Any suggestions? TIA, Randy Tinfow ___ 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 -- Carl Welch http://www.carlwelch.com [EMAIL PROTECTED] 805.403.4819 ___ 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] functions for other classes within a class
Since that function is a class function the compiler assumes it will only be called with that class as the context. Since Controller doesn't have the function then it won't compile. What I would do is this: import mx.utils.Delegate; class com.tequila.canon.PosterArtist.Controller { private var portfolio:MovieClip; public function Controller() { trace(Controller constructor: + this.portfolio); this.portfolio.addEventListener(onClick,this); this.portfolio.onInit = Delegate.create(this, this.portfolioOnInit); } private function portfolioOnInit():Void { trace(onInit: + this); this.portfolio.flipCorner(bottom_right); } } That way your class function is always called with the right context (this value). -andy On 5/25/07, Giles Roadnight [EMAIL PROTECTED] wrote: Hi All I have this code within a class: class com.tequila.canon.PosterArtist.Controller { private var portfolio:MovieClip; public function Controller() { trace(Controller constructor: + this.portfolio); this.portfolio.addEventListener(onClick,this); this.portfolio.onInit = this.portfolioOnInit; } private function portfolioOnInit():Void { trace(onInit: + this); this.flipCorner(bottom_right); } } But I get a compile error saying that flipCorner does not exist. It doesn't exist in COntroller but it does exist in portfolio. How do I get around this? Many Thanks Giles. ___ 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] splitting the list?
I second that suggestion. Gmail is really good for storing mailing lists. My account has this one (fairly high traffic) and a couple gentoo related ones (massively high traffic). Between the two lists I have over 19000 conversations (which can each have a large number of individual mails). Mail.app on the mac and thunderbird had problems dealing with that much stuff if I wanted to search through them, but gmail's search is pretty much instantaneous. I've found it's much faster to just search my e-mail account than to try and search the list archives too. :) -Andy On 5/23/07, Count Schemula [EMAIL PROTECTED] wrote: Consider using a Yahoo! or gmail account specifically for this list. Helps a lot by threading e-mails with the same header and isolates it from your normal or work e-mail account. On 5/16/07, Nimrod Huberman [EMAIL PROTECTED] wrote: This list include very interesting and helpful subjects, but for me its large amount of posts each day make it less useable. Nimrod -- count_schemula ___ 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] splitting the list?
Yea, but the ads are unobtrusive and 90% of the time I don't even notice them. The other 10% are when I look at them just to see what kind of random things are being displayed (I've seen some very strange ads come up and I try to figure out what could have triggered them. It's fun). Forums aren't nearly as convenient. As Ian mentioned, you have to choose to go to them on your own to see what's available. Mailing lists let you keep a central place to go for everything (your mail client of choice). I find mailing lists much more flexible and responsive, as I have full control over how I look at it and I don't have to go out of my way to see if anything has been added to the list. Also, mailing lists feel more like a 'standard' than forums, as they all use the same 'interface', instead of the widely varying software and interfaces for forums. -Andy On 5/24/07, Matthias Dittgen [EMAIL PROTECTED] wrote: Gmail is that good in searching your mails, that it pops up advertising related to the words within your (private) mails! Look at the right side! Yeah! Each of us, who is using Gmail for flashcoders is storing the same information - which is the definition of redundance, isn't it? So, don't get me wrong, I like Flashcoders Mailinglist, because it just works for me, but why do Forums or (Google) Groups not work as well? There are at least two german web forums (flashforum.de and flashhilfe.de), which are highly used, but it can't beat the international discussions of Flashcoders. And: I would also not split Flashcoders.. Matthias 2007/5/24, Andy Herrman [EMAIL PROTECTED]: I second that suggestion. Gmail is really good for storing mailing lists. My account has this one (fairly high traffic) and a couple gentoo related ones (massively high traffic). Between the two lists I have over 19000 conversations (which can each have a large number of individual mails). Mail.app on the mac and thunderbird had problems dealing with that much stuff if I wanted to search through them, but gmail's search is pretty much instantaneous. I've found it's much faster to just search my e-mail account than to try and search the list archives too. :) -Andy On 5/23/07, Count Schemula [EMAIL PROTECTED] wrote: Consider using a Yahoo! or gmail account specifically for this list. Helps a lot by threading e-mails with the same header and isolates it from your normal or work e-mail account. On 5/16/07, Nimrod Huberman [EMAIL PROTECTED] wrote: This list include very interesting and helpful subjects, but for me its large amount of posts each day make it less useable. Nimrod -- count_schemula ___ 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@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] Fwd: Timeline label question
I haven't seen the book so this is completely a guess, but is it possible he wants the actions in frame 1 to happen before the loading display (maybe some pre-loading initialization) but the actions in frame 5 need to happen after the loading display has been shown? -Andy On 5/22/07, Jeff Chadwell [EMAIL PROTECTED] wrote: Hi, I saw something in Colin Moock's book Essential ActionScript 2.0 and I was wondering if someone could explain it. In Chapter 11, he outlines an OOP application framework. In the part where he sets up the timeline in the .fla file, he attaches actions on frames 1, 5 and 15 (these frames are also keyframes). However, the loading label starts on frame 4 so it actually overlaps the actions associated with frame 1. My questions: 1. Why doesn't he start the loading label on frame 5 to correspond to the actions that start on that frame? 2. What is the effect of starting the label on frame 4 instead of frame 5? Jeff Chadwell -- When everyone is against you, it means that you are absolutely wrong-- or absolutely right. -- Albert Guinon ___ 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: SPAM-LOW: Re: [Flashcoders] flash and USB port
That's only true for USB drives. There are plenty of other things that can be plugged into a USB port, like modems, joysticks, missile launchers, etc. -Andy On 5/18/07, Derek Vadneau [EMAIL PROTECTED] wrote: A USB device isn't connected to a port. It is assigned a drive letter and is a removable drive on the computer. You access it like you would access any local resource. You don't need a 3rd party tool to do this, but you do need to be running in the local or trusted sandbox. You can't access a local resource (directly) from a web page. Derek Vadneau Northcode Inc. http://www.northcode.com - Original Message - From: quinrou . To: flashcoders@chattyfig.figleaf.com Sent: Friday, May 18, 2007 1:41 PM Subject: SPAM-LOW: Re: [Flashcoders] flash and USB port Joe, i thought about that I also fund a xtra for doing so too but, i would rather avoid using Director. Pedro, I have been checking out Zinc and it has a COMPort class which I beleive is I/O communication. when I did a quick test to check whether it could detect some USB device, I only got connaction with COM1, COM2 which i beleive are the serial and parallel port, no? Anyone else? ___ 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] Local Connection / Intel Mac bug??
Is your situation the same as Jeff's? Specifically, is one SWF running in Flash 9 natively and the other running in Flash 8 through Rosetta? If so then I doubt they would be able to connect via local connection. My understanding of how Local Connection works is that it uses shared memory (though I could be wrong). This is something that probably can't be done between something running natively and something running through Rosetta, as they would effectively have completely different environments. It would be similar to running one flash movie in windows, then running another one inside another windows running in a Virtual PC instance and expecting them to talk to each other with local connection. True, they're running on the same machine, but their environments are segregated. If both your movies are running in the same environment then I don't know why it wouldn't work. -Andy On 5/16/07, Adam Hoyle [EMAIL PROTECTED] wrote: Hi Jeff, Thanks for responding. Glad for sanity reasons to know that I am not the only person experiencing this. Adam On 16 May 2007, at 14:39, Jeff Gomes wrote: Adam- When one process is running natively (with Flash 9 universal binary player) and the other is running under emulation (with a Flash 8 projector or the Director Flash Asset Xtra), I cannot get it to work either. -Jeff At 05:00 5/16/2007, Adam Hoyle wrote: Hi Flash Coders I am having a problem with local connection communication between an exe and a website, but only on INTEL macs. I have the underscore before the name, but the messages aren't getting through (they do on windows and g4 mac). Interestingly (frustratingly) the second thing to connect to lco doesn't get any onStatus message called either. I have tried removing the underscore and appending the domain and a colon to the beginning, but that also fails on intel mac, but works on windows and g4 mac. Has anyone else come across this bug, or more to the point has anyone got an exe and a swf on a website to talk to one another on an intel mac (g4 works fine, so it's specific to intel macs)? I've noticed that the Luminic Box tracer doesn't work on Intel Macs either, haven't checked xray. Any help/suggestions would be gratefully received, Cheers, Adam ___ 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] animating buttons
I haven't done animations so I can't really help you there, but as for your other question: * what's better practice: creating an emptyclip on the parent outside the class and pass the empty instance in to the constructor, or pass the parent in and let the class create an empty clip if needed? I tend to do both. :) Specifically, I usually have a constructor which takes in the movie clip it should use as its root clip (the empty clip you mention), and then have a static factory method which takes the parent clip, creates an empty clip, and then constructs the class. So, something like: class MyClipWrapper { private var myRoot:MovieClip; function MyClipWrapper(root:MovieClip, ...) { myRoot = root; /* the rest of your initialization */ } public static function createMyClipWrapper(parent:MovieClip, ..., name:String, depth:Number):MyClipWrapper { if(depth == undefined) { depth = root.getNextHighestDepth(); } var empty:MovieClip = parent.createEmptyMovieClip(name, depth); return new MyClipWrapper(empty, ...); } } -Andy On 5/10/07, Hans Wichman [EMAIL PROTECTED] wrote: Hi list, when programming in AS2 i usually favor composition over inheritance, so eg when i have a button i create a class for it passing in a parent container and the class attaches all the objects it needs on the parent and wraps it. However when i want to animate a number of these buttons with respect to eachother in a startup animation for example, the composition thing tends to make things more complicated then necessary. I either need to: * add a getInnerClip to the class so i can get the inner clip and animate it in all kinds of weird ways (violating encapsulation), or * I need to add a lot of movieclips properties/methods to the compositing class (but maybe thats just the way it is), or * put all the animation code within such a class, which doesnt sound that good either I was wondering what approach u guyz ussually take? In addition with respect to the composition thing: * what's better practice: creating an emptyclip on the parent outside the class and pass the empty instance in to the constructor, or pass the parent in and let the class create an empty clip if needed? Im in favor of the first, since it doesnt allow to mess up the parent as much as in the latter option, but again it involves a trade off of control. The specific situation I'm dealing with is a visual object that consist of an alpha shadow on a floor layer and the object causing the shadow on an item layer. Clearly the shadow's and item's movement are related, so I would like to wrap these two items in one class, and then use this single instance in an animation where the whole thing is for example blurred based on its speed. Making any sense? thanks for your ideas! JC ___ 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] 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] Blue effect via scripting
Can you give more specific information on what you're trying to do? What do you mean by blue effect? -Andy On 5/3/07, Prince Zain [EMAIL PROTECTED] wrote: Hi, Do anybody know how to generate blue effect on mouse roll over on movie clip have bitmap image in it via action scripting. I don't want to use one more blue prototype to show this. Waiting for ur reply. Cheers, Xian ___ 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] factory with varying numbers of params
There are two ways I can think of to do this. One would be to have multiple factory functions, one for each type of object you want to create. The other would be to create a simple class (FactoryParams or something like that) which stores all the parameters. You pass that as the parameter object, and you can have that parameter object be strongly typed. class FactoryParams { public var firstParam:String; public var secondParam:Number; public var thirdParam:SomeComplexObject } By using a class instead of a generic object you can keep the type information (and if you use getters/setters instead of public variables then you can even do validation on the values if you want). -Andy On 5/1/07, Listas [EMAIL PROTECTED] wrote: pedr, i would prefer to use the arguments array, instead of an object, but i´m afraid this isn´t strong typed as you wish private function createItem(key:String):Void{ switch(key){ case item_1: var wid_num:Number = arguments[1]; var y_num:Number = arguments[2]; myItem = new Item_1(wid_num, y_num); break case item2: var hei_num:Number = arguments[1]; var color_num:Number = arguments[2]; myItem = new Item_2(hei_num, color_num); break etc... } } Ruy Adorno Hi, A have a Factory that needs to instanciate Objects with differing numbers of parameters (1-4). Is there any way to deal with this situation and maintain strong typing. private function createItem(param_ob:Object, key:String):Void{ switch(key){ case item_1: myItem = new Item_1(param_ob.width, param_ob.y); break case item2: myItem = new Item_2(param_ob.height, param_ob.color); break etc... } } ___ 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] AS2: generating new instances dynamically?
Or have the function return it, which is what it seems like would be the right thing for that method. -Andy On 5/1/07, Ron Wheeler [EMAIL PROTECTED] wrote: I am not sure if you are showing all the code but in your code fragment, newPost is a local variable that will be destroyed as soon as createPost ends. A short and brutal life. It needs to be a class property and you will want to have a getter to access it. Ron sebastian chedal wrote: Hello Flashcoders, Sorry to bother you with another simple AS2 questions, I'm making good progress but I am stumped with one simple thing. I have one class/object that I want to use to generate copies [instances] of another class. The second class is an object in the library with an ID and an assosiated *.as file [in the linkage panel]. The code is: = //PostModel.as import com.blabla.PostView; class com.blabla.PostModel { public function createPost (__id) { var newPost = new PostView (__id); } } = When I run this code, the class doesn't construct an instance... What am I missing? If I need to call the Library Identifyer instead, how would I do that? I don't want to attach the PostView to the PostModel class, I just want to create instances of them and attach them to _root [or some other MC in the timeline]. Thanks!! Seb. ___ 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] Javascript SetVariable -- when does Flash see thechange?
Could you set a watch on the variable? I haven't done it, but my understanding is that you can set a function to be called any time a particular variable is changed. In theory this would let you know when the value was changed by javascript and then you can handle it. http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Partsfile=2592.html -Andy On 4/25/07, John Dowdell [EMAIL PROTECTED] wrote: The browser is a big variable in latency of message-passing. You can confirm that many SWF will run at different rates in different browsers. The NPRuntime API is now implemented pretty well in today's popular browsers, but the size and timing of permissible messages may vary among implementations. http://www.mozilla.org/projects/plugins/npruntime.html In this case, though, it looks like you're using the old javascript: pseudo-URL, and then polling immediately for a result. It may be better to wait a frame or two, or an interval, before checking whether the plugin-to-browser and browser-to-plugin communication cycles have finished. I don't know how many browsers would stop the plugin's execution during the attempted cross-app communication. jd/adobe ___ 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] scoping issue (?) with static, recursive function
You need a 'return' before the recursive call: class com.research.StaticRecurse { public static function getOuterMostParent(mc:MovieClip,mcRoot:MovieClip):MovieClip { if (mc._parent._name == garden) { trace(inside getOuterMostParent: + mc); return mc; } else { // Add a return here: return getOuterMostParent(mc._parent); } } } -Andy On 4/24/07, me myself [EMAIL PROTECTED] wrote: Okay, so I have an FLA with a series of embedded movieclips: garden tree branch twig flower. I want a static function -- in an as 2.0 class -- that, when given flower, returns tree. In other words, you can give in an embedded movieclip and it finds that clips ALMOST outermost parent. Here's my class function: class com.research.StaticRecurse { public static function getOuterMostParent(mc:MovieClip,mcRoot:MovieClip):MovieClip { if (mc._parent._name == garden) { trace(inside getOuterMostParent: + mc); return mc; } else { getOuterMostParent(mc._parent); } } } and inside the fla, I use the following code: import com.research.StaticRecurse; var innerMostChild:MovieClip = garden.tree.branch.twig.flower; var mc:MovieClip = StaticRecurse.getOuterMostParent(innerMostChild); trace(outside getOutMostParent: + mc); the trace is as follows: inside getOuterMostParent: _level0.garden.tree outside getOutMostParent: undefined As you can see, the first trace -- which works beautifully -- occurs RIGHT BEFORE the return statement. But the value that's actually returned is undefined. I've never encountered anything like this before. To me, it seems as if I'm doing this: function x():Number { var n:Number = 1000; trace(n); //1000 return n; } trace(x()); //undefined ... which would be insane. I'm guessing it's a scoping issue that has to do with recursion and the fact that this is a static function (which it kind of has to be). Why is this happening? Is there a workaround? Thanks! ___ 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] AS2.0 Question - passing data between classes
getInstance() is usually used for accessing Singleton classes. These are classes of which only a single instance can exist. This way any class can call getInstance (a static method) to get the class, and that class can store shared data. Take a look at this: http://en.wikipedia.org/wiki/Singleton_pattern for an overview of singletons. It's a very useful design pattern. -Andy On 4/24/07, Andrew [EMAIL PROTECTED] wrote: Is there also some way to do this using a command called getinstance() ? I've seen it in some AS script and it looks like it passes data between classes? Cheers Andrew ___ 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] Changing Green (halogreen) highlight color
I believe you can use the setStyle function to do it. For instance, in some of my code where I'm setting up a combo box I have this (I forget which color setting actually changes the focus rectangle, but I think it's 'themeColor'): comboBox.setStyle('themeColor', 0x007CBA); comboBox.setStyle('borderStyle', 'solid'); comboBox.setStyle('borderColor', 0x6E6E6D); comboBox.setStyle('fontSize', 10); Or, to turn it off I do: comboBox.drawFocus = null; -Andy On 4/24/07, Helmut Granda [EMAIL PROTECTED] wrote: Is there anyway to change the green highlight color for components without having to create a custom skin (The green/orange/blue highlight when the component has focus) ? TIA ___ 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] Basic class for swf-question
The way I do it is to have a static main method in your mother class that takes the root movie clip as an argument, and then in the first frame of the movie do: main.class.package.MyFabFlashApp.main(this); Most of the time that function is just something like this: public static function main(rootMC:MovieClip):Void { if(rootMC == undefined) { rootMC = _root; } // Set stage options here Stage.showMenu = false; Stage.scaleMode = noScale; Stage.align = LT; var myClass:MyClass = new MyClass(rootMC); } -Andy On 4/23/07, Johan Nyberg [EMAIL PROTECTED] wrote: Hi, just wanted to know if there is a best practice when creating a class for the mother movie (i.e. the flash-movie itself). Is this the way to go? var mother:MyFabFlashApp = new MyFabFlashApp(); ..or is there a better way? Seems kind of a stupid question, but I wanted to put it anyway in case I've missed something. ;-) I've put my main code on the first frame of the _root timeline for too long, and want to move it into a class. Regards, /Johan -- Johan Nyberg Web Guide Partner Sergels Torg 12, 8 tr 111 57 Stockholm 070 - 407 83 00 ___ 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] Why does this work?!
I just realized that there are a number of switch statements in my code which probably shouldn't work, yet appear to, and I'm wondering why. Here's a really simple example. I have a class that tracks the connection state of my app, with the following values used as the states (read-only attributes simulating constants): public static function get CONNECTED():String { return CONNECTED; } public static function get FAILURE():String { return FAILURE; } public static function get NOT_CONNECTED():String { return NOT_CONNECTED; } In the code that lets you set the state to a particular value it does a sanity check to make sure the state value is one that's expected (since in theory the user could provide any string value): public function setConnectionState(cs:String):Void { switch(cs) { case ConnectionState.CONNECTED: case ConnectionState.FAILURE: case ConnectionState.NOT_CONNECTED: break; default: cs = ConnectionState.NOT_CONNECTED; break; } this._connectionState = cs; } Now in Java switch statements must use constants for the case values. You can do something like I just did, but the variables being referenced must be declared final (so the compiler knows they won't change). There isn't any equivalent to this in Flash (I simulate constants by doing read only properties), so why does the case statement work? Does flash actually execute the stuff after the 'case' keyword? What happens if multiple of those things return the same value (for instance, say both CONNECTED and FAILURE returned foo)? -Andy ___ 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] preloader and cacheing problem
What's the value that replaces +file+? That's where the unique identifier would appear if there was one, but that would just handle the preloader file. If you have the FLA for the preloader movie then you should be able to take a look at the code and see if it's appending a unique identifier to the lager movie's URL as well. You'll need to dig through the code to find it, but look for things like 'loadMovie' or 'MovieClipLoader' -Andy On 4/17/07, John Cowles [EMAIL PROTECTED] wrote: Hi Here is the javascript that loads the initial flash file - if javascript isn't enabled then a static image is shown (hence the document.write) function flash_write(file, width, height) { document.write('object classid=clsid:D27CDB6E-AE6D-11cf-96B8-44455354 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.ca b#version=6,0,0,0 width='+width+' height='+height+' id=movie param name=movie value='+file+' / param name=wrmode value=transparent / param name=menu value=false / !--[if !IE] -- object type=application/x-shockwave-flash data='+file+' width='+width+' height='+height+'/object!-- ![endif]-- /object'); } _ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nils Millahn Sent: 17 April 2007 10:04 To: [EMAIL PROTECTED]; flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] preloader and cacheing problem Hi John, this shouldn't actually happen, unless the url to the SWF that's being loaded in is modified to make it 'unique' each time the swf is loaded. That can be done, for example, by appending a random number to the end, so you get urls like myfile.swf?0.123347575. This might have been the intention of the original developer, I guess. Other than that, the swf should be cached. You could also post the loading code, that might shed further light on the issue. - Nils. On 17/04/07, John Cowles [EMAIL PROTECTED] wrote: We have been supplied with Flash files that include a preloader, a small flash file that then gets a large flash file. The way it works bypasses both browser and server caching rules. Every time the page is refreshed it downloads the entire fileset again. This accounts for about 20% of monthly bandwidth and it seems completely unecessary. We have the FLA file and although we are PHP, Javascript programmers, we have no experience of Flash and action script. Can someone advise or direct us to a site to understand how we can set some conditional logic within the Flash preloader to only fetch the rest of the Flash if it hasn't already been downloaded in that session. Thanks ___ 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] Why does this work?!
Oh, the code is OK, and it works. I'm just surprised Flash lets you have case statements with non-constant values. Since the case values are actually functions that are evaluated it's possible that you can have multiple case statements of the same value. I'm not used to languages/compilers allowing those situations. -Andy On 4/17/07, eka [EMAIL PROTECTED] wrote: Hello :) in AS2 you can create constants with the ASSetProgFlags global method : public static var CONNECTED:String = CONNECTED ; public static var FAILURE:String= FAILURE ; public static var NOT_CONNECTED:String = NOT_CONNECTED; private static var __ASPF__ = _global.ASSetPropFlags( ConnectionState , null , 7, 7 ) ; ConnectionState is the name of your enumeration static class :) For me.. your code is ok : public function setConnectionState(cs:String):Void { switch(cs) { case ConnectionState.CONNECTED : case ConnectionState.FAILURE : { break; } default : { cs = ConnectionState.NOT_CONNECTED ; } } this._connectionState = cs ; } EKA+ :) 2007/4/17, Andy Herrman [EMAIL PROTECTED]: I just realized that there are a number of switch statements in my code which probably shouldn't work, yet appear to, and I'm wondering why. Here's a really simple example. I have a class that tracks the connection state of my app, with the following values used as the states (read-only attributes simulating constants): public static function get CONNECTED():String { return CONNECTED; } public static function get FAILURE():String { return FAILURE; } public static function get NOT_CONNECTED():String { return NOT_CONNECTED; } In the code that lets you set the state to a particular value it does a sanity check to make sure the state value is one that's expected (since in theory the user could provide any string value): public function setConnectionState(cs:String):Void { switch(cs) { case ConnectionState.CONNECTED: case ConnectionState.FAILURE: case ConnectionState.NOT_CONNECTED: break; default: cs = ConnectionState.NOT_CONNECTED; break; } this._connectionState = cs; } Now in Java switch statements must use constants for the case values. You can do something like I just did, but the variables being referenced must be declared final (so the compiler knows they won't change). There isn't any equivalent to this in Flash (I simulate constants by doing read only properties), so why does the case statement work? Does flash actually execute the stuff after the 'case' keyword? What happens if multiple of those things return the same value (for instance, say both CONNECTED and FAILURE returned foo)? -Andy ___ 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] Why does this work?!
Oh, it works correctly, assuming I'm not dumb and give a couple constants the same values. It just seems strange for this to be allowed. Thus the question why does this work. I would think it shouldn't even compile. -Andy On 4/17/07, Hans Wichman [EMAIL PROTECTED] wrote: Hi, what were your own test results? :) Yes you can do this, and flash will execute the first matching case statement. Any other matches will be ignored. greetz JC On 4/17/07, Andy Herrman [EMAIL PROTECTED] wrote: I just realized that there are a number of switch statements in my code which probably shouldn't work, yet appear to, and I'm wondering why. Here's a really simple example. I have a class that tracks the connection state of my app, with the following values used as the states (read-only attributes simulating constants): public static function get CONNECTED():String { return CONNECTED; } public static function get FAILURE():String { return FAILURE; } public static function get NOT_CONNECTED():String { return NOT_CONNECTED; } In the code that lets you set the state to a particular value it does a sanity check to make sure the state value is one that's expected (since in theory the user could provide any string value): public function setConnectionState(cs:String):Void { switch(cs) { case ConnectionState.CONNECTED: case ConnectionState.FAILURE: case ConnectionState.NOT_CONNECTED: break; default: cs = ConnectionState.NOT_CONNECTED; break; } this._connectionState = cs; } Now in Java switch statements must use constants for the case values. You can do something like I just did, but the variables being referenced must be declared final (so the compiler knows they won't change). There isn't any equivalent to this in Flash (I simulate constants by doing read only properties), so why does the case statement work? Does flash actually execute the stuff after the 'case' keyword? What happens if multiple of those things return the same value (for instance, say both CONNECTED and FAILURE returned foo)? -Andy ___ 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] Make page ads refresh on Flash click events
Do they want the changes to happen while navigating within the flash application itself, or while navigating between HTML pages? If it's all within the flash app then you shouldn't need javascript at all. You'd just need to add to your navigation code to have it refresh the ad area. -Andy On 4/13/07, Marlon Harrison [EMAIL PROTECTED] wrote: I'm working on a flash app that will be embedded in a page that hold three ad units. The flash app holds alot of content so its been requested that I set it up t to refresh the three ad units when a user clicks to a different section of the app. I've been googling this but haven't come up with a good solution. Has anyone come across this before? Is there some javascript that I can ask to have included in the page that works across major browsers that can accomplish this? ___ [EMAIL PROTECTED] 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 ___ [EMAIL PROTECTED] 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] Little OT - USB drive autorun?
My understanding is that the U3 stuff requires specific stuff to be implemented in the firmware. The flash drive's firmware actually simulates a CD-ROM along with the flash drive, and uses the windows autorun feature for CDs to actually launch the program. It won't work on machines that have autorun turned off for CDs though. I don't think there's any way to do it for random USB drives. -Andy On 4/13/07, Dave Watts [EMAIL PROTECTED] wrote: No. Like I said - I was looking for something that did not require first installing software on the target machine. Anybody else, or I guess the answer is just 'no'. It can certainly be done without installing anything first on a Windows machine - USB drives following the U3 standard do this. You might consider getting one of those to see how it works. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! This email has been processed by SmoothZap - www.smoothwall.net ___ [EMAIL PROTECTED] 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 ___ [EMAIL PROTECTED] 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] double clicking on swfs to click button
Actually, to me it sounds like he's using Windows and is running into the Eolas thing. If that's the case, the problem is that, due to patent issues, Microsoft had to change IE's behavior with ActiveX controls (which Flash and Java both use for their plugins) such that they don't get any mouse or keyboard events until you activate them by clicking on them. There are ways around it, documented in the MS whitepaper about it: http://msdn.microsoft.com/workshop/author/dhtml/overview/activating_activex.asp The easiest thing would be to use swfobject, as was mentioned in an earlier post. -Andy On 4/10/07, Joshua Sera [EMAIL PROTECTED] wrote: Sounds like you're using a mac. If you are, that's an OS issue. The mac makes you give focus to the window before it starts passing mouse events to whatever's in the window. You can't do a whole lot about it. --- nik crosina [EMAIL PROTECTED] wrote: Hi, Probably a silly question but I am building a site at the moment with an animated Navigation bar, what happens is that in order to click on a button to go to a different page, you have to first click on the swf to make it active, THEN click again to actually click the button. Also, without first clicking on it, no roll overs work in the swf. What is it I am doing wrong?! Thanks, -- 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 Looking for earth-friendly autos? Browse Top Cars by Green Rating at Yahoo! Autos' Green Center. http://autos.yahoo.com/green_center/ ___ 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] poll on editors/IDe
If you're going for both IDEs and straight editors I'd add: Vim Notepad++ On 4/6/07, Merrill, Jason [EMAIL PROTECTED] wrote: FlashDevelop Flexbuilder SciTe Flash Jason Merrill Bank of America GTO Learning Leadership Development eTools Multimedia Team -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ron Wheeler Sent: Friday, April 06, 2007 3:31 PM To: Flashcoders Mailing List Subject: [Flashcoders] poll on editors/IDe I would like to put up a poll on http://tech.groups.yahoo.com/group/Script_in_Action/ to find out what editors and IDEs are being used by flashcoder members to code actionScript applications. Can you tell me what programs should be included in the available choices? Starting list from what I have seen - Flash IDE - Eclipse - Sepy Please add your favourite or suggest ones that you know others are using. Ron ___ 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] manipulate 32bit integer
I'd do: color = (color (0x00FF)) | (alpha 24); removes that shift and is a little easier to tell what's happening (I always mix up which right shift does what). Though it probably doesn't matter. :) -Andy On 4/5/07, Oliver Müller [EMAIL PROTECTED] wrote: thanks - thats 10 ms faster each operation. Olli 2007/4/5, Mark Winterhalder [EMAIL PROTECTED]: On 4/5/07, Oliver Müller [EMAIL PROTECTED] wrote: Hi, I want to change the alpha channel of an 32bit integer. At the moment I extract every color channel, change the alpha and then put them together at the end. (alpha 24) | (red 16) | (green 8) | blue ) How can I change the alpha channel directly ? You could...: color = (color (-1 8)) | (alpha 24); ...but I'm not sure if that would be better. Mark ___ 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] creatTextField Help
Try throwing some trace statements in there to see if things are being instantiated correctly. Specifically, after the createEMptyMovieClip try: trace(_root.Art_MC); and after the createTextField() call, try adding this: trace(_root.Art_MC[Art_Txt]); It's possible something isn't being created and you've got some undefined values. You might also want to check out Xray (http://osflash.org/xray). It's helped me when having issues like this before, as you can look at exactly what exists at runtime. -Andy On 4/5/07, edward [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 hi everyone, any idea why the text does not show up? - _root.myRed = 0xFF; _root.myLightGray = 0x99; _root.myDarkGray = 0x353535; _root.Art_Fmt = new TextFormat(); with (_root.Art_Fmt) { font = menuFont; size = 8; color = myLightGray; embedFonts = true; } _root.Art_MC = _root.createEmptyMovieClip(Art_MC, 0); _root.Art_MC.createTextField(Art_Txt, i, 10, 10, 80, 20); with (_root.Art_MC[Art_Txt]) { border = false; autoSize = false; selectable = false; embedFonts = true; html = false; } _root.Art_MC[Art_Txt].text = Test Text!!!; _root.Art_MC[Art_Txt].setTextFormat(_root.Art_Fmt); _root.onRollOver = function() { this[Art_Txt].textColor = myDarkGray; } -BEGIN PGP SIGNATURE- Note: This signature can be verified at https://www.hushtools.com/verify Version: Hush 2.5 wpwEAQECAAYFAkYVNoQACgkQnK42HzOJXBejgQP+N4+E+HWIZlFIb448AZFEzlbGEOye hD6bKAUTOrsOoy0Vt/ZyLq7uKqh3Cbb906Xy4hdSjaH/ZHVJ8ten62xdokfd9ev7tyK8 y6v9QPjIQ23t6oAZiwZDu8eE992cghuI9Y5XXXSRS+UH/uke3ykUV5Q5kUWmglbi1vVV utsPmTY= =rylS -END PGP SIGNATURE- -- Click to find great rates on home insurance, save big, shop here http://tagline.hushmail.com/fc/CAaCXv1QU9IdGnuLtTBUmTDA5ogVpQkF/ ___ 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] Entities are Hell!
My guess is that you were just using the node itself instead of getting nodeValue (basically using the toString() function). If that's the case then toString probably gives the raw data in the file, while using nodeValue does the full conversion of the data in the node. -Andy On 4/4/07, Steven Loe [EMAIL PROTECTED] wrote: Andrew, nodeValue works! I don't even have to convert the special characters to entities to have it display correctly. Thanks very much. Next Question: Do you understand How/Why it works? Thanks, Steven --- Rost, Andrew [EMAIL PROTECTED] wrote: Play with nodeValue. As a test add the entity code into the XML file and use nodeValue: // XML hut_data titleAkbar Jeffapos;s ActionScript Hut/title /hut_data // // AS theClip.txt.text = xmlNode.firstChild.firstChild.nodeValue; // instead of: // XML hut_data titleAkbar Jeff's ActionScript Hut/title /hut_data // // AS theClip.txt.text = xmlNode.firstChild.firstChild; // HTH - Andrew -Original Message- From: Steven Loe [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 04, 2007 10:24 AM To: Flashcoders mailing list Subject: [Flashcoders] Entities are Hell! I'm loading xml with special characters. These display as their entity codes i.e. as . If I put enitity codes in the xml, I still get entity codes displaying on screen. What am I doing wrong? Any thoughts? Thanks!!! Screen Output: Akbar Jeffapos;s ActionScript Hut my_xml.xml: hut_data titleAkbar Jeff's ActionScript Hut/title /hut_data class: class LoadXml { private static var xmlUrl:String = my_xml.xml; private var rootRef; private var theClip:MovieClip; function LoadXml(rootRef) { this.rootRef = rootRef; var xmlDoc:XML = new XML(); xmlDoc.ignoreWhite = true; xmlDoc.onLoad = function(success:Boolean) { if (success) { this.owner.displayData(this); } else { trace(error loading xml); } }; Object(xmlDoc).owner = this; xmlDoc.load(xmlUrl); } private function displayData(xmlDoc:XML) { var xmlNode:XMLNode = xmlDoc.firstChild; if (xmlNode.nodeName.toString() == hut_data) { theClip = this.rootRef.createEmptyMovieClip(theClip, 1); theClip.createTextField(txt, 10, 10, 10, 250, 20); theClip.txt.html = true; theClip.txt.text = xmlNode.firstChild.firstChild; } } } Need Mail bonding? Go to the Yahoo! Mail QA for great tips from Yahoo! Answers users. http://answers.yahoo.com/dir/?link=listsid=396546091 ___ 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] flash database - very conservative connections
I'm guessing you're using the version of IIS that comes with XP when running locally. That version has a very low limit on the number of concurrent connections it allows. It's possible that you're hitting that limit when running locally (Flash might not be completely closing the connections or doing other weird things with them). I've seen my IIS setup get messed up sometimes where it would think it was always hitting the limit, and I'd have to reboot. Try running it faster to the point where you get the error, and when you do try browsing to something served by that machine in IIS and see if you can get to it. -Andy On 3/31/07, Costello, Rob R [EMAIL PROTECTED] wrote: Dear all I am using sendAndLoad to extract data from an MS Access db, via an ASP page. When running on my localhost, this only works if I restrict calls to the asp/db to about one per 30s. Any more, and the XML.onLoad callback returns a success value of false - (ie fails!) It does work fine if I step through very slowly - 1 page access per 30s. Its like the database is still tied up after the first access. I assume that I have some permission or database setting set incorrectly, but I can't find it. The ASP pages close the SQL connection when finished Conn.Close() Conn=null (Have also added all the iusr and (helper accounts) permissions I can think of for the wwwroot folder) This did run fine on a slower laptop at one stage (it was also XP, but it was an older version of Flash - mx2004. Now using Flash8) Any insights or help very greatly appreciated Thanks Rob Important - This email and any attachments may be confidential. If received in error, please contact us and delete all copies. Before opening or using attachments check them for viruses and defects. Regardless of any loss, damage or consequence, whether caused by the negligence of the sender or not, resulting directly or indirectly from the use of any attached files our liability is limited to resupplying any affected attachments. Any representations or opinions expressed are those of the individual sender, and not necessarily those of the Department of Education. ___ 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] LocalConnection security
Generally I think it's a good idea to come up with unique (dynamic) names for the local connections, but this requires sharing data between the SWFs in some other way. In my case they are both part of web pages served from the same source, so I can populate a parameter that's passed to both that gives the unique LC name, and then they use that. This solves the issue of having multiple copies running at once. As for the other issues, you might be able to come up with your own authentication process to make sure it's the right 'george', but otherwise I'm not sure how you'd fix 1 or 2. -Andy On 3/30/07, Michael Mudge [EMAIL PROTECTED] wrote: I have a Flash 9 app (named fred), which loads a Flash 8 app (george), and I need these two apps to be able to communicate, in both directions. It seems that a LocalConnection is the typical answer to this, but I have issues with security. fred is loaded from a private domain (my own), and george runs from a highly public domain (like putfile). Here are the problems: I have a lot of control over fred, but the code in george needs to be simple. 1. If fred makes a LocalConnection to listen to george (allowing his domain), then any number of other apps, coencidentially loaded from george's domain, can send crap to fred. -- Can I make fred verify that it was george and not just some other schmuck SWF from george's site? 2. If another app on george's site makes a localconnection before george gets loaded, it could trump george's ability to listen to commands from fred. 3. If the fred+george app is loaded twice, the localconnections will have already been in use, making them unable to make a connection in the newly loaded copy. ...so, how can this be solved? Is there a way to make LocalConnection (or some other type of connection) talk only within the same Flash player? Is there a way to know what URL is sending data through the LocalConnection? - Kipp ___ 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] SWF Only Loads Once
If I follow that code properly you're adding a 'no-cache' value to the headers. I'm not sure if that's the right way to do it. Try this. Add some query parameter to the end of your URL that has a unique value (like the current time in milliseconds). So something like: http://server/path/to/file.xml?uniq=currentTime The browsers will see that it's a different URL and will always redownload it, but unless the server is specifically using that query parameter it will just be ignored. -Andy On 3/30/07, Daniel Thompson [EMAIL PROTECTED] wrote: Thanks guys. I added a cache-busting param to the request, but it didn't fix the issue. Here's my method: protected function invoke(resource:String, variables:URLVariables, successHandler:Function, errorHandler:Function = null):void { variables.api_key = KEY; var request:URLRequest = new URLRequest(); request.method = GET; request.url = _server + FORMAT + resource; variables[no-cache] = Math.round(new Date().time).toString(); request.data = variables; if (errorHandler == null) { errorHandler = onIOError; } var loader:URLLoader = new URLLoader(); loader.dataFormat = xml; loader.addEventListener(Event.COMPLETE, successHandler); loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler); try { loader.load(request); } catch (error:Error) { throw new Error(Unable to connect); } } It just seems odd that if I clear my cache, everything works again. ___ 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] Problem controlling multiple movies with one class
I bet the problem is path related. If you have a holder movie that's running, which is loading the 2 SWFs, then the paths to the config XML files would be relative to the holder movie's path, not the SWFs your loading (I'm pretty sure that's true). Your base class is probably using the same relative path to load it, assuming the current path is the SWF's directory, though that may not be the case. Maybe try adding a parameter to the loading of the movie that takes the relative path to use? For example, if your directory structure was this: mainMovie.swf test1/test.swf test1/config.xml test2/test.swf test2/config.xml main movie would do somewhere in its code (pseudocode as my brain isn't completely functioning yet): var test1 = loadMovie(...); var test2 = loadMovie(...); test1.loadConfig('test1/'); test2.loadConfig('test2/'); Then your loadConfig function would prepend the path to the name of the config file, allowing it to get the right one. -Andy On 3/28/07, Russell Sprague [EMAIL PROTECTED] wrote: I have two sections of my app in separate swf files that have very similar functionality, but have different content. The 2 swf files are generated from the same fla file. I built a core class that controls the creation of the menu and loading the content. The menu data and content is in an xml file called config.xml that I load into the core class. I attached the core class to the main movie clip in my fla. I then exported the 2 swfs, put them in their own folders, in which there was a folder called config that held the config.xml that went with the section. What I found is it would work fine when I loaded the first swf, but when I loaded the second, it is still referencing the data for the first movie. So even though it was a different swf file, the content was the same. The swf were loaded into the same holder movie, so I thought this might be the problem. I changed my root movie ot created a new emptyMovieClip each time a section was loaded, and delete the old one, but that didn't solve the issue. The only way I found around this was to create two subclass files that extend the main class, overriding the function that loads the xml file, and rename the xml files to be specific to the swf. My question is, is this normal behavior? How can I get rid of the class and/or data from memory so the new data will load? Thanks Russ ___ 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] Re: attachMovie vs createClassObject
I think the root movie clip does extend UIObject, as createClassObject works for me. And the objects I'm creating aren't custom ones, but things like mx.controls.ComboBox, so I don't have to worry about symbol* variables. I may have to look into UIObject a bit more. I've been making some of my own controls, but doing it using Composition, with the class that handles the control creating (or being passed) an movie clip to use. Maybe extending UIObject would make more sense. -Andy On 3/24/07, Yehia Shouman [EMAIL PROTECTED] wrote: createClassObject is defined in UIObject core object. I don't think it can be called as a method of any movieclip. It also requires that you define static var symbolName : String = linkageID; static var symbolOwner : Object = com.myclass; and at the end of the day It calls createObject which basically uses attachMovie passing on the symbolName. Use it if your host mc is a UIObject (inheriting from mx.core.UIComponent or mx.core.UIObject). I use var myInstance:ClassType=ClassType(mc.attachMovie(ClassType.symbolName ,instanceName,depth)) Sometimes, if there is any pending code in the draw method of the created class instance, I wait for a frame using doLater. I hope this helps Yehia Shouman On 3/23/07, Andy Herrman [EMAIL PROTECTED] wrote: Just to amend my previous comment, in the case where I said `createClassObject()` failed but `attachMovie()` didn't, that ended up to be not quite true. `createClassObject()` didn't do anything, but `attachMovie()` created the visual portions of the clip, but it looks like none of the component's code was actually loaded, so while it appeared to be working it really wasn't. But in the cases where one works the other seems to work as well, so I'm still wondering what the difference is. -Andy On 3/20/07, Andy Herrman [EMAIL PROTECTED] wrote: I'm wondering if there are any significant differences between using `attachMovie()` and `createClassObject()` for creating components (I'm targeting for Flash 7). I just ran into a weird issue creating a ComboBox where I was using `createClassObject()` to instantiate it, but saw that elsewhere in the code it was using `attachMovie()` to create one, and both were working. Specifically, both this: mc.attachMovie(ComboBox, myComboBox, mc.getNextHighestDepth()); and this: mc.createClassObject(ComboBox, myComboBox, mc.getNextHighestDepth()); seems to give the same results in most cases. Is there any benefit to using `createClassObject()` over `attachMovie()` for components? The one situation I ran into where it gives different results is when using multiple SWFs from different places. I have a main movie which loads another movie that contains all the UI resources (makes branding easier). The UI resources movie contains the ComboBox in its library. If both the movies are on the local filesystem then it works fine, but if the resources SWF is on a remote web server the `createClassObject()` call fails. However, if I change it to use `attachMovie()` it works fine. So I'm leaning towards using `attachMovie()`, just to make my life easier for testing (don't have to upload the main movie every time I want to test it), but I'm wondering if that will cause issues later. -Andy ___ 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] Re: attachMovie vs createClassObject
Just to amend my previous comment, in the case where I said `createClassObject()` failed but `attachMovie()` didn't, that ended up to be not quite true. `createClassObject()` didn't do anything, but `attachMovie()` created the visual portions of the clip, but it looks like none of the component's code was actually loaded, so while it appeared to be working it really wasn't. But in the cases where one works the other seems to work as well, so I'm still wondering what the difference is. -Andy On 3/20/07, Andy Herrman [EMAIL PROTECTED] wrote: I'm wondering if there are any significant differences between using `attachMovie()` and `createClassObject()` for creating components (I'm targeting for Flash 7). I just ran into a weird issue creating a ComboBox where I was using `createClassObject()` to instantiate it, but saw that elsewhere in the code it was using `attachMovie()` to create one, and both were working. Specifically, both this: mc.attachMovie(ComboBox, myComboBox, mc.getNextHighestDepth()); and this: mc.createClassObject(ComboBox, myComboBox, mc.getNextHighestDepth()); seems to give the same results in most cases. Is there any benefit to using `createClassObject()` over `attachMovie()` for components? The one situation I ran into where it gives different results is when using multiple SWFs from different places. I have a main movie which loads another movie that contains all the UI resources (makes branding easier). The UI resources movie contains the ComboBox in its library. If both the movies are on the local filesystem then it works fine, but if the resources SWF is on a remote web server the `createClassObject()` call fails. However, if I change it to use `attachMovie()` it works fine. So I'm leaning towards using `attachMovie()`, just to make my life easier for testing (don't have to upload the main movie every time I want to test it), but I'm wondering if that will cause issues later. -Andy ___ 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] QT in IE returning null value to flash
Hm. I haven't used ExternalInterface at al (I'm stuck with Flash 7), so I'm not really sure what the problem could be. Though you might be able to do it as a callback (have the javascript function call some function in your Flash movie to give it the value). The control flow for that would be a bit odd, but it might work if you can't get it to return correctly. -Andy On 3/20/07, Bob Wohl [EMAIL PROTECTED] wrote: yeah, I can alert the value (real fun with a set interval =P). Just getting it from JS seems to be the issue. yep, QuickTime, their documentation rocks for javascript ;) Bob On 3/20/07, Andy Herrman [EMAIL PROTECTED] wrote: Have you tried getting the value out using just Javascript (no Flash involved)? See if that works. It might make it easier to debug (removing a layer of complexity). Maybe IE has some security in place that's preventing the access of the values from QT (you mean quicktime? I always think of QT as the C++ toolset made by trolltech.) -Andy On 3/20/07, Bob Wohl [EMAIL PROTECTED] wrote: Hello all, I've researched quite a bit over the past week to no avail on how in IE i get a return of null when pulling the time from a QT file but in FireFox i get the proper time... flash call - myTime = ExternalInterface.call(DisTime, document.movie1); js - function DisTime(anObj){ var obj = eval(anObj); return obj.GetTime(); } seems simple enough but I cannot for the life of me find out why IE sees it as null. Any ideas, pointers? Thanks! Bob ___ 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@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] attachMovie vs createClassObject
I'm wondering if there are any significant differences between using `attachMovie()` and `createClassObject()` for creating components (I'm targeting for Flash 7). I just ran into a weird issue creating a ComboBox where I was using `createClassObject()` to instantiate it, but saw that elsewhere in the code it was using `attachMovie()` to create one, and both were working. Specifically, both this: mc.attachMovie(ComboBox, myComboBox, mc.getNextHighestDepth()); and this: mc.createClassObject(ComboBox, myComboBox, mc.getNextHighestDepth()); seems to give the same results in most cases. Is there any benefit to using `createClassObject()` over `attachMovie()` for components? The one situation I ran into where it gives different results is when using multiple SWFs from different places. I have a main movie which loads another movie that contains all the UI resources (makes branding easier). The UI resources movie contains the ComboBox in its library. If both the movies are on the local filesystem then it works fine, but if the resources SWF is on a remote web server the `createClassObject()` call fails. However, if I change it to use `attachMovie()` it works fine. So I'm leaning towards using `attachMovie()`, just to make my life easier for testing (don't have to upload the main movie every time I want to test it), but I'm wondering if that will cause issues later. -Andy ___ 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] QT in IE returning null value to flash
Have you tried getting the value out using just Javascript (no Flash involved)? See if that works. It might make it easier to debug (removing a layer of complexity). Maybe IE has some security in place that's preventing the access of the values from QT (you mean quicktime? I always think of QT as the C++ toolset made by trolltech.) -Andy On 3/20/07, Bob Wohl [EMAIL PROTECTED] wrote: Hello all, I've researched quite a bit over the past week to no avail on how in IE i get a return of null when pulling the time from a QT file but in FireFox i get the proper time... flash call - myTime = ExternalInterface.call(DisTime, document.movie1); js - function DisTime(anObj){ var obj = eval(anObj); return obj.GetTime(); } seems simple enough but I cannot for the life of me find out why IE sees it as null. Any ideas, pointers? Thanks! Bob ___ 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] Re: Previously working SWF fails when reloaded in IE
I've run into that before. The issue seems to be timing-related. When you reload the page the SWF isn't re-downloaded (since it's cached), so it loads much faster, so some initialization stuff might run sooner than they did the first time. Here's how I fixed this (I run into it sometimes even on the first load): Set the size of the canvas to 1x1 pixels in the FLA (at the very beginning Stage.width and Stage.height seem to report this value, then switches to 0, then eventually to the actual size). Then, when the movie loads set up an interval that runs every, say, 500 milliseconds, which checks the size. Once both the width and height are something other than 0 or 1 then you know the Stage has been sized, in which case you stop the interval and start running the rest of your code. I'm using this method in a couple movies and it works really well. -Andy On 3/17/07, Mark Winterhalder [EMAIL PROTECTED] wrote: On 3/17/07, Mark Winterhalder [EMAIL PROTECTED] wrote: While I try to find the origin of the problem to work around it, has anybody seen this before? The SWF works fine when the page is first loaded, but when you hit F5 a NaN propagates through the values, breaking everything. The SWF loads an XML, if that makes a difference, but this part seems to work. For the archives: The layout algorithms depended on the Stage.width/height. When loaded for the first time it had the intended size, but upon reload it was 0x0 initially. Mark ___ 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] Super and this
It's also very certain to drive another coder potentially working with your code in the future into insanity... I don't know. Sometimes that's a valid reason to do things like that. :) As powerful as being able to do that is, it's one of those features of Flash that always scares me. I tend to think in terms of having my code being used by someone else, and I don't like the ability of other people to mess with my stuff at runtime and potentially break my invariants, though maybe I just have trust issues. Then again, that ability is the *only* reason I was able to get code someone else gave me to actually work... -Andy On 3/19/07, Mark Winterhalder [EMAIL PROTECTED] wrote: To be honest, I'm not really sure what is better. Certainly the Director way is a lot more flexible - you can generate and swap ancestors on the fly, which I think is pretty cool, a bit like inheritance via composition. If you're not using AS3 yet, you can do it. You can set an object's __proto__ property to any object (not just a class prototype!): class Foo { public function greet () : Void { trace( hello ); } } class Bar { public function greet () : Void { trace( g'day ); } } class Foobar extends Foo { // ... } var foo = new Foo(); var bar = new Bar(); var foobar1 = new Foobar(); var foobar2 = new Foobar(); var foobar3 = new Foobar(); foo.greet(); // hello bar.greet(); // g'day foobar1.greet(); // hello foobar2.greet(); // hello foobar3.greet(); // hello // now, let's let foobar1 extend Bar instead... foobar1.__proto__ = Bar.prototype; foobar1.greet(); // g'day foobar2.greet(); // hello foobar3.greet(); // hello // foobar1 now has lost any other methods and properties previously inherited from Foobar // let all instances of Foobar extend Bar Foobar.prototype.__proto__ = Bar.prototype; foobar1.greet(); // g'day foobar2.greet(); // g'day foobar3.greet(); // g'day // foobar2 and foobar3 still inherit methods and properties from Foobar, foobar1 of course doesn't unless you set it's __proto__ back to Foobar.prototype // now, add a generic object to the prototype chain: var baz = { greet: function () { trace( how's it goin'? } }; foobar1.__proto__ = baz; foobar1.greet(); // how's it goin'? // foobar1 now can't do anything else but greet(), let's let baz extend Foobar to give it back the other Foobar methods: baz.__proto__ = Foobar.protoype; Fun stuff, huh? However, I strongly recommend not to use this other than for purely educational purposes. If you feel like you have to mess with the prototype chain at runtime, odds are there is something you're doing wrong, and you should rethink your design. It's also very certain to drive another coder potentially working with your code in the future into insanity... Mark On 3/19/07, Karina Steffens [EMAIL PROTECTED] wrote: Danny, I think what Ron means is, you don't instantiate the class _and_ the super class, as you would with Director. As you know (and for anyone that isn't familiar with it), in Director the ancestor property is an instance of the superclass, residing within an instance of the subclass (a bit like a Russian Doll!) - but in Flash you don't get two instances within each other, but just a single hybrid of all the classes in the inheritance chain. To be honest, I'm not really sure what is better. Certainly the Director way is a lot more flexible - you can generate and swap ancestors on the fly, which I think is pretty cool, a bit like inheritance via composition. Actually if you go back to the metaphor, the Chrysler PT Cruiser in Director would come with a little Chrysler Neon sitting inside it ;) Karina -Original Message- From: Danny Kodicek [mailto:[EMAIL PROTECTED] Sent: 19 March 2007 09:39 To: [EMAIL PROTECTED]; flashcoders@chattyfig.figleaf.com Subject: RE: [Flashcoders] Super and this Just to make your life simpler. You do not instantiate a class; you instantiate an instance(object) of a class. Isn't that what 'instantiate' means? By 'instantiate' I mean 'make an instance of'. 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 ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive:
Re: [Flashcoders] Super and this
Oh, I don't even think of 'super' as any kind of identifier/variable. I think of it the same way I think of '.', '[]' or even '-' (in C), in that I think of it as an operator used to access something, not as a reference. 'super.' is just the way to access the parent implementation of a function, just like '.' is how to access a member property. -Andy On 3/19/07, Danny Kodicek [EMAIL PROTECTED] wrote: I was simply suggesting that using the right words would make things clearer. Danny is right in a sense. Ron Karina Steffens wrote: Danny, I think what Ron means is, you don't instantiate the class _and_ the super class, as you would with Director. As you know (and for anyone that isn't familiar with it), in Director the ancestor property is an instance of the superclass, residing within an instance of the subclass (a bit like a Russian Doll!) - but in Flash you don't get two instances within each other, but just a single hybrid of all the classes in the inheritance chain. To be honest, I'm not really sure what is better. Certainly the Director way is a lot more flexible - you can generate and swap ancestors on the fly, which I think is pretty cool, a bit like inheritance via composition. What I like about the Lingo model is the simplicity that every object is a clear 'thing' that can be seen and inspected. There's a certain elegance to the ECMA system where *everything* is an object, but you lose the sense of distinction between objects, properties and methods that you have in Lingo. Using this particular issue as an example, what exactly *is* 'super'? It's not an object in the same sense that our instantiated class is, it's a kind of hidden layer of the class. I'm not saying one system is better or the other (I started with Lingo, so I'm more comfortable with it, but I like both). 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] Does ByteLoaded/bytesTotal work loading from CDROM ?
Then it's probably completely loaded. When using local media the load times will be very fast, unless the file is very large (on the order of a few hundred megs). I wouldn't be at all surprised if the bytesLoaded == bytesTotal from the very beginning. Just means it loads really fast. :) -Andy On 3/19/07, Fabio Sonnati [EMAIL PROTECTED] wrote: Does ByteLoaded / bytesTotal work loading from CDROM ? when I try, I get ByeLoaded = byteTotal since the beginning... ___ 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] Super and this
So, when you instantiate a class that extends other classes, there is only one actual object that's created. So `this` would always return the same object, whether in code written in A or in B. super is simply used so that you can reference the parent class's implementation of certain functions (mostly useful when you override things). You're still running on the same object, it's just running the parent's implementation of the function. -Andy On 3/16/07, Danny Kodicek [EMAIL PROTECTED] wrote: Just a quick check, as I'm more used to Director's inheritance model than Flash's! I have an object A which extends B, which in turn extends MovieClip Object B has a method 'fGetElementAt' which returns a movieclip In A, I want to extend this by adding some extra code on top: (leaving out declarations etc in the following:) function fGetElementAt(tX, tY) { tRet = super.fGetElementAt(tX, tY) if (tRet == this) { doSomethingElse() } return tRet } and the superclass version, just for sake of argument (obviously it's more complicated than this): function fGetElementAt (tX, tY) { return this } My question: will the 'this' parameter refer to the same object in the superclass as it does in object A? Just to show where I'm coming from, to those who know Lingo, here's an equivalent: on mGetElementAt me, tX, tY tRet = ancestor.mGetElementAt(tX, tY) if (tRet = me) then doSomethingElse end if end and the ancestor version (again for the sake of argument) on mGetElementAt me, tX, tY return me end In this version, the if statement in the subclass would fail because the variable 'me' refers to different objects in the two cases. In Lingo, I can avoid this happening by using tRet = callAncestor(#mGetElementAt, me, tX, tY) instead. So is super.function more like ancestor.function or more like callAncestor(function)? Hope that makes some sense! 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] Resizing sw, dependently on screen resolution
You can tell Flash to not scale the contents of the movie when it is resized, so you should be able to just set the object tag values to the size you want. Try putting the following in the first frame: Stage.scaleMode = noScale; That will tell it not to scale things. Then, when the window resizes the contents won't scale. -Andy On 3/14/07, Nicola Alexander Schlup - LuniLogic [EMAIL PROTECTED] wrote: Hi, I want to extend a gallery slideshow script (http://flash-creations.com/notes/dynamic_slidingviewer.php). It should just contain the slide thumbs, but bigger. This is not the problem. The problem is, that I want to have different swf width values, dependently on the users screen resolution. The container for the images should change. For examples, with a screen resolution of 1024*768 Pixel, the container for the images should be 900*300 Pixel. With a bigger resolution, the width value would increase. The images itself should not change in size. So with a bigger resolution, I see more images on screen. With a lower resolution, I have to scroll more as I seee just 2 or 3 images. My problem: How can I change the swf width size dynamically? Of yourse I could set the object tag values dynamically, but this would just stretch it. I would like to avoid using a swf file for every screen resolution. Do you know a smarter solution? Kind regards, Nicola ___ 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] FAMES and flashout
I haven't used FAMES myself, so I can't really give you a whole lot of help, but I do vaguely remember something like this from when I was looking into it. One of the tutorials I saw about getting flashout set up was that the class it generates has problems with the latest version of MTASC. There was something about having to go into that file and replace all instances of TRACE with trace. Since you seem to be having problems using TRACE, maybe that's the culprit. Here's the tutorial I was looking at: http://www.communitymx.com/content/article.cfm?cid=F3ECF Hope that helps! -Andy On 3/15/07, quinrou . [EMAIL PROTECTED] wrote: Hi, I am having a problem with the open sources fames I followed this tutorial http://osflash.org/getting_started_with_fames to install all the open sources and did this tuotrial http://theresidentalien.typepad.com/fames/part1.htm http://theresidentalien.typepad.com/fames/part2.htm everything works fine in term of compiling but when i am trying to trace something out to flashout I get the following error message: type error Unknown class TRACE the code that i have for tracing out in my class is TRACE(Flashout.DEBUG + HELLO); any idea in what i have to do? many thanks ___ 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] Export a bitmapData to a PDF on server
Well, if you can already do it to jpg, do you have a way to export the bitmap data to a jpg? Then you can use the process you already have. -Andy On 3/15/07, Flap Flap [EMAIL PROTECTED] wrote: Hi there, Do you people knows a way to export a bitmapData to a pdf on server ? I assume its possible as we can do it for a jpg. I just looking for ready to use script if some of yours know some or just some clue to go. Its for Flash 8 by the way -- Flapflap http://www.kilooctet.net (Dev Blog Flash Fr) ___ 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] Urgent: flash detection error with swf object and query string
What is actually being returned by the server you're hitting? Is it possible that that particular combination of query params is causing something unexpected to be returned, and that page requires some plugin you don't have? -Andy On 3/15/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Came across something that has me baffled. When appending a query string to a URL, certain query string values give me an arror, ie , i'm prompted for a plugin download. for instance ?ecard=21key=a9a08 gives me an error but if I change the last 8 to any other number, or the previous '0' to any other number everytghing works fine! Help please! [e] jbach at bitstream.ca [c] 416.668.0034 [w] www.bitstream.ca ...all improvisation is life in search of a style. - Bruce Mau,'LifeStyle' ___ 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] Accessing an Associative Array
I think this is your problem: showPopup(myarray); You're passing showPopup a string with the value myarray, not the array. Remove the quotes and you should be good. -Andy On 3/12/07, Bill Abel [EMAIL PROTECTED] wrote: How do you access an associate array using a variable? Inside my function popup[text]; won't access the array. I can't find any information in the books I have Actionsript Cookbook and Actionscript for Flash MX. Anyone dealt with this before? // Define the text and titles for the popups var myarray = { text: Lorem ipsum dolor sit amet ... }; // Testing - this works! trace(myarray[text]); // Show the popup function showPopup(popup) { mainMap[popup].gotoAndPlay(on); mainMap[popup].label_title.text = popup[text]; // This doesn't work. trace(popup[text]); }; showPopup(myarray); ___ 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] Flash training suggestions
Weird, my e-mails keep bouncing for this thread. Let's try again: Actionscripting knowledge is about all I do have. I've been working on a fairly complex Flash application for the past 6 months or so (our Flash developer quit and it landed on me), so I've picked up a lot of the programming stuff, but the design stuff like timeline and such I don't really know much about. One other thing I forgot to mention is that I'm also looking at possibly doing FMS training. However, the FMS application development training courses all have prereqs of the FMS Video course, but I'm not doing any Video related stuff with FMS so that course wouldn't really be relevant, though I'm worried that I might have trouble with the FMS course if I didn't take it. Any suggestions there? -Andy On 3/8/07, Kevin Bowers [EMAIL PROTECTED] wrote: Hi, I really don't think you need to worry too much about this. A someone who is actually a trainer for these courses I'd say that if you can do very basic things such as converting items to a symbol, you know a bit about the timeline, frame labels, etc. you'll be absolutely fine on this course. The important thing is that you would need to have some basic action scripting knowledge. Have a look at the Flash 8 Actionscript course outline, if you know that stuff, sign up for the Advanced Design course. Kev Kevin Bowers [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andy Herrman Sent: 08 March 2007 13:44 To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Flash training suggestions Resending as this bounced the first time I tried (so if you already saw this, sorry!): I'm looking for some suggestions on Flash training classes. My Flash devel knowledge is in a somewhat interesting state in that I know the basics and some advanced parts of AS2 programming, but don't really know much at all about using Flash itself (timeline, creating UI objects in the FLA, etc). I've found a few training courses that I could go to, but the ones that look useful to me (the more advanced programming ones) have prereqs of the simpler classes, where most of the material is stuff I already know, with just a few things that I don't. For instance, this class: http://www.trainsimple.com/courses/advanceddesign.html has a lot of things I'd like to learn (Tween, extending MovieClip) but has prereqs requiring both basic AS knowledge which I have and basic Flash design stuff (Rich Content Creation), which I don't have. I don't know if I'd be able to get the company to have me take more than one training course in the near term, and for what I'm doing the advanced class would be much more useful, but I'm not sure if I would have trouble in it due to not knowing the design stuff. Has anyone here been in a similar situation and found training that was helpful without duplicating a lot of what you already knew? Does anyone have any suggestions on training courses that would be good, or even just training companies that people have found to be good? Thanks! -Andy ___ 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] Flash training suggestions
Oh, I completely agree about staying away from timeline actionscript. The first little flash app I did (just a small test app) used the timeline cause I didn't know any better, but I very quickly realized that was the wrong way to go. :) So, the book looks like it's one of the many explaining Design Patterns books out there. I feel like I've already got a pretty good grasp on the language-agnostic application design stuff (including design patterns). I've been doing a lot of work in Java and some in C++. So right now I am looking for Flash-specific stuff. I'm inheriting a flash application that does some fairly complicated stuff (with even more complicated things to be added in the future), and I'm mainly running into not knowing how some things are done in Flash (mostly UI and communication related, but also basic FMS management stuff), or what all its capabilities are. I figure the more I know about Flash's capabilities and APIs the more effectively I can apply the experience I have from other work I've done. -Andy On 3/9/07, Ron Wheeler [EMAIL PROTECTED] wrote: If you are looking to improve your application development skills, invest in this book. I have been heavily involved in ActionScript for the last 6 years and programming for more than 30. This showed me a lot of really useful ways to improve the way applications are constructed. Much more important that new API calls. It gives you a new way to think about application problems. BTW, stay away from timeline ActionScript. It makes for really poor programs that are hard to debug and hard to maintain. 1 frame is enough. Ron http://books.google.ca/books?id=LjJcCnNf92kCdq=head+first+design+patternspsp=1 Andy Herrman wrote: Weird, my e-mails keep bouncing for this thread. Let's try again: Actionscripting knowledge is about all I do have. I've been working on a fairly complex Flash application for the past 6 months or so (our Flash developer quit and it landed on me), so I've picked up a lot of the programming stuff, but the design stuff like timeline and such I don't really know much about. One other thing I forgot to mention is that I'm also looking at possibly doing FMS training. However, the FMS application development training courses all have prereqs of the FMS Video course, but I'm not doing any Video related stuff with FMS so that course wouldn't really be relevant, though I'm worried that I might have trouble with the FMS course if I didn't take it. Any suggestions there? -Andy On 3/8/07, Kevin Bowers [EMAIL PROTECTED] wrote: Hi, I really don't think you need to worry too much about this. A someone who is actually a trainer for these courses I'd say that if you can do very basic things such as converting items to a symbol, you know a bit about the timeline, frame labels, etc. you'll be absolutely fine on this course. The important thing is that you would need to have some basic action scripting knowledge. Have a look at the Flash 8 Actionscript course outline, if you know that stuff, sign up for the Advanced Design course. Kev Kevin Bowers [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andy Herrman Sent: 08 March 2007 13:44 To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Flash training suggestions Resending as this bounced the first time I tried (so if you already saw this, sorry!): I'm looking for some suggestions on Flash training classes. My Flash devel knowledge is in a somewhat interesting state in that I know the basics and some advanced parts of AS2 programming, but don't really know much at all about using Flash itself (timeline, creating UI objects in the FLA, etc). I've found a few training courses that I could go to, but the ones that look useful to me (the more advanced programming ones) have prereqs of the simpler classes, where most of the material is stuff I already know, with just a few things that I don't. For instance, this class: http://www.trainsimple.com/courses/advanceddesign.html has a lot of things I'd like to learn (Tween, extending MovieClip) but has prereqs requiring both basic AS knowledge which I have and basic Flash design stuff (Rich Content Creation), which I don't have. I don't know if I'd be able to get the company to have me take more than one training course in the near term, and for what I'm doing the advanced class would be much more useful, but I'm not sure if I would have trouble in it due to not knowing the design stuff. Has anyone here been in a similar situation and found training that was helpful without duplicating a lot of what you already knew? Does anyone have any suggestions on training courses that would be good, or even just training companies that people have found to be good? Thanks! -Andy ___ Flashcoders@chattyfig.figleaf.com To change your subscription options
[Flashcoders] Re: gotoAndStop problems with swfmill
I think I found the difference. Using swfmill's swf2xml mode and looking at the differences between the swfmill SWF and the Flash IDE SWF I see this: The PlaceObject tags in the swmfill SWF have the 'replace' value set to 0, while in the IDE's SWF the 'replace' value is set to 1. I'm guessing if I can make swfmill set that to 1 it will work, but I'm not sure how to do that through the simple XML format. Any ideas? -Andy On 3/9/07, Andy Herrman [EMAIL PROTECTED] wrote: I'm having a weird problem with using gotoAndStop/gotoAndPlay when using an SWF output by swfmill. I'm trying to implement a class that uses movie clips created in swfmill as button states. The SWF generated by swfmill will contain a clip for each button, which contains 4 frames, one for each button state. The button class will detect which state it should display, and do a 'gotoAndStop()' for the frame that represents that state. Fairly simple stuff. Here's the problem. If I try to change to a state that's defined before the state it's currently displaying it doesn't work, unless I'm going to the very first frame. It keeps displaying the last frame it displayed. However, if I use an SWF with the same data, but generated by the Flash IDE it works perfectly. Probably easiest to explain if I just give you my code. here's the swfmill input: ?xml version=1.0 encoding=iso-8859-1 ? movie width=320 height=240 framerate=12 version=7 background color=#ff/ clip id=upState import=up.jpg/ clip id=downState import=down.jpg/ clip id=overState import=over.jpg/ clip id=disabledState import=disabled.jpg/ frame library clip id=testButton frame name=Up place id=upState depth=1/ stop/ /frame frame name=Over place id=overState depth=1/ stop/ /frame frame name=Down place id=downState depth=1/ stop/ /frame frame name=Disabled place id=disabledState depth=1/ stop/ /frame /clip /library place id=testButton name=testButton depth=1/ textfield id=log width=200 height=50 size=10 font=vera text= x=0 y=30/ place id=log name=log depth=10/ /frame /movie And here's my test code that reproduces the error: class Main { public static function main(mc:MovieClip):Void { var iObj:Object = new Object(); iObj.testButton = mc[testButton]; iObj.log = mc[log]; iObj.count = 0; iObj.setMode = function(mode:String):Void { this.log.text = mode; this.testButton.gotoAndStop(mode); } iObj.func = function():Void { switch(this.count++ % 7) { case 0: this.setMode(Up); break; case 1: this.setMode(Over); break; case 2: this.setMode(Down); break; case 3: this.setMode(Disabled); break; case 4: this.setMode(Down); break; case 5: this.setMode(Over); break; case 6: this.setMode(Up); break; } } iObj.interval = setInterval(iObj, func, 1000); } } I generate the SWF by doing: swfmill simple test.xml test.sw and I compile the code with: mtasc -swf test.swf -main main.as The state changes work fine until it hits case 4. The Down (4) and Over (5) cases just keep displaying the Disabled state. Again, if I replace the swfmill output with the output of the Flash IDE, making the same thing, it works fine. The only thing I can guess is that the frames I created in the IDE were created using Insert Blank Keyframe, but I don't know if that really has any relevance. Anyone run into something like this? Am I just missing something simple in my swfmill XML that would fix this? (I couldn't find any good reference on the swfmill XML format, so I might just be missing something). Thanks! -Andy ___ 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] AS3 parseFloat issue?
I think the problem here is that this: var n2:Number = parseFloat(n2Split[0])*Math.pow(10, parseInt(n2Split[1])); is not the same as doing the math. When you define it as a string the code will convert the number directly, trying to get as close as it can to the value. However, in the code you have there you're not doing the same thing as the string. Math.pow is going to be using floats/doubles in order to calculate the power. The instant that happens you lose accuracy, so before you even do the multiplication you've lost accuracy, so the resulting number won't be the same. So in fact, you aren't deriving the same value. This is the problem with floats. Also, you try to do this to show that they should be the same: trace(n1);//6.30e+51 trace(n2);//6.3e+51 trace(6.30e+51 == 6.3e+51);//true However, n1 != 6.30e+51. 6.30e+51 is simply the approximation that Flash uses when converting it back to a string. It maxes out at a certain number of digits after the decimal point, so the string representation isn't accurate. As your math later shows, there would be more digits way back at the 36th position (where the first digit is the 51st position). I hope that helps to explain it a bit. -Andy On 3/9/07, elibol [EMAIL PROTECTED] wrote: I stated the origin of the number and what I want to do with it. The number is derived from a string using parseFloat, and it simply needs to serve its purpose as an operand in an expression. The relevant point of this discussion is that a hard coded assignment of 6.3e+51 to a Number yields different results than 6.3e+51 parsed from a string using the top level parseFloat() function in as3. It's a matter of consistency, not precision. What I specifically mean: How the number is derived should not affect what it does. The number should simply represent the value it's suppose to. Another experiment to elaborate on this point: var test1_str:String = 6.3e+51; var n1:Number = parseFloat(test1_str); var n2Split:Array = test1_str.split(e+); var n2:Number = parseFloat(n2Split[0])*Math.pow(10, parseInt(n2Split[1])); trace(n1);//6.30e+51 trace(n2);//6.3e+51 trace(6.30e+51 == 6.3e+51);//true trace(n1 == n2);//false trace(n1 == 6.3e+51);//false trace(n2 == 6.3e+51);//true trace(n1-6.3e+51);//1.32922799578491e+36 trace(n2-6.3e+51);//0 On 3/9/07, Ron Wheeler [EMAIL PROTECTED] wrote: If you really have a number with 52 decimal digits of precision required, you can not store it in a double. I believe that a double is only good for about 16-17 digits. What is the origin of such a number and what do you want to do with it? You will have to write all of your own arithmetic or find a package designed to work with large numbers with high precision. There are probably ways to deal with this but ordinary float or double will not do it even in JVM. You may get one test to work but there is no assurance that with a different sequence of operations with different numbers you will not get a different result since the hardware is throwing away the extra precision. Ron elibol wrote: Thank you Jim. To clarify the problem we are discussing, when a string is parsed into a number, and the string is representing a very large number, the number does not yield the expected results when used in an operation. This is demonstrated in the first modulo experiment. This issue does not exist in AVM1 or JVM. From previous data packing experiments, I've found that the last nibble (4 bits) of a 64-bit Number isn't reliable when you're casting to and from Numbers (e.g . reading 8 bytes out of a ByteArray into a Number or doing round-trips via the toString and parseFloat methods). I'm not sure why this is the case--perhaps someone from Adobe can reply and speak to this particular issue. This seems relevant, as 6.3e+51 would require an allocation of 3 64 bit Numbers (approx. 173) to be represented, using at least 2 sets of those 4 unreliable bits you've mentioned. Is this correct? Is there a solution/technique for correctly representing such parsed Numbers? The subject Number will be concerned with properly representing its value in order to be used in any operation supported by as3. Is it impossible to write a parseFloat function that would correctly parse Numbers under the new Number specification? Thank you Fumio and Jim. Note: I posted this 2 days ago and I didn't notice that I got an Undeliverable error. I've been getting these a lot. Not sure what the deal is... On 3/7/07, elibol [EMAIL PROTECTED] wrote: To clarify the problem we are discussing, when a string is parsed into a number, and the string is representing a very large number, the number does not yield the expected results when used in an operation. This is demonstrated in the first modulo experiment. This issue does not exist in AVM1 or JVM. On 3/7/07,
Re: [Flashcoders] AS3 parseFloat issue?
Oh, and this: parseFloat(n2Split[0]) also adds errors. The number (6.3) probably can't be accurately represented in float/double format, so it's not quite 6.3 (it might be 6.3005123412, for example). So, when you then multiply it by the power of 10 it won't be the same as when it was simply parsed from the full string. -Andy On 3/9/07, Andy Herrman [EMAIL PROTECTED] wrote: I think the problem here is that this: var n2:Number = parseFloat(n2Split[0])*Math.pow(10, parseInt(n2Split[1])); is not the same as doing the math. When you define it as a string the code will convert the number directly, trying to get as close as it can to the value. However, in the code you have there you're not doing the same thing as the string. Math.pow is going to be using floats/doubles in order to calculate the power. The instant that happens you lose accuracy, so before you even do the multiplication you've lost accuracy, so the resulting number won't be the same. So in fact, you aren't deriving the same value. This is the problem with floats. Also, you try to do this to show that they should be the same: trace(n1);//6.30e+51 trace(n2);//6.3e+51 trace(6.30e+51 == 6.3e+51);//true However, n1 != 6.30e+51. 6.30e+51 is simply the approximation that Flash uses when converting it back to a string. It maxes out at a certain number of digits after the decimal point, so the string representation isn't accurate. As your math later shows, there would be more digits way back at the 36th position (where the first digit is the 51st position). I hope that helps to explain it a bit. -Andy On 3/9/07, elibol [EMAIL PROTECTED] wrote: I stated the origin of the number and what I want to do with it. The number is derived from a string using parseFloat, and it simply needs to serve its purpose as an operand in an expression. The relevant point of this discussion is that a hard coded assignment of 6.3e+51 to a Number yields different results than 6.3e+51 parsed from a string using the top level parseFloat() function in as3. It's a matter of consistency, not precision. What I specifically mean: How the number is derived should not affect what it does. The number should simply represent the value it's suppose to. Another experiment to elaborate on this point: var test1_str:String = 6.3e+51; var n1:Number = parseFloat(test1_str); var n2Split:Array = test1_str.split(e+); var n2:Number = parseFloat(n2Split[0])*Math.pow(10, parseInt(n2Split[1])); trace(n1);//6.30e+51 trace(n2);//6.3e+51 trace(6.30e+51 == 6.3e+51);//true trace(n1 == n2);//false trace(n1 == 6.3e+51);//false trace(n2 == 6.3e+51);//true trace(n1-6.3e+51);//1.32922799578491e+36 trace(n2-6.3e+51);//0 On 3/9/07, Ron Wheeler [EMAIL PROTECTED] wrote: If you really have a number with 52 decimal digits of precision required, you can not store it in a double. I believe that a double is only good for about 16-17 digits. What is the origin of such a number and what do you want to do with it? You will have to write all of your own arithmetic or find a package designed to work with large numbers with high precision. There are probably ways to deal with this but ordinary float or double will not do it even in JVM. You may get one test to work but there is no assurance that with a different sequence of operations with different numbers you will not get a different result since the hardware is throwing away the extra precision. Ron elibol wrote: Thank you Jim. To clarify the problem we are discussing, when a string is parsed into a number, and the string is representing a very large number, the number does not yield the expected results when used in an operation. This is demonstrated in the first modulo experiment. This issue does not exist in AVM1 or JVM. From previous data packing experiments, I've found that the last nibble (4 bits) of a 64-bit Number isn't reliable when you're casting to and from Numbers (e.g . reading 8 bytes out of a ByteArray into a Number or doing round-trips via the toString and parseFloat methods). I'm not sure why this is the case--perhaps someone from Adobe can reply and speak to this particular issue. This seems relevant, as 6.3e+51 would require an allocation of 3 64 bit Numbers (approx. 173) to be represented, using at least 2 sets of those 4 unreliable bits you've mentioned. Is this correct? Is there a solution/technique for correctly representing such parsed Numbers? The subject Number will be concerned with properly representing its value in order to be used in any operation supported by as3. Is it impossible to write a parseFloat function that would correctly parse Numbers under the new Number specification? Thank you Fumio and Jim. Note: I posted this 2 days ago and I didn't notice that I got
[Flashcoders] Flash training suggestions
Resending as this bounced the first time I tried (so if you already saw this, sorry!): I'm looking for some suggestions on Flash training classes. My Flash devel knowledge is in a somewhat interesting state in that I know the basics and some advanced parts of AS2 programming, but don't really know much at all about using Flash itself (timeline, creating UI objects in the FLA, etc). I've found a few training courses that I could go to, but the ones that look useful to me (the more advanced programming ones) have prereqs of the simpler classes, where most of the material is stuff I already know, with just a few things that I don't. For instance, this class: http://www.trainsimple.com/courses/advanceddesign.html has a lot of things I'd like to learn (Tween, extending MovieClip) but has prereqs requiring both basic AS knowledge which I have and basic Flash design stuff (Rich Content Creation), which I don't have. I don't know if I'd be able to get the company to have me take more than one training course in the near term, and for what I'm doing the advanced class would be much more useful, but I'm not sure if I would have trouble in it due to not knowing the design stuff. Has anyone here been in a similar situation and found training that was helpful without duplicating a lot of what you already knew? Does anyone have any suggestions on training courses that would be good, or even just training companies that people have found to be good? Thanks! -Andy ___ 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] Flash training suggestions
Actionscripting knowledge is about all I do have. I've been working on a fairly complex Flash application for the past 6 months or so (our Flash developer quit and it landed on me), so I've picked up a lot of the programming stuff, but the design stuff like timeline and such I don't really know much about. One other thing I forgot to mention is that I'm also looking at possibly doing FMS training. However, the FMS application development training courses all have prereqs of the FMS Video course, but I'm not doing any Video related stuff with FMS so that course wouldn't really be relevant, though I'm worried that I might have trouble with the FMS course if I didn't take it. Any suggestions there? -Andy On 3/8/07, Kevin Bowers [EMAIL PROTECTED] wrote: Hi, I really don't think you need to worry too much about this. A someone who is actually a trainer for these courses I'd say that if you can do very basic things such as converting items to a symbol, you know a bit about the timeline, frame labels, etc. you'll be absolutely fine on this course. The important thing is that you would need to have some basic action scripting knowledge. Have a look at the Flash 8 Actionscript course outline, if you know that stuff, sign up for the Advanced Design course. Kev Kevin Bowers [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andy Herrman Sent: 08 March 2007 13:44 To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Flash training suggestions Resending as this bounced the first time I tried (so if you already saw this, sorry!): I'm looking for some suggestions on Flash training classes. My Flash devel knowledge is in a somewhat interesting state in that I know the basics and some advanced parts of AS2 programming, but don't really know much at all about using Flash itself (timeline, creating UI objects in the FLA, etc). I've found a few training courses that I could go to, but the ones that look useful to me (the more advanced programming ones) have prereqs of the simpler classes, where most of the material is stuff I already know, with just a few things that I don't. For instance, this class: http://www.trainsimple.com/courses/advanceddesign.html has a lot of things I'd like to learn (Tween, extending MovieClip) but has prereqs requiring both basic AS knowledge which I have and basic Flash design stuff (Rich Content Creation), which I don't have. I don't know if I'd be able to get the company to have me take more than one training course in the near term, and for what I'm doing the advanced class would be much more useful, but I'm not sure if I would have trouble in it due to not knowing the design stuff. Has anyone here been in a similar situation and found training that was helpful without duplicating a lot of what you already knew? Does anyone have any suggestions on training courses that would be good, or even just training companies that people have found to be good? Thanks! -Andy ___ 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] preloader give
Have you tried doing a trace() of both tLoaded and tBytes? It might help you figure out what's going on. Also, why not just do `if(tLoaded = tBytes)`? It seems kind of pointless to do a division there. -Andy On 3/8/07, natalia Vikhtinskaya [EMAIL PROTECTED] wrote: Hi I use simple preloader function loadNewPart(part){ host._visible=false; this.attachMovie(preloader, preloader, 999, preloaderPos); host.loadMovie(part); this.onEnterFrame=function() { var tLoaded, tBytes; tLoaded = this.host.getBytesLoaded(); tBytes = this.host.getBytesTotal(); if (isNaN(tBytes) || tBytes 4) { return; } if (tLoaded / tBytes = 1) { this.host.stop(); delete this.onEnterFrame; this.preloader.removeMovieClip(); _root.showNewPart(); } else { this.host.stop(); var percentLoaded = (tLoaded /tBytes); this.preloader.preloadBar._width = this.preloader.preloadBarBG._width * percentLoaded; } } } but tLoaded always = tBytes and preloader bar does not works. Swf loads without preloadbar just on blank screen. Because the first check (if (tLoaded / tBytes = 1) is always true. How it can be possible? I am trying to find a reason for some hours and can not. Any idea? ___ 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] Updating old source
So, by source, do you mean code, or are there graphics objects as well? If it's just code then why not open them in 10.2 where it works and then copying the code out to text files? -Andy On 3/8/07, David Cohn [EMAIL PROTECTED] wrote: Hey all, I'm trying to update some old, old source FLA files which were last updated in Flash MX (the original development preceeded even that), and I'm having trouble with some of the files-- i.e. Flash crashes on opening them! The old source is on a Mac 10.2.8 system, and I need to get the files editable on Mac 10.4.8. I've tried: 1. copying the MX files from 10.2 and opening them with Flash 8 on 10.4 2. installing MX 2004 on 10.2, saving and compacting the files, copying and opening them with Flash 8 on 10.4 3. installing MX 2004 on 10.4, and opening the MX04 source with MX 2004 on 10.4 4. opening the MX source in MX 2004 on 10.4 In both cases, I updated MX04 to v7.2. In all cases, the same few files crash Flash (except #4, where the files wouldn't open at all). Anybody run into this, or have any ideas on how I can salvage the source? Thanks, --Dave ___ 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] clearInterval(0);
I would suggest initializing the interval value as NULL instead of 0, since I think 0 is a valid ID. That way you can be sure you don't accidentally clear an interval that you don't want to. -Andy On 3/4/07, Alain Rousseau [EMAIL PROTECTED] wrote: Well actually, clearInterval(0) clears the interval ID 0 lets say you have an interval defined : var myInt:Number = setInterval(this, doSomething, 1000); then it is possible that myInt = 0. The value of myInt is set by calling setInterval, which returns the ID of the interval, so doing clearInterval(0) is the same as doing clearInterval(myInt) but otherwise it doesn't do anything if no interval ID 0 exists Adam Pasztory wrote: Wow, lots of interval questions lately... :) I don't believe clearInterval(0) does anything. However, the code you posted looks correct. -Adam ___ 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