how to delelte mc in as3


Hi ,

How can i delete mc in as3. I know the option "removeChild", in this the mc is not deleted, it is removed from the stage or from any mc. it still exists.

Suppose, I am creating mc's dynamically from a loop say enter frame, the no of mc will go on increase till the loop continues and it occupies space, and reduces the animation speed(if i give animation for the new mc's).

I know this is done in as2. Please help me for getting done in as3.

Posted On: Thursday 3rd of January 2013 10:21:22 PM Total Views:  290
View Complete with Replies

RELATED TOPICS OF Flash / ActionScript PROGRAMMING LANGUAGE




mc to fit to screen in full screen mode

Hi , Can any one know how to make a movieclip fit to screen in fullscreen mode. I tried with "stage.displayState=StageDisplayState.FULL_SCREEN; ". But it is now working correctly, it varies when the size of the height and width of the document are changed.
VIEWS ON THIS POST

93

Posted on:

Thursday 25th October 2012
View Replies!

access mc reference from another frame

Hi , Is it possibile to access a mc, which is present in next frame While we are focusing in the previous frame. I need to feed some data for the mc which is in next frame. So, How to get that name of the mc
VIEWS ON THIS POST

136

Posted on:

Thursday 25th October 2012
View Replies!

mc isn't located orrectly until browser is resized

Hi , New to posting on Kirupa. I do read through older posts and threads for help but I haven't found a great answer to my little problem, so I thought I'd post. I have a full-browser flash site, with a movie clip horizontal nav bar at the bottom of the page. I've got everything working well (the background rescaling to fill the browser when the browser window size changes, the horizontal nav bar at the bottom....) for the most part. One thing is really getting to me however. Check out the example I made here: http://www.rachelahampton.com/mon.html Upon loading, the nav bar sits in the middle of the page. The moment you re-size the browser, it pops into the deed location near the bottom and stays there, even if you continue to re-size. However I want it to appear where it should at the bottom of the window on page load, without having to re-size the browser window. In the following code, main is the placeholder for the image slideshow that runs in the full browser, menu_mc is the menu. import com.greensock.TweenLite; import fl.motion.easing.*; import flash.events.MouseEvent; //set stage for FBF //set stage for FBF stage.align = "TL"; stage.scaleMode = "noScale"; //define dynamic aspect ratios var mainHeight = main.height / main.width; var mainWidth = main.width / main.height; //add event listener to the stage stage.addEventListener(Event.RESIZE, sizeListener); //conditional statement to account for various initial browswer sizes and proportions function scaleProportional():void { if ((stage.stageHeight / stage.stageWidth) < mainHeight) { main.width = stage.stageWidth; main.height = mainHeight * main.width; } else { main.height = stage.stageHeight; main.width = mainWidth * main.height; }; } //center picture on stage function centerPic():void { main.x = stage.stageWidth / 2; main.y = stage.stageHeight / 2; } // make listener change picture size and center picture on browser resize function sizeListener(e:Event):void { scaleProportional(); centerPic(); } //run initial locations and size scaleProportional(); centerPic(); stage.addEventListener(Event.RESIZE, resizeListener); function resizeListener (e:Event):void { menu_mc.x = 960; menu_mc.y = stage.stageHeight-75; } TweenLite.to(main, 1, {alpha:1}); TweenLite.to(menu_mc, 1, {alpha:1});
VIEWS ON THIS POST

147

Posted on:

Thursday 25th October 2012
View Replies!

Targeting mc children only

Hi everybody, i want to target all the mc nested in a parent mc and I'm using this script Code: for (var i:uint = 0; i
VIEWS ON THIS POST

343

Posted on:

Thursday 25th October 2012
View Replies!

problem with loading random mc to stage

, Simple question probably to most of you but i can't get it to work, hope you can help. so i have 3 mc's in my library each with linkage "icon1", icon2", icon3". what i'm trying to do is load one of them randomly in to the stage. here's the code i have so far: Code: //creating an array that holds the mcs var iconsarray:Array = new Array("mc1","mc2","mc3"); //creating a random number to use for loading the mc var randmc:Number = Math.round (Math.random ()*2)+0; //this is just a string to hold the mc with the number, not used var all:String = (iconsarray[randmc]); //defining the mc's var mc1:icon1 = new icon1(); var mc2:icon2 = new icon2(); var mc3:icon3 = new icon3(); //this works fine addChild(mc1); //this spits an error: //Error #1034: Type Coercion failed: cannot convert "mc2" to //flash.display.DisplayObject. addChild(iconsarray[randmc]); //this trace works perfect and displays the random mc name i was looking for //trace (iconsarray[randmc]); what am i doing wrong
VIEWS ON THIS POST

98

Posted on:

Thursday 25th October 2012
View Replies!

From root load frame label in mc (AS3)

, I need help from flash masters. Simple question. From root I want to load frame labels in a movie clip called mySampleMC First frame label is "one" Second frame label is "two" .... How to do that Please help.
VIEWS ON THIS POST

113

Posted on:

Thursday 25th October 2012
View Replies!

AS3: need help with dynamically adding multiple mc to one mask

hello, i'm trying to add movieclips to a single mask. but i cant seem to get it to work. is there a easy way to do this or do i have to remove the mask-child and add a new one again
VIEWS ON THIS POST

224

Posted on:

Thursday 25th October 2012
View Replies!

html link inside a mc.mouseChildren = false ?

how could I have a clickable html link inside a movieClip which has mouseChildren set to false probably nohow but I still got to ask
VIEWS ON THIS POST

90

Posted on:

Thursday 25th October 2012
View Replies!

Stacking as3 elements under FLA elements.

Hi. I made a .as Class where some graphical elements are spawned into the stage. However, the Flash (.fla) have some internal graphics that are supposed to be over the graphical elements spawned from the custom class. I tried to make another layer over the layer where the as3 Class is being called, but unfortunately it doesn't do anything, the graphic from the .as still appearing over the internal .fla graphics. How I can make sure the .FLA graphics are appearing over the .as3 graphics (Am I clear)
VIEWS ON THIS POST

205

Posted on:

Thursday 25th October 2012
View Replies!

Bring your big brain here... xml and as3...

Code: var library:XML=; library.book = ; library.book.@bookID = 124; library.book.(@bookID = 124).page.@pageNumber = 1; library.book.(@bookID = 124).page.@pageNumber = 2; library.book.(@bookID = 124).page.@pageNumber = 3; trace(library); // this traces: // // // // // I would like my book to have three pages... anyone with a big brain have some ideas Ps - trying to do it without a loop
VIEWS ON THIS POST

214

Posted on:

Thursday 25th October 2012
View Replies!

removingChild from customclass

Okay, I've got a simple piece of hit detection below, when they detect a hit, they call a couple of custom functions from the classes. Well, I can't use 'removeChild' here cause it would remove the object before the 'die' animation plays. So I figure I have to remove the object from the class. How I am a noob so forgive me if I've skewered a few terms. Code: for(var b=0; b
VIEWS ON THIS POST

119

Posted on:

Thursday 25th October 2012
View Replies!

kaspersky doesn't like as3's url!

Kirupians! [Summary ] I don't know if anybody had already encountred this bug, but, it seems that kaspersky in IE6 doesn't like the opening of popup windows by flash's as3. ExternalInterface.call ("function setWMWindow() {window.open('" + url + "', '" + target + "', '" + features + "');}"); [SYMPTOMS ] i know that many browsers have isues with mouse events used in buttons to triger url opening, that's why i use MouseEvent.CLICK for caling the above code. [MORE INFORMATION ] when i disable kaspersky evrything works fine in all tested browsers; FF, IE.. Thanx for reading!
VIEWS ON THIS POST

247

Posted on:

Thursday 25th October 2012
View Replies!

as3 loader

hello, i just setup this loader i found on the net: Code: var l:Loader = new Loader(); l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop); l.contentLoaderInfo.addEventListener(Event.COMPLETE, done); l.load(new URLRequest("world.jpg")); function loop(e:ProgressEvent):void{ var perc:Number = e.bytesLoaded / e.bytesTotal; percent.text = Math.ceil(perc*100).toString(); } function done(e:Event):void{ removeChildAt(0); percent = null; addChild(l); } what i dont understand is that everytime i click the refresh page the loader shows up again(this time loading the image faster) but if the image is already in cache the loader should not show at all (), i would like to achieve a loader that loads the image and after dont come up again everytime.
VIEWS ON THIS POST

264

Posted on:

Thursday 25th October 2012
View Replies!

AS3: use an mc to mask dynamically loaded images

I have created a custom 3d wall gallery and I would like to mask it to give it right and left fades. I have posted the code that places the images on the stage but for the life of me I cannot mask it. Themc in the library mask_mc already has the correct gradient so now how do I add it to the top of the dynamic gallery Any thoughts
VIEWS ON THIS POST

136

Posted on:

Thursday 25th October 2012
View Replies!

active inactive button state in pure as3 (no mc)

Hi all, I want to create a set of buttons based on loaded images from xml that onClick turn red or grow in size, whatever, Clicking another turns that button red and the old one back to default. Alsoo it will attach a animated movieclip onclick to the button and when pressing another button, it swifts to that button. Code: var tracktype:Array = new Array; var imgArray:Array = new Array; var links:int; var locx:Array = new Array; var locy:Array = new Array; var loc:Array = new Array; var lname:Array = new Array; function showXML(e:Event):void { XML.ignoreWhitespace = true; var sitemap:XML = new XML(e.target.data); links = sitemap.link.length(); var i:int = 0; for (i = 0; i < links; i++) { loc.push(sitemap.link.loc[i].text()); locx.push(sitemap.link.locx[i].text()); locy.push(sitemap.link.locy[i].text()); tracktype.push(sitemap.link.tracktype[i].text()); lname.push(sitemap.link.name[i].text()); if (mapEnabled) { var loader:Loader=new Loader(); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, GenerateSpots); loader.load(new URLRequest("images/hotspots/"+ tracktype[i]+".png")); } } } } function GenerateSpots(event:Event):void { imgArray.push(event.currentTarget.loader); if(imgArray.length==links) { for(var n:int=0;n
VIEWS ON THIS POST

244

Posted on:

Thursday 25th October 2012
View Replies!

Dyn created mc inner object access/change...

Here is the scenario: I have an MC in the library (call it "MC"). It consists of 2 shapes (symbols) "MCback" and "MCframe" and dynamic TextBox "MCtext". I create 10 instances of this mc on the stage. Now I wanna go in, grab a reference to one of the instances and change ".text" of the internal dyn textBox "MCtext". I also wanna change color of the existing shapes/symbols in the mc. Now I have to be doin something wrong as Im unable to do that. Can you give me an example or point me in the right direction please... thx
VIEWS ON THIS POST

114

Posted on:

Thursday 25th October 2012
View Replies!

How to create a mc instance?

Hi , I'm loading an external image trough this code: var richiesta:URLRequest = new URLRequest("img/foto1.jpg"); var immagine:Loader = new Loader(); immagine.load(richiesta); addChild(immagine); Now all works fine but I don't know how to use this image. If I want for exemple change the alpha of this loaded image how to do this Do i have to make a new instance of it Can you help me please
VIEWS ON THIS POST

50

Posted on:

Thursday 25th October 2012
View Replies!

Setting up Eclipse for as3 development.

Hiya folks. This is may be a silly question, but bare with me. I am currently using flashdevelop for my "home" work, but to be honest having gotten used to the benefits of eclipse at work i am finding flashdevelop a bit lacking. Mainly the ability to use breakpoints and watch the flash step through process by process and keep track of variables and accessible properties. I basically want to replace flashdevelop with eclipse, (i am not using flex), and i'd like to keep the ability that flashdevelop has to integrate easily with the flash ide (for quick running of the app with ctrl enter, and also for easy integration of the flash ide's library). I am thinking maybe this isn't possible, but i hope it is because it would be an insanely good development environment. Any thoughts
VIEWS ON THIS POST

208

Posted on:

Thursday 25th October 2012
View Replies!

reading iptc metadata with as3

hello. is it possible to read the iptc metadata of a jpeg loaded with as3
VIEWS ON THIS POST

194

Posted on:

Thursday 25th October 2012
View Replies!

[cs4][3d] as3 equivalent of global/local option

Hi! If I change some 3d property via as3, how do set the global/local option usually available under the tools palette Is there a way
VIEWS ON THIS POST

239

Posted on:

Thursday 25th October 2012
View Replies!

as3 Tweening Head-scratcher

Hi . here is a wierd one for you. I cant get my head around it. Im trying to create an animated carosel type thing. I have a main class that loads xml and then external images into a class I called Image which is just really a wrapper for Loader. I have a previous and next buttons that use array methods to move the Image instances around in an array and then sends the correct Image to 3 classes that represent my 3 image positions in my carousel. Heres the important snippet in my main class: Code: private function onPrev(e:MouseEvent):void { _images.unshift(_images.pop()); for (var i:int = 0; i
VIEWS ON THIS POST

185

Posted on:

Thursday 25th October 2012
View Replies!

Flash as3 application Examples

Can you please give me the best sites/examples of as3 application..
VIEWS ON THIS POST

185

Posted on:

Thursday 25th October 2012
View Replies!

as3 physics issue

! The thing is i'm trying to make an effect that emmulates hanging interactive objects so that when the user hits any object it moves according to the mouse position and speed. My problem is that i cant find the way to apply the tension and the "pendulum" kind of movement so it looks natural. any thoughts thanx alot!
VIEWS ON THIS POST

121

Posted on:

Thursday 25th October 2012
View Replies!

Random images not repeated in other mc's

hi, I'm not really a coder so i'd love any help you could give. Basically I have 9 empty movie clips and I want them to be randomly filled with a jpg from external swfs which is fine but I don't want any of the 9 movie clips to show the same image as any of the other 8.I think I should set up arrays but am not sure how they would work. here is the code for loading theempty movie clips choice = Math.round(Math.random()*24); switch (choice) { case 0 : location.loadMovie("image0.swf"); break; case 1 : location.loadMovie("image1.swf"); break; case 2 : location.loadMovie("image2.swf"); break; case 3 : location.loadMovie("image3.swf"); break; case 4 : location.loadMovie("image4.swf"); break; case 5 : location.loadMovie("image5.swf"); break; case 6 : location.loadMovie("image6.swf"); break; case 7 : location.loadMovie("image7.swf"); break; case 8 : location.loadMovie("image8.swf"); break; case 9 : location.loadMovie("image9.swf"); break; case 10 : location.loadMovie("image10.swf"); break; case 11 : location.loadMovie("image11.swf"); break; case 12 : location.loadMovie("image12.swf"); break; case 13 : location.loadMovie("image13.swf"); break; case 14 : location.loadMovie("image14.swf"); break; case 15 : location.loadMovie("image15.swf"); break; case 16 : location.loadMovie("image16.swf"); break; case 17 : location.loadMovie("image1.swf"); break; case 18 : location.loadMovie("image18.swf"); break; case 19 : location.loadMovie("image18.swf"); break; case 20 : location.loadMovie("image18.swf"); break; case 21: location.loadMovie("image18.swf"); break; case 22 : location.loadMovie("image18.swf"); break; case 23 : location.loadMovie("image18.swf"); break; case 24 : location.loadMovie("image18.swf"); break
VIEWS ON THIS POST

56

Posted on:

Thursday 25th October 2012
View Replies!

[CS3] how to move a mc in a class

this seems so simple, yet I'm having issues with it. I'm starting out simple, all I'm having problems with is repositioning my mc with a function in the class, which is not the document class. here is some code: Code: package boxes{ import flash.display.MovieClip; public class box0 extends MovieClip{ import flash.display.DisplayObjectContainer; public var doc:DisplayObjectContainer; static var bs:MovieClip; public function box0(){ bs = new box1(); //box1 is a movie clip } public function addBox(a:MovieClip){ a.addChild(bs); } public function moveBox(){ bs.x = 100; } } } and here is the code on the timeline: Code: import boxes.box0; var box:box0= new box0(); box.addBox(this); box.moveBox(); the box is added to the stage, but is not positioned at 100 ! any help would be greatly appreciated!!
VIEWS ON THIS POST

102

Posted on:

Thursday 25th October 2012
View Replies!

how to refer to mc in .fla from imported .as

AS3. i give up!! please point me in the right direction... i have a html page of .fla's that act like buttons and play external mp3s. i will be making more buttons and fiddling with them in the future, so i'm trying to create one Master.as that controls the basic functionality of each. so, i've made a class as Master.as which contains all the original code i had in the .fla. then, i've successfully (i think) imported the package into Movie.fla. Movie.fla has an instance "button_mc". but i can't figure out how to refer to Movie.fla's "button_mc" from within Master.as consequently, of course, i get a slew of "1120: Access of undefined property button_mc" i've tried root, parent, this, that and the other thing to no avail...
VIEWS ON THIS POST

64

Posted on:

Thursday 25th October 2012
View Replies!

[help]as3 xml error

So I'm playing around with xml and as3. Now I got this: Code: var fileList:XMLList = bookInput.Songs.file1; And now I want that if you push a button, file1 changes in file2. So I got this: Code: var j:uint=1; But when I change the first snipped in this: Code: var fileList:XMLList = bookInput.Songs.file+j; it gives this error: TypeError: Error #1034: Type Coercion failed: cannot convert "1" to XMLList. How to fix it
VIEWS ON THIS POST

220

Posted on:

Thursday 25th October 2012
View Replies!

XML Menu (giving mc unique instance name)

Ok so I found this tutorial for building an XML menu but what it fails to do explain how to give each nav an instance name so I can bring in content or whatever. Can anyone please tell me what I need to do so that I can add an event listener to each movieclip.
VIEWS ON THIS POST

82

Posted on:

Thursday 25th October 2012
View Replies!

Access FLVPlayback component's seekBarHandle_mc

I have created a custom skin for the FLVPlayback component and added a textField within the seekBarHandle_mc that I want to show the current playhead time. The FLVPlayback class doesn't give direct access to this, and I can't figure out any other way to update the textField with the time. I also tried accessing the component from within the skin, and failed at that again. Can anyone give me a heads up on how I can access the seekBarHandle_mc so I can modify its properties and children that I have added within the skin.
VIEWS ON THIS POST

85

Posted on:

Thursday 25th October 2012
View Replies!

horizontal DD menu with as3

Does anyone have an example of a horizontal drop down menu using AS3
VIEWS ON THIS POST

90

Posted on:

Thursday 25th October 2012
View Replies!

Time to convert, as2 to as3

Apologies if this is the wrong place for my thread. I've happily been using ActionScript 2 for a very long time now, and am very comfortable with it. Whenever I even try to use AS3, the amount of Syntax errors I come across is overwhelming. So I always end up resorting back to AS2. I like to think "if it ain't broke, don't fix it". However, after slowly watching some of the amazing potential AS3 has to offer; I think it's time I move on, and get with the times. So I ask you, are there any handy websites or tutorials you can guide me to, that specifically deal with people trying to wean themselves off AS2 and onto AS3. Distinct things that are now missing from AS2, or common Syntax error resolutions. My AS2 knowledge is good, and all I can find out there for AS3 is either extremely different, or far too advance. I just hope AS3 really isnt that different Thank you.
VIEWS ON THIS POST

95

Posted on:

Thursday 25th October 2012
View Replies!

mc scale tool

, I found this on Senocular's site: http://www.senocular.com/flash/source.phpid=0.193 I was wondering if anyone knows a more simple version that just scales the movieclip by dragging the corner It doesn't have to be 9slice or skewable.
VIEWS ON THIS POST

50

Posted on:

Thursday 25th October 2012
View Replies!

How can I open a new (_blank) browser window in as3?

Opening a new window in as3 triggers popup blockers on some browsers. How do I get around this problem I need a solution that will work on all browsers and all minor versions of Flash player 9. Like it worked in AS2 with: on(release) { getURL("http://www.adobe.com", "_blank"); } I have done some testing with different ways of opening a new window and with different "wmode"s. But have not found a generic solution that will work on all browsers. To many are blocked by browsers popup blocker. Anyone out there got a solution for me Adobe I have also set up a testpage for checking different browsers. Take a look here: http://kunde.apt.no/paal/ Also check out the results from my testing here (green is OK, red is blocked): http://kunde.apt.no/paal/results.html
VIEWS ON THIS POST

91

Posted on:

Thursday 25th October 2012
View Replies!

dynamic variable names, set() and eval() as2 to as3

hello i've been trying to rewrite this code (it's from flash 8 tutorial) in as3. the problems started with phrasing xml file. here's what i did so far. Code: var loader:URLLoader = new URLLoader(); loader.addEventListener(Event.COMPLETE, loadXML); loader.load(new URLRequest("menu_nav.xml")); var ID:Array = new Array; var DisplayName:Array = new Array; var LinkType:Array = new Array; var LinkValue:Array = new Array; var topMenuNum = 0; function loadXML(e:Event):void { var xml:XML = new XML(e.target.data); trace ("the number of total children is... " + xml.children().length()); var i = 0; while ( i < xml.children().length()) { ID.push(xml.children()[i].attributes()[0]); DisplayName.push(xml.children()[i].attributes()[1]); LinkType.push(xml.children()[i].attributes()[2]); LinkValue.push(xml.children()[i].attributes()[3]); if (ID[i] == "TM") { topMenuNum = topMenuNum +1; } i = i +1; } trace ("the total number of top menu items is... " + topMenuNum); } now i have some serious problems with this part (it should be before i=i+1). it's to keep track of how many submenu items there will be. Code: set ("submenu_Finish_" + ID[i] , i); if ( eval(".submenu_Start_" + ID[i]) == undefined ) { set ("submenu_Start_" + ID[i] , i); Total_subs = Total_subs + 1; } set ("Total_Items_in_Submenu_" + ID[i] , eval( "submenu_Finish_" + ID[i]) - eval( "submenu_Start_" + ID[i]) + 1); there was _global in front of every variable. i removed it coz i dont think it would affect the code at this point
VIEWS ON THIS POST

117

Posted on:

Thursday 25th October 2012
View Replies!

load external image in mc

Is that possible in as3 to load an external image (Bitmap) in a movieclip
VIEWS ON THIS POST

49

Posted on:

Thursday 25th October 2012
View Replies!

need help creating active blur class in as3

hi I came across this awsome class created by pixelfumes called an active blur class. they offer up the source files on there site. the class is written in as2; however, I am trying to convert it to as3 but I am having troubles doing so. can anyone help me. here is a link to an example of what it is I want to acheive. http://www.pixelfumes.com/blog/apr07...BlurClass.html and here is a link to the source files http://pixelfumes.blogspot.com/searchq=active+blur
VIEWS ON THIS POST

87

Posted on:

Thursday 25th October 2012
View Replies!

text wont show inside of mc

HELP!!! Ive been trying to figure out this issue for the past 2 hrs, I can get the text to show up on the root, but when I stick in into an MC, it wont show up. Does anyone have any ideas as to why Here is my code: Code: // variables var popInfo:popMc; var xmlList:XMLList; var mcLoader:Loader; // load xml var xml:XML = new XML(); var loader:URLLoader = new URLLoader(); loader.load(new URLRequest("data/cities.xml")); loader.addEventListener(Event.COMPLETE, function(evt:Event):void { xml = XML(evt.target.data); var url:URLRequest = new URLRequest(xml.city[0].@weburl.toString()); xmlList = xml.children(); for(var i:int = 0; i < xmlList.length(); i++) { // attach carBtn from library and assign x,y coords from xml var carBtn:carBtn_mc = new carBtn_mc(); carBtn.x = xml.city[i].@mcCarX.toString(); carBtn.y = xml.city[i].@mcCarY.toString(); addChild(carBtn).name = "carBtn" + i; trace(carBtn.name); // carBtn event listeners getChildByName("carBtn" + i).addEventListener(MouseEvent.CLICK, onClickLoadData); getChildByName("carBtn" + i).addEventListener(MouseEvent.MOUSE_OVER, onCarHover); getChildByName("carBtn" + i).addEventListener(MouseEvent.MOUSE_OUT, onCarOut); } } ); // stage event listeners stage.addEventListener(MouseEvent.CLICK, onClickStageRemove); // button mode buttonMode = true; // functions function onCarHover(event:MouseEvent):void { event.target.gotoAndPlay(11); removeChild(popInfo); this.carcityName.text = "please show up"; } // carBtn onMouseout function onCarOut(event:MouseEvent):void { event.target.gotoAndPlay(10); } // loads data and populates popUp movieclips function onClickLoadData(event:MouseEvent):void { popInfo = new popMc(); popInfo.x = 130; popInfo.y = 50; popInfo.closeBtn.addEventListener(MouseEvent.CLICK , onClickRemove); popInfo.nyopBtn.addEventListener(MouseEvent.CLICK, onClickNYOP); var index = String(event.target.name); while (index != String(uint(index))){ index = index.substr(2); } popInfo.carsizeText.text = xml.city[index].bidlist.carsize.descendants().toXMLString(); popInfo.priceText.text = xml.city[index].bidlist.price.descendants().toXMLString(); popInfo.savingsText.text = xml.city[index].bidlist.savings.descendants().toXMLString(); popInfo.stateText.text = xml.city[index].@name.toString(); addChild(popInfo); } function onClickRemove(event:MouseEvent):void { popInfo.closeBtn.removeEventListener(MouseEvent.CLICK, onClickRemove); popInfo.nyopBtn.removeEventListener(MouseEvent.CLICK, onClickNYOP); removeChild(popInfo); } function onClickStageRemove(event:MouseEvent):void { if(event.eventPhase == EventPhase.AT_TARGET) { removeChild(popInfo); } } function onClickNYOP(event:MouseEvent):void { ExternalInterface.call("selectNY"); }
VIEWS ON THIS POST

58

Posted on:

Thursday 25th October 2012
View Replies!

How do I "include" with as3.0?

I've just jumped from as2 to as3 and it's quite depressing to see I have lots to do to fix everything to work. I have an as file containing loads of functions and commands and I used to link it to the flash file with #include in a frame. That obviously don't work anymore. I tried to search and read about this and find myself puzzled with the class and package. So to replace the include, do I just write the frame: import myPackage.myCode; and wrap my code inside: package myPackage{ public class myCode { code here... } Or how will I do the same thing I used to in as2 I tested the example of the help file. In te as file i wrote: package samples { public class SampleCode { public var sampleGreeting:String; public function sampleFunction() { trace(sampleGreeting + " from sampleFunction()"); } } } and in the main timeline I tried both: import samples.*; import samples.SampleCode; Both gave error: 1172: Definition samples could not be found. 1172: Definition samples:SampleCode could not be found. And I had one component button in the maintimeline (left from previous test) and when testing movie it flickered showing all the buttons states below each other\t\t
VIEWS ON THIS POST

102

Posted on:

Thursday 25th October 2012
View Replies!

this script is working in actionscrip2.0 but this is not wroking in as3

, I working long time in actionscript 2.0. just now i started working in action script 3.0. The script what i have pasted down is working in as2. stop(); click_btn.onPress = function() { gotoAndPlay(1); }; But the same script is not working in as3. I don't know y.please tell me. And also tell what is the differents between actionscript2.0 and actionscript3.0
VIEWS ON THIS POST

160

Posted on:

Thursday 25th October 2012
View Replies!

animate mc's sequentially

I've been looking around, but I was wondering if anyone can recommend me to some good tutorials or script examples of how to start a var animation based on the completion of the previous animation. I simply want each var in my code to start once the previous one is done, simple sequential animation. Whats the best way to do this Also any advice for how I've set this up would be good, if I'm doing anything antiquated or the like, Here is my code: Code: import fl.transitions.*; import fl.transitions.easing.*; var bubble3Tween:Object = TransitionManager.start(logo_mc.bubble3_mc, {type:Zoom, direction:0, duration:1, easing: Bounce.easeOut}); var bubble2Tween:Object = TransitionManager.start(logo_mc.bubble2_mc, {type:Zoom, direction:0, duration:1, easing: Bounce.easeOut}); var bubble1Tween:Object = TransitionManager.start(logo_mc.bubble1_mc, {type:Zoom, direction:0, duration:1, easing: Bounce.easeOut});
VIEWS ON THIS POST

67

Posted on:

Thursday 25th October 2012
View Replies!

converting code of countdown to as3

I found the Senocular tutorial to do a contdown in as2, i try to convert, but im starting in action scritp and the code give me a bunch of error, can someone help me. PHP Code: stop();currentDate=newDate();thisYear=currentDate.getFullYear();eventDate=newDate(thisYear,11,25);eventMillisecs=eventDate.getTime();counter.onEnterFrame=function(){currentDate=newDate();currentMillisecs=currentDate.getTime();this.msecs=eventMillisecs-currentMillisecs;if(this.msecs
VIEWS ON THIS POST

125

Posted on:

Thursday 25th October 2012
View Replies!

how to refer to the mc using this class

how do I refer to a mc that's using a certain class IN that class In AS2 I could use "this", but in AS3 I don't think it works
VIEWS ON THIS POST

66

Posted on:

Thursday 25th October 2012
View Replies!

Access mc inside dynamically attached mc? Please help!

I have an array of dynamically attached mc's, and I want to set text in a textfield that is inside movieclip that is inside each one of the attached mc's. I keep getting this error: TypeError: Error #1010: A term is undefined and has no properties. Here is the part of my code I'm having problems with. The mc is "square," the mc inside of it is "thumbText_mc," and the textfield inside of that is "hoverText": Code: function createThumbs(){ var myXML:XML=new XML(xmlLoader.data); for (var z:int = 0; z
VIEWS ON THIS POST

96

Posted on:

Thursday 25th October 2012
View Replies!

as3 faster?? i see the opposite

Made in AS2, 24 fps http://www.patrickjansen.net/test/___as2.html Made in AS3, 24 fps http://www.patrickjansen.net/test/___as3.html The AS2 animation plays faster then the AS3 animation. They're relatively the same in structure, so it boggles me why as2 plays better then as3. weird...
VIEWS ON THIS POST

113

Posted on:

Thursday 25th October 2012
View Replies!

help with php and as3

could someone please explain how to send variables to a php file using actionscript 3 im trying to create a contact form with flash and all the online tutorials i have found use as2. any help would be much appreciated!
VIEWS ON THIS POST

79

Posted on:

Thursday 25th October 2012
View Replies!

[as3] Drawing BitmapData to erase BitmapData

bitmapData.dispose()
VIEWS ON THIS POST

120

Posted on:

Thursday 25th October 2012
View Replies!