SEARCH YOUR SOLUTION HERE  

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

Posted On: Thursday 25th of October 2012 09:33:05 PM Total Views:  411
View Complete with Replies




Related Messages:

Flash Need Help naming and targeting;   (178 Views)
i need help doing this : please read and sorry if the code is too long : This is my AS file : Code: package { import flash.events.Event; import flash.net.URLLoader; import flash.net.URLRequest; import flash.display.Sprite; import fl.controls.DataGrid; import fl.core.UIComponent; import flash.display.Loader; import flash.display.MovieClip; import flash.display.Shape; import flash.events.MouseEvent; import fl.controls.Label; import fl.events.ComponentEvent; import flash.system.System; public class tut extends Sprite { private var xml:XML; var aGrid:DataGrid = new DataGrid ; public function tut() { readXML(); } private function readXML():void { var loader:URLLoader = new URLLoader(new URLRequest("points.xml")); loader.addEventListener(Event.COMPLETE,xmlLoaded); aGrid.x = 30; aGrid.y = 300; } public function restart(e:MouseEvent):void { readXML(); } public function xmlLoaded(e:Event):void { var ind:int var myCircR:int = 20; xml = new XML(e.target.data); xml.ignoreWhitespace = true; var f:uint; for (f = 0; f < xml.point.length(); f++) { var full_mc:MovieClip = new MovieClip ; var dr:MovieClip = new MovieClip ; full_mc.buttonMode = false; full_mc.x = xml.point[f]. @ xPos; full_mc.y = xml.point[f]. @ yPos; full_mc.ind = f dr.graphics.lineStyle(1) dr.graphics.beginFill(0xff0000); dr.graphics.drawCircle(myCircR/2,myCircR/2,myCircR/2); full_mc.addEventListener(MouseEvent.CLICK,drawGrid); full_mc.addChild(dr) addChild(full_mc) } } public function drawGrid(e:Event):void { aGrid.width = 250; aGrid.height = 100; aGrid.remove(); aGrid.columns = ["Label","Data"]; var s:uint; var q:Number = e.target.ind for (s = 0; s < xml.point[q].value.length(); s++) { aGrid.addItem({Label:xml.point[q].value[s]. @ label,Data:xml.point[q].value[s]}); } trace(q) addChild(aGrid); } } } here is my XML file : Code: 01Here is our message. 564848744 02Here is our message. 564848744 03Here is our message. 564848744 04Here is our message. 564848744 05Here is our message. 564848744 01Here is our message. 564848744 02Here is our message. 564848744 03Here is our message. 564848744 04Here is our message. 564848744 05Here is our message. 564848744 So as you see all i need is when i call drawGrid() i can get some kind of number from the clicked full_mc so i can loop the in that certain Please help and if anyone have any comment on my coding plz let me know.
try to targeting cursor with circle which is made by sprite.   (160 Views)
Hi I'm a newbie about actionscript and i tried to make a circle which follow the cursor but i have a small problem here.The circle follows the cursor but there is a constant distance between my cursor and circle and i dont know what is the solution.Is there anyone who can help me p.s:Sorry about my english ,its not my native language.
Help with index and targeting   (255 Views)
ppl cool forum you have here please read my code and give me some help Code: package { // import needed classes import flash.events.Event; import flash.net.URLLoader; import flash.net.URLRequest; import flash.display.Sprite; import fl.controls.DataGrid; import fl.core.UIComponent; import flash.display.Loader; import flash.display.MovieClip; import flash.display.Shape; import flash.events.MouseEvent; import fl.controls.Label; import fl.events.ComponentEvent; import flash.system.System; public class tut extends Sprite { private var xml:XML; var aGrid:DataGrid = new DataGrid ; public function tut() { readXML(); } private function readXML():void { var loader:URLLoader = new URLLoader(new URLRequest("points.xml")); loader.addEventListener(Event.COMPLETE,xmlLoaded); aGrid.x = 30; aGrid.y = 300; } public function restart(e:MouseEvent):void { readXML(); } public function xmlLoaded(e:Event):void { var ind:int; var myCircR:int = 20; xml = new XML(e.target.data); xml.ignoreWhitespace = true; var f:uint; for (f = 0; f < xml.point.length(); f++) { var full_mc:MovieClip = new MovieClip ; var dr:MovieClip = new MovieClip ; full_mc.buttonMode = false; full_mc.x = xml.point[f]. @ xPos; full_mc.y = xml.point[f]. @ yPos; full_mc.ind = f; dr.graphics.lineStyle(1); dr.graphics.beginFill(0xff0000); dr.graphics.drawCircle(myCircR/2,myCircR/2,myCircR/2); full_mc.addEventListener(MouseEvent.CLICK,drawGrid); full_mc.addChild(dr); addChild(full_mc); } } public function drawGrid(e:Event):void { aGrid.width = 250; aGrid.height = 100; aGrid.remove(); aGrid.columns = ["Label","Data"]; var s:uint; ///////problem next line var q:Number = e.target.ind; for (s = 0; s < xml.point[q].value.length(); s++) { aGrid.addItem({Label:xml.point[q].value[s]. @ label,Data:xml.point[q].value[s]}); } trace(q); addChild(aGrid); } } } xml file : Code: 01Here is our message. 564848744 02Here is our message. 564848744 03Here is our message. 564848744 04Here is our message. 564848744 05Here is our message. 564848744 01Here is our message. 564848744 02Here is our message. 564848744 03Here is our message. 564848744 04Here is our message. 564848744 05Here is our message. 564848744 so all i need is when i call drawGrid(); i can get a number like an index number from the clicked full_mc, to be the q value in drawGrid() to loop through the in that certain in my XML data.
geo targeting in Flash   (132 Views)
Something has come up where we may need to do some geo targeting to deliver different content to a video player based on the client's (as in end-user) location. Basically, we would want to control the delivery based on country. This sounds like a huge, deep topic that I can't even begin to address. Anyone have any thoughts or experience doing this sort of thing with Flash content The swf may need to sit on a server we have no back-end access to, so ideally it would be a solution that doesn't require PHP or any other sort of back end...but I'm not sure if that's possible.
problem targeting child   (266 Views)
all. I need a liitle help with tageting a child. I'm attaching an array of boxes from the library to the stage with a ticker interval. I want each box to do something (like go to frame 2) each time the ticker fires. How do I implement this
HELP: Problem targeting MovieClips within ScrollPane   (198 Views)
, I'm trying to use scroll panes for the first time and I'm having trouble targeting the movieclips inside of the scroll pane. to clarify the set up the whole scrollpane set up is inside of bigger movieclip (mc1) which gets added dynamicaly to the stage through actionscript. I placed a scrollpane on the timeline then used the components inspector to specify a movieclip(mcContent) as the content. the movieclip has several other movieclips(link1, link2, etc.) nested inside which will act as links. that is what i need to target. my code looks like mc1.scrollPane.mcContent.link1.buttonMode = true; The thing is it doesn't work and I get an error which says ReferenceError: Error #1069: Property mnuLinks_mc not found on fl.containers.ScrollPane and there is no default value. if anyone knows what i did wrong any help would be greatly appreciated.
having problems targeting mc text field   (163 Views)
I'm adding a child from the library, and trying to set the textfield (alphabet) of my movieclip (symbol9). I can't seem to figure out how to target the text of the dynamic text field alphabet. letterButton.addChild(new symbol9()); letterButton.symbol9.alphabet.text = _letterslist[i]; Isn't working. I see my movie clip, just no text.
having problems targeting mc text field   (175 Views)
I'm adding a child from the library, and trying to set the textfield (alphabet) of my movieclip (symbol9). I can't seem to figure out how to target the text of the dynamic text field alphabet. letterButton.addChild(new symbol9()); letterButton.symbol9.alphabet.text = _letterslist[i]; Isn't working. I see my movie clip, just no text.
targeting multiple movieclips in one line of code   (157 Views)
I have a question to which the answer might be really simple, I just can't find it anywhere It's a matter of finding the right syntax I guess. Hope one of you can help out. Lets say I have two movieclips on stage called Clip1 and Clip2 Both contain dynamic textboxes with tha same name: txtOutput I could use the following code: ActionScript Code: Clip1.txtOutput.text = "some string"; Clip2.txtOutput.text = "some string"; Or in one line: ActionScript Code: Clip1.txtOutput.text = Clip2.txtOutput.text = "some string"; But I'd like to use something like : ActionScript Code: [Clip1,Clip2].txtOutput.text = "some string"; //or [Clip1&Clip2].txtOutput.text = "some string"; //or [[Clip1],[Clip2]].txtOutput.text = "some string"; Which I just made up and does not work I have just two clips so using a for loop sounds like overkill. Does anyone know the correct syntax
targeting a component in a class   (244 Views)
I want to load a swf into a byte array before loading it into an swf loader. I'm wondering how I would target a specific swf loader to do this to since I have 3 different ones.
Despretly needing help on loading Multiply mc'ss   (181 Views)
I am having huge problems in creating more than one loading bar in my flash file I have created a gallery of 3d models, as good as that sounds, its a killer for the user to download and play while on the net, now i have inserted a loading bar at the start, but its still not suitable as its a long wait, and now really want to have a loading bar per each model is their any way to have multiple loading bars i have been trying to figure this out for over a week now, and have only managed to have multiple loading bars, when the file it loads, is stored in my computer any help, links anything is most appreciated, or if u need any more information from me Flash CS4 AC2
CS3 hitTestObject to any mc   (116 Views)
so i have a brick (brick_mc) on my stage and if it hits the circle (circle_mc), also on my stage, it traces a simple "hit" like so: Code: //note: the brick is linked to a drag/drop baseClass i wrote, which is how i'm //moving it around brick_mc.addEventListener(Event.ENTER_FRAME, circleHit); function circleHit(event:Event):void { if (brick_mc.hitTestObject(circle_mc)) { trace("hit!"); } } which is nice. but what if i have 30 circles on my stage for my brick to hit is there anyway to set up "brick_mc.hitTestObject(circle_mc)" so that instead of "circle_mc" as the parameter, it can be all instances of the circle movieClip or even more generic if it hits anything on the stage, like square movieClips
Simple Help, Possible Conflicting players or tiny mce issue   (107 Views)
Thank You for reading. My flash mp3 player works correctly on the server http://uniquelyrx.com/mp3players/bonez_swf/bonez.swf however, malfunctions once embedded, it always reverts to version 6,0,40,0 even though I typed in I'm using tiny mce to import the code into the page.http://uniquelyrx.com/artist_samuelbonezyohannan It worked it initially, then I added a seperate flash banner in the header and the malfunction occurred. Tried removing the banner and the problem remained. This is the source code for the page: $(document).ready(function(){ $("#menu a").hover( function () { $(this).find("div").toggle(); }, function () { $(this).find("div").toggle(); } ); }); Samuel Bonez Yohannan | Unique Lyrx Samuel Bonez Yohannan Samuel “Bonez” Yohannan music defines who he is and not the other way around, less concerned with the “image” of being a producer and completely absorbed by the creative aspects instead. After working as a Producer and Engineer for over 12 years he has settled into a style of musical composition which has become his signature sound. Driving horn sections that build up to larger-than-life hooks are contrasted by cavernously sparse and melodic verse sections where, in his own words, “the artist can do their thing without the beat getting in the way.”  The give and take between MC and music is what Bonez loves the most about creating Hip Hop and it is obvious that he thinks about the music from a vocalist’s point of view and not just a beat-maker. Although not a rapper himself, Bonez has worked side by side with artists as a recording engineer often times running the session, acting as the producer, and also having had composed the tracks as well. It is this priceless insight into the mind of the artist that gives Bonez the ability to not only create the track but also work with the vocalist as a producer in the original definition of the word, often lending vision to subtleties such as syllable placement, rhythmic timing and vocal attitude in order to take the overall production to the next level. Sam’s proficiency as a creative individual is only strengthened by his technical knowledge of the essential tools of the recording studio. His ability to walk over to the mixing board or computer and dial in the reverb or EQ that is needed right at that moment is what sets him apart from just some guy with a Triton and an MPC 2000. Considering himself to be somewhat of a renaissance man Bonez has learned how to utilize both the digital and analog equipment needed for both composition and recording.The centerpiece to Bonez’s production studio at home is Pro Tools. He uses the industry standard software to sequence all his tracks as well as utilizing high-end plug-ins to generate sounds and slice up samples.  Bonez might not have created an entirely new style and sound with his beats but when you hear the classic sampled grooves layered over with hard hitting kick snare rhythms and fused together by modern synth melodies, you can tell that he is honored to follow in the footsteps of the great Hip Hop producers who have come before him while at the same time he attempts to push the traditional “Boom Bap” sound to a whole new place for the modern day rapper to flow over.     Unique Lyrx Publishing Copyright 2009 © Corporate Main About Us Artists Licensing Catalog Express Contact FAQ   © Copyright 2009 Unique Lyrx Publishing any suggestions would be greatly appreciated Thank you in advance
How to do hitTestObject between single mc vs and multiple mc?   (186 Views)
Oke, i have 4 movieclips on my stage , there are mc_1, mc_2, mc_3 and mc_4 and i also have 1 dragable movieclip (named ball), and i want something traced if my ball touch another movieclip, below are my code ActionScript Code: ball.addEventListener(MouseEvent.MOUSE_DOWN, drag); stage.addEventListener(MouseEvent.MOUSE_UP, drop); function drag(e:MouseEvent):void { e.target.startDrag(); } function drop(e:MouseEvent):void { stopDrag(); if (ball.hitTestObject(mc_1)) trace("Collision detected!"); if (ball.hitTestObject(mc_2)) trace("Collision detected!"); if (ball.hitTestObject(mc_3)) trace("Collision detected!"); if (ball.hitTestObject(mc_4)) trace("Collision detected!"); } How to minimize that code i'm trying like below but doesn't work, ActionScript Code: var mc_array:Array = new Array(mc_1,mc_2,mc_3,mc_4); ball.addEventListener(MouseEvent.MOUSE_DOWN, drag); stage.addEventListener(MouseEvent.MOUSE_UP, drop); function drag(e:MouseEvent):void { e.target.startDrag(); } function drop(e:MouseEvent):void { stopDrag(); var i:int; for(i=0; i
access variable on stage from inside a mc   (142 Views)
Hi , I have a variable on stage which I need to access from inside a mc. I can able to call other mc's on stage using "parent", I used to same here, but I can't get the variable. when compiled throws "undefined variable".
scrolling mc   (119 Views)
. i want to create a scrolling mc. i am useing a mc as a screen. in that mc i want a box that contains 20 mcs which are all clickable. ie a shop in a game. i wnat the box 300 by 500 with onlt 6 mc visable then you can scroll down to view the rest. i have been searching google but all it brings up is scrollling text boxs. can anyone show me how to do this or a tut that does.
finding position of mc after displacement   (134 Views)
i have an mc that is displaced. Within this movie clip is a text box that moves about but it is being displaced along with the rest of the mc. Is there anyway to find a position inside the displaced mc and translate that to root coordinates.
mc to fit to screen in full screen mode   (117 Views)
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.
access mc reference from another frame   (176 Views)
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
mc isn't located orrectly until browser is resized   (236 Views)
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});