RE: [Flashcoders] help stopping an external clip on as3
Hi Gustavo, Try this: var mc:MovieClip = myLoader.content as MovieClip; mc.stop(); or MovieClip(myLoader.content).stop(); Either one should work. hth, Bob -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Gustavo Duenas Sent: Friday, January 16, 2009 10:43 AM To: Flash Coders List Subject: [Flashcoders] help stopping an external clip on as3 Ok Coders I have a loader which loads a external movieclip, and I want it to stop when I say, but unfortunately all my efforts are useless I've been using. in some frame. myLoader.stop(); and nothing or myLoader.stop; and is the same...any ideas? every time is the same error, someone(there is no reference to stop() in the display library???) knows how to stop it? Gustavo D. Gustavo A. Duenas ___ 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] Getting attributes out of a node with : in it
Check out the Namespace class, as it applies to XML, in the Flash docs. There's also a good explanation in this tutorial by Lee Brimelow: http://gotoandlearn.com/play?id=65 hth, Bob -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Eric E. Dolecki Sent: Monday, February 09, 2009 10:37 AM To: Flash Coders List Subject: [Flashcoders] Getting attributes out of a node with : in it For example I have a node like so: How can I get into that node to pull attributes out? The ":" in the node name is screwing my up at the moment. Eric ___ 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] swf paths...
Hi Maurice, How about sending it in as a URL variable when you load preloader.swf into the html page? In the HTML: ... Then in preloader.swf: var ojtParams:Object = this.loaderInfo.parameters; var swfPath:String = ojtParams.path; hth, Bob -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of maurice sallave Sent: Wednesday, June 03, 2009 1:30 PM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] swf paths... Hello! First time on here, so thanks for any advice. I'm pulling in a preloader.swf file into an html file that sits at root "swf/preloader.swf". All my swf's are located in a swf directory that gets preloaded into this preloader.swf - simple enough. I'd like to try to keep my server as clean as possible without having to hard-code the path into the preloader.swf file and don't want to use flashvars as a way of referencing my targeted path. Is there another way of doing this? Of course if I put the html file inside the swf directory, everything works, but it defeats the purpose of keeping my server organized. I hope this makes sense and again thanks in advance. ___ 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] swf paths...
Here's another version: var str:String = "http://www.yourDomain.com/dir1/dir2/dir3/preloader.swf";; var intFirst:int = str.indexOf(".com/") +5; var intLast:int = str.lastIndexOf("/")+1; var intPathLen:int = intLast - intFirst; // var serverName:String = str.substr( 0, intFirst ); var directoryPath:String = str.substr( intFirst, intPathLen ); var fileName:String = str.substr( intLast ); // trace( "serverName: "+serverName, "\ndirectoryPath: "+directoryPath, "\nfileName: "+fileName ); Cheers, Bob -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of maurice sallave Sent: Wednesday, June 03, 2009 3:11 PM To: Flash Coders List Subject: Re: [Flashcoders] swf paths... Thanks for the replies. I'll be looking into both. kind of been playing around with this as well: str = _url; slash = str.lastIndexOf("/"); str = str.substring(slash+1, str.length); dot = str.lastIndexOf("."); filename = str.substring(0, dot); directoryLocation = _url.split(filename + ".swf").join(""); and setting it to frame 1. On Wed, Jun 3, 2009 at 2:15 PM, Robert Leisle wrote: > Hi Maurice, > > How about sending it in as a URL variable when you load preloader.swf into > the html page? > > In the HTML: > > >... > > > > Then in preloader.swf: > var ojtParams:Object = this.loaderInfo.parameters; > var swfPath:String = ojtParams.path; > > > hth, > Bob > > > -Original Message- > From: flashcoders-boun...@chattyfig.figleaf.com > [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of maurice > sallave > Sent: Wednesday, June 03, 2009 1:30 PM > To: flashcoders@chattyfig.figleaf.com > Subject: [Flashcoders] swf paths... > > Hello! > First time on here, so thanks for any advice. > I'm pulling in a preloader.swf file into an html file that sits at root > "swf/preloader.swf". All my swf's are located in a swf directory that gets > preloaded into this preloader.swf - simple enough. I'd like to try to keep > my server as clean as possible without having to hard-code the path into > the > preloader.swf file and don't want to use flashvars as a way of referencing > my targeted path. Is there another way of doing this? Of course if I put > the html file inside the swf directory, everything works, but it defeats > the > purpose of keeping my server organized. I hope this makes sense and again > thanks in advance. > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] ReferenceError: Error #1065 issue
Hi list, This should be simple, but for some reason refuses to cooperate. I'm working in AS3, CS3. I've got a super class (HsSegment) and a subclass (HsSegment_qtd1), both are public. In the super class are the definitions for many methods, including this definition: protected function mthGetPDataTag(stgInput:String):String { //...Do stuff and return a String... } In the subclass I've got the call to this method: var stgEg:String = mthGetPDataTag(stgInput); When testing in the IDE this works fine. When testing in the browser I get a runtime error, "ReferenceError: Error #1065: Variable hs.segments.classes:HsSegment_qtd1::mthGetPDataTag is not defined." I've googled and found plenty of questions around this, but no answers, other than 'make your classes public', which they are. The other methods in the super class are defined and called essentially this same way and work fine in both IDE and browser. What makes this one special? What am I missing? Any help is appreciated. Thanks, Bob ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] ReferenceError: Error #1065 issue
Thanks Mario! I actually found the solution to this. It was my own mistake, of course. I've got a base level swf loading in a child swf which contains the super class and subclass mentioned below. Turns out the loading swf also uses the super class, and I hadn't recompiled it in the process. It was loading the older version of the super class into memory first, so the updated definition compiled into the child swf was not being used. Thanks again for your response, Bob -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of mario Sent: Saturday, June 20, 2009 4:52 PM To: Flash Coders List Subject: Re: [Flashcoders] ReferenceError: Error #1065 issue If you override that function like so, does it compile (to make sure the override is correct) and do you see the trace (to make sure the call is correct)? override protected function mthGetPDataTag(stgInput:String) :String { trace('call worked') return ''; } -- Mario Gonzalez http://onedayitwillmake.com Senior Developer | WDDG.com Leisle wrote: > Hi list, > > This should be simple, but for some reason refuses to cooperate. I'm working > in AS3, CS3. > I've got a super class (HsSegment) and a subclass (HsSegment_qtd1), both are > public. In the super class are the definitions for many methods, including > this definition: > > protected function mthGetPDataTag(stgInput:String):String > { > //...Do stuff and return a String... > } > > In the subclass I've got the call to this method: > var stgEg:String = mthGetPDataTag(stgInput); > > When testing in the IDE this works fine. When testing in the browser I get > a runtime error, > "ReferenceError: Error #1065: Variable > hs.segments.classes:HsSegment_qtd1::mthGetPDataTag is not defined." > > I've googled and found plenty of questions around this, but no answers, > other than 'make your classes public', which they are. > The other methods in the super class are defined and called essentially this > same way and work fine in both IDE and browser. What makes this one special? > > What am I missing? Any help is appreciated. > > Thanks, > Bob > > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > __ Information from ESET NOD32 Antivirus, version of virus signature database 4172 (20090619) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Equivalent of setCharAt to change a character in a string
Does this not work for you? // Change the first instance only var myPattern:RegExp = /sh/; // Change all instances //var myPattern:RegExp = /sh/g; var str:String = "She sells seashells by the seashore."; trace(str.replace(myPattern, "sch")); // She sells seaschells by the seashore. Hth, Bob -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul Steven Sent: Tuesday, July 14, 2009 8:50 AM To: 'Flash Coders List' Subject: [Flashcoders] Equivalent of setCharAt to change a character in a string Probably something really simple but can't for the life of me recall the syntax to change a particular character of a string. For example if I have the word "Flash" and want to change the letter "a" to an "e", I was hoping there was a function like setCharAt(2, "e"); Btw I am coding in AS3. Thanks paul ___ 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] Equivalent of setCharAt to change a character in a string
Ah yes. I missed that part. How about this moderately less simple one using Kenneth's suggestion? function swapCharAt(s:String, index:Number, char:String ):String{ var ptrn:RegExp = new RegExp("(.{"+index+"}).(.*)"); return( (s).replace(ptrn, "$1"+char+"$2") ); } trace( swapCharAt("Flash", 2, "e") ); hth, Bob -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul Steven Sent: Tuesday, July 14, 2009 10:32 AM To: Flash Coders List Subject: Re: [Flashcoders] Equivalent of setCharAt to change a character in a string Thanks Robert - yes I am able to replace patterns but just wondered If simple way to change a particular character in a string based on the character index? Thanks Paul Sent from my iPhone On 14 Jul 2009, at 18:10, "Robert Leisle" wrote: > Does this not work for you? > > // Change the first instance only > var myPattern:RegExp = /sh/; > // Change all instances > //var myPattern:RegExp = /sh/g; > var str:String = "She sells seashells by the seashore."; > trace(str.replace(myPattern, "sch")); > // She sells seaschells by the seashore. > > Hth, > Bob > > -Original Message- > From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders- > boun...@chattyfig.figleaf.com] On Behalf Of Paul Steven > Sent: Tuesday, July 14, 2009 8:50 AM > To: 'Flash Coders List' > Subject: [Flashcoders] Equivalent of setCharAt to change a character > in a string > > Probably something really simple but can't for the life of me recall > the syntax to change a particular character of a string. > > For example if I have the word "Flash" and want to change the letter > "a" to an "e", I was hoping there was a function like setCharAt(2, > "e"); > > Btw I am coding in AS3. > > Thanks > > paul > > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] RE: as3 progress bar?
Hi Michael, Where is the Loader in relation to "this"? Is docClass an extension of Loader? Your listener will need to be attached to the LoaderInfo of the Loader you're trying to track. Attaching it to the stage won't work, since ProgressEvents do not bubble up. Once the listener is listening to the correct object, trying tracing out the values returned in the ProgressEvents. Also, in this line if(p.bytesLoaded == p.bytesTotal), you may want to do this if(p.bytesTotal > 4 && p.bytesLoaded == p.bytesTotal), since bytesLoaded and bytesTotal will be equal before any bytes are loaded, which will kill your listener. Hth, Bob -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Mendelsohn, Michael Sent: Monday, November 09, 2009 10:16 AM To: Flash Coders List Subject: [Flashcoders] RE: as3 progress bar? A little more info: My flash file is 600k, so it needs a progress bar. I am also trying stage.addEventListener(Event.ENTER_FRAME, showLoading); But that isn't working either. It's just showing my loading graphic when the whole swf is loaded. I think the issue is the loading graphic is attached to the stage too late. Any ideas? Thanks, - Michael M. ___ 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] Changing display index on the stage
Hi, //Assumes mc1 is on the stage and has linkage set to "mc1" var mc2:MovieClip = new MovieClip(); addChild(mc2); addChild(mc1); hth, Bob -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of natalia Vikhtinskaya Sent: Wednesday, May 05, 2010 10:17 AM To: Flash Coders List Subject: [Flashcoders] Changing display index on the stage Hi Is it possible to have mc1 manually placed on stage be over mc2 created dynamically mc2=new MovieClip(); addChild(mc2) ___ 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] Button addEventListener is cancelled out by my Timerfunction.
Hi Vlado, It looks like your button is probably on the timeline rather than make instantiated with code. Make sure your button exists before you do the addEventListener() on frame 25. Also, do you maybe have a key frame in the button layer at frame 65? If so, each key frame creates a new instance of the button and any properties of the new instance will have the default values until you reset them. To avoid the problem you described, just remove the key frames and give your button a continuous, uninterrupted layer for the whole length of the time line that you need it. hth Bob Leisle Headsprout Software & Engineering www.headsprout.com Where kids learn to read! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Vlado Krempl Sent: Monday, February 25, 2008 5:13 AM To: Flash Coders List Subject: [Flashcoders] Button addEventListener is cancelled out by my Timerfunction. Timeline problem: As soon as my "pauseTimeline" function is called on frame 65, my button "infoONEbtn doesn't register on frame 65. And after frame 65, my button doesn't work unless I call the addEventlistener again on frame 66. Is there a way around this?? I have this code on frame 10 function pauseTimeline(howLong:Number):void { stop(); var t:Timer = new Timer (howLong, 1); t.addEventListener( TimerEvent.TIMER, function(evt:TimerEvent):void { play(); } ); t.start(); } then this code on frame 25 //infoONEbutton infoONEbtn.addEventListener(MouseEvent.MOUSE_UP, infoONESCENE); function infoONESCENE(evt:MouseEvent) { gotoAndPlay("infoONE"); } this code on frame 65 pauseTimeline(3000); Thankyou for bothering with my simple problems. Vlado Please consider the environment before printing this e-mail. The contents of this message should be treated as COMMERCIAL IN CONFIDENCE unless otherwise specified in the message and is intended solely for the use of the individual or entity to whom it is addressed. If you have received this email in error please notify the sender. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] RangeError: Error #2006: The supplied index is out ofbounds.
Hi Anuj, According to Flash Help files for getChildAt(), this error is generated by getChildAt() when, "RangeError - Throws if the index does not exist in the child list." Either your "aa" variable is not evaluating correctly inside the function or there is no child object at depth index 0 when the function is called. Hth, Bob Leisle Headsprout Software & Engineering www.headsprout.com Where kids learn to read! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of anuj sharma Sent: Monday, February 25, 2008 1:20 PM To: Flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] RangeError: Error #2006: The supplied index is out ofbounds. Hi Guys I am making an Auto-Arrange button and clicking on which arranges all the children of the container( which are on the main stage) in the tile format. Basically on clicking, I manually move those child on the stage to particular coordinates as shown in my code. I have pasted my code below. My problem is that as soon as i click on the auto arrange button I am getting error "RangeError: Error #2006: The supplied index is out of bounds.". Please let me know what i am doing wrong and i will appreciate if you let me know how would i fix this Thanks a lot guys Anuj **CODE** var aa:Number=0; var xcoord:Number=-300; var ycoord:Number=-200; var xcoord1:Number=450; var xcoord2:Number=850; var xcoord3:Number=1250; var ycoord1:Number=350; var ycoord2:Number=650; //Button Listener btn_AA.addEventListener(MouseEvent.CLICK,autoArrange); function autoArrange(event:MouseEvent):void { if(container.getChildAt(aa)!=null) { container.getChildAt(aa).x=xcoord; container.getChildAt(aa).y=ycoord; //Arrange Second container.getChildAt(aa+1).x=xcoord+xcoord1; container.getChildAt(aa+1).y=ycoord; //Arrange Third container.getChildAt(aa+2).x=xcoord+ xcoord2; container.getChildAt(aa+2).y=ycoord; //Arrange Forth container.getChildAt(aa+3).x=xcoord+xcoord3; container.getChildAt(aa+3).y=ycoord; //Arrange Fifth container.getChildAt(aa+4).x=xcoord; container.getChildAt(aa+4).y=ycoord+ycoord1; //Arrange Sixth container.getChildAt(aa+5).x=xcoord+xcoord1; container.getChildAt(aa+5).y=ycoord+ycoord1; //Arrange Seventh container.getChildAt(aa+6).x=xcoord+ xcoord2; container.getChildAt(aa+6).y=ycoord+ycoord1; //Arrange Eight container.getChildAt(aa+7).x=xcoord+xcoord3; container.getChildAt(aa+7).y=ycoord+ycoord1; //Arrange Ninth container.getChildAt(aa+8).x=xcoord; container.getChildAt(aa+8).y=ycoord+ycoord2; //Arrange Tenth container.getChildAt(aa+9).x=xcoord+xcoord1; container.getChildAt(aa+9).y=ycoord+ycoord2; //Arrange Eleventh container.getChildAt(aa+10).x=xcoord+ xcoord2; container.getChildAt(aa+10).y=ycoord+ycoord2; } } ___ 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] A simple question for getting Object info.
Hi ACE, This works: var bookList:Object = { BOOK1:{isbn:"155209328X",Price:"$19.95.",Title:"This is Book1 Title"}, BOOK2:{isbn:"0072231726",Price:"$24.95.",Title:"This is Book2 Title"} }; for (var book:* in bookList) { trace(book); for (var i:* in bookList[book]) { trace("\t"+i+": "+bookList[book][i]); } } /*Output: BOOK1 Price: $19.95. isbn: 155209328X Title: This is Book1 Title BOOK2 Price: $24.95. isbn: 0072231726 Title: This is Book2 Title */ Hth, Bob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of ACE Flash Sent: Friday, May 02, 2008 2:12 PM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] A simple question for getting Object info. Hi there, I could use for... in script to retrieve BOOK1, BOOK2 as below. Do you know how can I retrieve all data inside of {} for BOOK1, BOOK2? I tried to use for..each..in script... but I could only get the OBJECT. Thank you var bookList:Object = { BOOK1:{isbn:"155209328X",Price:"$19.95.",Title:"This is Book1 Title"}, BOOK2:{isbn:"0072231726",Price:"$24.95.",Title:"This is Book2 Title"} }; for (var bok:* in bookList) { trace(bok); } //for each (var bok:* in bookList) { //trace(bok); //} ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] AS3 For loop proplem
Hi SJM, It looks like you're setting the persistent var, _mcName, to equal each _summaryElement[i].sumImg in turn as the loop progresses. That means that when the loop is finished, the value for _mcName will be a reference to _summaryElement[4].sumImg, the last clip being loaded. Since your loop undoubtedly runs faster than the loading process, what your imgLoadComplete handler is actually doing is this, _summaryElement[4].sumImg.addChild(ev.target.content). It wouldn't be surprising if you looked at the contents of _summaryElement[4].sumImg and found that all the images are added to its display list as each load completes. I would either get rid of the persistent var and find a way to use an ID number to link the loaded images and the containers, OR add this line to your loadImage method, _mcName.addChild(imageLoader);, and forget the event listener (at least for doing the addChild). Hth, Bob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Tuesday, May 06, 2008 9:54 AM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] AS3 For loop proplem This code should load a MovieClip from the library 5 times, place each on the stage and then load a different image into each one Instead it loads the 5 MovieClips from the library, places them on the stage and then only loads the image into the last (5th) MovieClip, whats going wrong? this code will not run as its stripped var itemList:XMLList = locationInfo.item; for (var i = 0; i < itemList.length(); i++) // Loops through 5 times { _summaryElement[i] = loadLibrary(summaryContainer); // Load our MovieClip from the library loadImage("images/" + i + ".jpg", _summaryElement[i].sumImg); // Should load image into _summaryElement[i].sumImg which is a blank placeholder movieclip } function loadImage(filename:String, mcName:MovieClip):void { _mcName = mcName; // Contains MovieClip object (object 1 through 5) var imageLoader:Loader = new Loader(); var imageURL:URLRequest = new URLRequest(filename); imageLoader.load (imageURL); imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imgLoadComplete); } function imgLoadComplete(ev:Event):void { _mcName.addChild(ev.target.content); // This should add the loaded image into the placeholder movieclip for each of the 5 MovieClips } SJM ___ 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] Why isn't my TextField multiline? AS2
Hi Alistair, Try adding this to your code: tmpField.wordWrap = true; Hth, Bob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alistair Colling Sent: Wednesday, May 07, 2008 10:03 AM To: Flash Coders List Subject: [Flashcoders] Why isn't my TextField multiline? AS2 Hi there, thanks for checking this. I'm generating a textfield from within a custom class but I can't seem to make it multiline, I can see the border of the textfield is the right size my text only appears on the first line and also my carriage returns "\r" are having no effect. I've tried a number of options for properties of the textfield but I cant seem to get it to work. Any suggestions thankfully received this is taking lots of time for a simple thing! Cheers, Ali Here's the code from within my class: var oline:MovieClip = mainMC.monkey.bubble.outline var tmpBox:MovieClip = mainMC.monkey.bubble.createEmptyMovieClip ("text_mc", 1); var tmpField:TextField = tmpBox.createTextField("my_txt", 1, oline._x, oline._y, oline._width, oline._height); tmpField.selectable = false; tmpField.border = true; tmpField.embedFonts = true; tmpField.type = "dynamic"; tmpField.multiline = true; tmpField.text = Q.monkeyStr; tmpField.setTextFormat(myM); ___ 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] Firefox popup blocker and flash 9
This is probably not what your client wants to hear but the question has to be asked. Isn't Firefox popup blocker there for a reason? When blocking is active there is a message when a popup is attempted. Users have the choice to block or not, or to white-list your popups. I recommend allowing them that choice. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dan Wade Sent: Wednesday, May 28, 2008 4:22 PM To: Flash Coders List Subject: [Flashcoders] Firefox popup blocker and flash 9 I'm having problems with Fireox blocking my popup windows. I've tried everything I can think of. It seems to happen on Windows running Firefox but I can't replicate the issue on all machines I've tested(it works on most machines but not all). Here is the class I'm using: package { import flash.external.ExternalInterface; public class URLUtil{ protected static const WINDOW_OPEN_FUNCTION : String = "window.open"; public static function openWindow(url : String, window : String = "_blank", features : String = "") : void { ExternalInterface.call(WINDOW_OPEN_FUNCTION, url, window, features); } } } //being called this way function recholder1Release(event:MouseEvent) { URLUtil.openWindow(res1link); } Any ideas? TIA, -D ___ 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] E4X filtering strange behaviour
Hi Jason, This works for me: var testXML:XML = ; var re:RegExp = new RegExp(searchInput.text, "g"); var xmlListSearch:XMLList = testXML.topics.topic.(re["test"](@title)); trace("result: "+xmlListSearch.toXMLString()); Hth, Bob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Merrill, Jason Sent: Monday, July 21, 2008 12:27 PM To: Flash Coders List Subject: RE: [Flashcoders] E4X filtering strange behaviour OK, so this is almost there, but not quite. If I do as Kenneth suggested (and this should be able to be reproduced), var testXML:XML = ; var re:RegExp = new RegExp("^"+searchInput.text); var xmlListSearch:XMLList = testXML.topics.topic.(re["test"](@title)); trace("result: "+xmlListSearch.toXMLString()); (Assuming there is a TextInput text field on the stage and a function run when a button is clicked to run the regex search), if I enter the search term, "The", it only returns the second node containing "The Dark Knight", not the third topic node, which has a "The" in it's title attribute as well. If I put "Dark", it doesn't return anything. So it seems it's only searching nodes where the search term is the first item. How can I modify the regular expression above to find all nodes containing an element of the search term? Thanks, Jason Merrill Bank of America Enterprise Technology & Global Risk L&LD Instructional Technology & Media Join the 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 GT&O 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] ColorPicker.selectedValue to #hex?
Hi Jason, Is something like this what you need? function dec2hex(input):String { var hex:Number; var stgHex:String = uint(input).toString(16); while (stgHex.length < 6){ stgHex = "0"+stgHex; } stgHex = "0x"+stgHex; return stgHex; } function hex2dec(input):String { return String(uint(input)); } // test run var decColor:Number = 102; var hexColor:String = dec2hex(decColor); trace("hex: "+hexColor); trace("dec: "+hex2dec(hexColor)); hth, Bob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Merrill, Jason Sent: Thursday, July 24, 2008 10:47 AM To: Flash Coders List Subject: [Flashcoders] ColorPicker.selectedValue to #hex? How can I translate the ColorPicker.selectedValue to a 6 digit hex number? i.e. if the color selected is, 66, if I trace ColorPicker.selectedColor, traces 102. I tried gooling for an Actionscript hex converter, but didn't come up with anything. Thanks. Jason Merrill Bank of America Enterprise Technology & Global Risk L&LD Instructional Technology & Media Join the 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 GT&O 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] Re: How to avoid little blink while loading another movie
You could also load the SecondLine.swf slightly before you actually want to display it, but delay adding it to the display list until you do want to display it. var myUILoader:UILoader=new UILoader(); myUILoader.height=23.6; myUILoader.move(-17,-1); myUILoader.source="SecondLine.swf"; Then at the moment it should be displayed do this: removeChild(mc_FirstLine); // ( OR mc_FirstLine.visible=false; ) addChild(myUILoader); hth, Bob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of sebastian Sent: Tuesday, September 02, 2008 11:21 AM To: Flash Coders List Subject: Re: [Flashcoders] Re: How to avoid little blink while loading another movie Hi, Presumably the blink is caused by the delay between your loading movie being called and you setting its state to visible=false. You can resolve that in a few ways: 1. have the swf you load in already be visible=false, pre-set in the external file. 2. load the swf off-stage coordinates and then move it to the stage only after you set visible=false 3. set the alpha of the loading clip to zero, load the child then set visible to false and restore the alpha as needed Hope this helps, maybe someone else has a better solution. anuj sharma wrote: > I am sorry i forgot to mention i am using UILoader componenet for loading > that external SWF , if you guys have any other container in mind for this > purpose i would be happy to use that. > Thanks > Anuj > > On Tue, Sep 2, 2008 at 11:01 AM, anuj sharma <[EMAIL PROTECTED]> wrote: > >> Hi All >> I am building a simple tween movie in which a line just goes from left to >> right and as soon as it reaches the end point I need to call external swf >> file and need to make the already running tween movie invisible. Everything >> is working fine except when i reach at the end of the movie and calling >> external swf file , it shows a little blink (for a fraction of second) to >> signify that something external has been loaded. I do not want my >> aaplication to show that it is loading some external files. Can i avoid that >> fraction of second of delay (blink showing unloading and loading movies). >> Here's my code which i used at the end of my first tween movie. >> >> import fl.containers.UILoader; >> >> mc_FirstLine.visible=false; >> var myUILoader:UILoader=new UILoader(); >> myUILoader.height=23.6; >> myUILoader.move(-17,-1); >> myUILoader.source="SecondLine.swf"; >> addChild(myUILoader); >> >> Please let me know if we can , any help and suggestions will be highly >> appreciated. >> Thanks >> Anuj >> > ___ > 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] getting loader to work with security policy...
Hi Boyd, Yes, you'll need to do import flash.system.Security; to use the loadPolicyFile method. Also, in your crossdomain.xml, you'll need to include , or The way it is coded now will only allow the specific domain, http://boyd-speer.com. Any differences to that (www, dev, etc.) will cause a mismatch and the domain will not be allowed. Hth, Bob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of BOYD SPEER Sent: Tuesday, September 09, 2008 11:24 AM To: Flash Coders List Subject: [Flashcoders] getting loader to work with security policy... I'm having some diffuculty getting a loader object to call a php script that puts some data into the database (mysql) and returns a string. I placed a crossdomain.xml doc on the website at the level of the .swf. but can't seem to verify whether the policy doc is loaded or not. In AS3 do I have to do something like: import flash.security.* to enable the code: var loader:URLLoader = new URLLoader(); loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR,securityErrorListe ner); Security.loadPolicyFile("http://www.boyd-speer.com/autoinfo/Irish/src/crossd omain.xml"); loader.addEventListener(Event.COMPLETE,loadcomplete); loader.load(request); function loadcomplete(evt:Event):void { fscommand("loadcompleted..."); ___ 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] What REALLY causes an IOError?
Hi all, I am trying to drill deeper into Flash player IOError handling in AS3, in order to distinguish different types of load failures when loading child swfs and data into a parent swf. For instance, I need to know, and react differently to, loads errors where the file is missing altogether vs. loads where severe network congestion mid-load interrupts a load after a part of the file has been received. Can anyone offer some deeper information on exactly what initial condition(s) triggers an IOError event? Is it time-based (no bytes loaded in N ms), a reaction to a server response, something else? I've been googling and reading through Adobe docs all morning and haven't seen anything deeper than the often repeated, but largely unhelpful Adobe line: "FlashR Player dispatches an IOErrorEvent object when an error causes a send or load operation to fail." I'm looking for more depth than that. A definition of "error" and the criteria used to decide the load was a failure, for instance, would be a good start. Any info. or directions to look would be greatly appreciated. Thanks, Bob ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] SSL and Flash in IE6
Hello group, I've run searches in the archives, google and other groups and am unable to find a cause for this: I've built a very simple Flash MX (6) test swf file, uploaded it to an http server. Its only task is to load a small data file (.txt) from another server (same domain) through https, using a LoadVars, and display the data in a text field. When running the test, I'm also using a packet sniffer tool and can see that the data is retrieved back to my machine, but it is not getting to the Flash player. My test swf indicates that the data was not received. This happens in the Flash 6, 7, and 8 players, only in Internet Explorer. The data load works as expected in Netscape and Firefox, in all players. If I retrieve the data through unencripted http, the test works fine in IE also. It only fails in IE when the data is transfered via https. I've tweaked IE security and privacy settings. I've added "https://"; to the codebase and pluginspage params in the html. I've added "secure='false'" to the crossdomain.xml. I've submitted it to the Macromedia bug report site. Any insite would be greatly appreciated! Cheers! ~ Bob Leisle Headsprout Software & Engineering http://www.headsprout.com Where kids learn to read! ___ 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] String problems?
What is it you're trying to do? Your code is written correctly to get the result you described. Is that not the result you were after? Flash Mel wrote: I am writing this wrong: controller_mc.attachMovie("gallery_mc", "gallery_mc", 50); theGallery = controller_mc.gallery_mc; gallery_contains = 4; for (i = 0; ihttp://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 -- ~ Bob Leisle Headsprout Software & Engineering http://www.headsprout.com Where kids learn to read! ___ 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] LOADVARS not working IE
I had this same issue last month. Here's the advice I got (Thanks to Mark Llobrera) on this board. It was right on target for me. Hope it helps you too. You may want to check this posting: http://www.blog.lessrain.com/?p=276. As I understand it, if the server is returning no-cache headers for the data you're trying to load it may fail in IE. I say may because I've only run into this problem when loading XML data over SSL in IE, not a plain .txt file. Something tells me your problem may be related, however. Good luck Johnny Zen wrote: capturephp = new LoadVars(); nr = nr + 0; ticker = null; setInterval (refresh_loadvars_timer,5000); //rotate timer// var crt_comp = 0; function rotate_timer() { i = current_comp; comp_name = eval("comp_name"+i); comp_date = eval("date_from_php"+i); reg_players = eval("reg_players"+i); comp_status = eval("comp_status"+i); //rotate fields current_comp = (current_comp + 1) % nr; }; refresh loadvars function refresh_loadvars_timer() { rotate_timer(); capturephp.load("https://secure.*.co.uk/***/infoflash.php";); test.text = ("output" + capturephp); registered_comp.text = comp_name; date_time_starting.text = comp_date; players_registered.text = reg_players; current_status.text = status; }; ___ 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 -- ~ Bob Leisle Headsprout Software & Engineering http://www.headsprout.com Where kids learn to read! ___ 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
You're defining the onRelease function before outside_btn.swf is loaded. Wrap your onRelease definition in an onLoadComplete function to solve your problem: http://livedocs.macromedia.com/flashlite/2/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=0708.html Christopher Whiteford wrote: I am having a problem with figuring out why I am having scoping issues with a rollover button. I am trying to load a swf file "outside_btn.swf" in that has a movie with an instance name of smBtn on the main timeline. now I have done traces from the button that indeed returns "_level.smFindBtn1_mc.smBtn" but yet I still cant get teh onRelease to execute. var smFindBtn1_mc:MovieClip = this.createEmptyMovieClip("smFindBtn1_mc", this.getNextHighestDepth()); var smFindBtn1:MovieClipLoader = new MovieClipLoader(); smFindBtn1.loadClip("outside_btn.swf", smFindBtn1_mc); smFindBtn1_mc.smBtn.onRelease = function(){ getURL("www.yahoo.com") }; Does anyone have any ideas? ___ 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 -- ~ Bob Leisle Headsprout Software & Engineering http://www.headsprout.com Where kids learn to read! ___ 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:Flashcoders] Extending Array Question
You could also do: var myArray:ArrayExtension = new ArrayExtension(); myArray.push("Hello", "Goodbye", "World"); same result as doing them separately. [EMAIL PROTECTED] wrote: Thanks, that will work. So there is no definitive way to add the values all at once, i.e. [1,4,5,76,3] when extending an Array? Thanks again. Ian Thomasn wrote: Hi there (whoever you are!) Your problem is that the [1,2,3] initialiser syntax is actually a short cut for creating a new Array() object, not an ArrayExtension(). So you're replacing the object you just created with new(). What you need to do is to _modify_ your ArrayExtension() object, not replace it. If you try: var myArray:ArrayExtension = new ArrayExtension(); myArray.push("Hello"); myArray.push("Goodbye"); myArray.push("World"); That should sort your problem. HTH, Ian ___ 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 -- ~ Bob Leisle Headsprout Software & Engineering http://www.headsprout.com Where kids learn to read! ___ 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