Re: [Flashcoders] Dynamic upload of bunch of images with automaticsmooth.
Thank you for replies BUT. :) If i use mr. Muzaks code, i dont know how can i add my new image into right movieclip I need to add child to walkerMc.figure.head.imgholder. The handleComplete is triggered when an image is loaded. I am parsing the XML file, looping through nodes, some have images, some dont, some pictures are bigger(load slower), some smaller(load faster). How can i add the new child to right target? Hope you can understand what i am talking about :) Thanks Irene for(var k:Number=1; k<=itemNr; k++){ usrNr++; var walker1:MovieClip = new walker(); walker1.x = k*150+ Math.random()*40; //walker1.y = Math.random()*5; walker1.name = "walker"+k; walker1.i = i; walker1.k = k; this["row"+i].addChild(walker1); var walkerMc:MovieClip = this["rad"+i].getChildByName("walker"+k) as MovieClip; if(xml..epic[usrNr-1].text()!= undefined){ //upload picture var loader:Loader = new Loader(); walkerMc.figure.head.imgholder.addChild(loader); loader.load(new URLRequest(theURL+"img/"+xml..epic[usrNr-1].text())); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, handleComplete, false, 0, true); }else{ //show random face walkerMc.figure.head.faces.gotoAndStop(xml..spic[brukerNr-1].text()); } } function handleComplete(event:Event){ var ldr:Loader = LoaderInfo(event.currentTarget).loader as Loader; ldr.contentLoaderInfo.content.width=43; ldr.contentLoaderInfo.content.height=43; var image:Bitmap = Bitmap(ldr.contentLoaderInfo.content); image.smoothing = true; } On 2/4/08, EECOLOR <[EMAIL PROTECTED]> wrote: > > Another problem here may be the quality property on the object/embed tag. > If > it is auto high it might for some cases switch to non-smoothing to benefit > the performance. This will change if you set the property to high. > > > Greetz Erik > > On 2/3/08, Muzak <[EMAIL PROTECTED]> wrote: > > > > Check the example in the docs. > > You need to create a copy of the original (loaded) image, add it to the > > display list and remove the (original) loaded image > > > > > > > http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Bitmap.html > > > > Here's an example of loading an image and displaying a copy next to it: > > > > import flash.display.Loader; > > import flash.net.URLRequest; > > import flash.display.Bitmap; > > > > var loader:Loader; > > var req:URLRequest; > > var orig_mc:MovieClip; > > var copy_mc:MovieClip; > > > > function loaderCompleteHandler(evt:Event) { > > var ldr:Loader = evt.currentTarget.loader as Loader; > > var origImg:Bitmap = (ldr.content as Bitmap) > > origImg.width = 200; > > origImg.height = 150; > > > > var image:Bitmap = new Bitmap(origImg.bitmapData, "auto", true); > > image.width = 200; > > image.height = 150; > > copy_mc.addChild(image); > > } > > > > loader = new Loader(); > > req = new URLRequest("2.jpg"); > > loader.load(req); > > loader.contentLoaderInfo.addEventListener(Event.COMPLETE, > > loaderCompleteHandler); > > > > orig_mc = new MovieClip(); > > orig_mc.addChild(loader); > > addChild(orig_mc); > > > > copy_mc = new MovieClip(); > > copy_mc.x = 210; > > addChild(copy_mc); > > > > > > regards, > > Muzak > > > ___ > 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] AS3 dynamic scrollbar that resizes onStageResize, but is not fullscreen- script?
Hello again :) I was googling a lot but i could not find any as3 scrollbar that automatically resizes when windows is bigger. Has anyone seen/ is a proud owner, and does not mind to share that kind of script. Cheers Irene ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Dynamic upload of bunch of images with automatic smooth.
Hello all you fine people! I have a big problem with uploading smooth images. What I do is, i load XML file, parse it loop through it, create movieclips, and load images into thos movieclips (if image is specified in xml) for(var k:Number=1; k<=itemNr; k++){ usrNr++; var walker1:MovieClip = new walker(); walker1.x = k*150+ Math.random()*40; //walker1.y = Math.random()*5; walker1.name = "walker"+k; walker1.i = i; walker1.k = k; this["row"+i].addChild(walker1); var walkerMc:MovieClip = this["rad"+i].getChildByName("walker"+k) as MovieClip; if(xml..epic[usrNr-1].text()!= undefined){ //upload picture var loader:Loader = new Loader(); walkerMc.figure.head.imgholder.addChild(loader); loader.load(new URLRequest(theURL+"img/"+xml..epic[usrNr-1].text())); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, handleComplete, false, 0, true); }else{ //show random face walkerMc.figure.head.faces.gotoAndStop(xml..spic[brukerNr-1].text()); } } function handleComplete(event:Event){ var ldr:Loader = LoaderInfo(event.currentTarget).loader as Loader; ldr.contentLoaderInfo.content.width=43; ldr.contentLoaderInfo.content.height=43; var image:Bitmap = Bitmap(ldr.contentLoaderInfo.content); image.smoothing = true; } I get to load images, but they are not allways smooth :( What am i doing wrong :( Thanks in advance Irene ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] FLVPlayback
Thanks on your reply, but have a function connected to main menu which tells flash to go to a different frame for different sections. If i put this (FLVPlayBackInstance.stop()) inside that function, it will work if the video is played->if i am in that video section, but if i am in different section it will fail, because the video player is not there. G. Irene On 2/1/08, Kenneth Kawamoto <[EMAIL PROTECTED]> wrote: > > Just fire FLVPlayBackInstance.stop(); when you are leaving the current > frame. > > Kenneth Kawamoto > http://www.materiaprima.co.uk/ > > > Irene Johansson wrote: > > Hello! > > I am having a FLVPlayback component inside a movieclip. > > Now when video is playing and i click on main menu to go to a different > > section, the video is not displayed but it is still playing. > > How can I detect that video is not anymore on stage and stop playing it? > > Thanks > > 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
[Flashcoders] FLVPlayback
Hello! I am having a FLVPlayback component inside a movieclip. Now when video is playing and i click on main menu to go to a different section, the video is not displayed but it is still playing. How can I detect that video is not anymore on stage and stop playing it? Thanks Irene :) ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] How to call class method from a movieclip?
Thanks people for all replies. Need to stop thinking in old AS1 way :) On 1/31/08, Jesse Graupmann <[EMAIL PROTECTED]> wrote: > > Funny! Your mom said the same thing to me last night... > > ;) > > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Steven > Sacks > Sent: Wednesday, January 30, 2008 11:04 AM > To: Flash Coders List > Subject: Re: [Flashcoders] How to call class method from a movieclip? > > Jesse Graupmann wrote: > > function callMom () > > { > > trace( "YOU NEVER CALL" ); > > } > > While we appreciate your code sample, Jesse, and we're all supportive of > you, Flashcoders isn't a surrogate for your group therapy sessions. ;) > > Steven Sacks > Flash Maestro > Los Angeles, CA > -- > blog: http://www.stevensacks.net > gaia: http://www.gaiaflashframework.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 > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] How to call class method from a movieclip?
Thank you for your reply. by doing this: public class myClass extends Sprite{ public function myClass() { var contentMCs:MovieClip; = new contentMC(this); } public function myMethod(){ } } I get this error msg: 1137: Incorrect number of arguments. Expected no more than 0. since contentMC is a MovieClip that is attached from library i dont know where to define the parameters. Thanks for helping me Irene On 1/30/08, Andy Herrman <[EMAIL PROTECTED]> wrote: > > 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 > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] How to call class method from a movieclip?
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