ActionScript 3.0 :: Access Movie Clip From Loaded SWF?
Nov 19, 2010
I have 2 .swf
main.swf
application.swf
main.swf loads (using Loader Class of course) application.swf So, i need to do 2 things into main.swf BUT from application.swf I have in main.swf
* BlackBgMC (MovieClip), with a Shape Tween, in Stop on Frame 1
* A Close Buttom that i put invisible in Frame 1
So, FROM .... application.swf in a some point (example Frame 10) i need to get Play the BlackBgMC (that is on main.swf), and the Close Buttom put it Visible.From application.swf i put:
MovieClip(root).BlackBgMC.gotoAndPlay(2)
or
MovieClip(parent).BlackBgMC.gotoAndPlay(2)
And I always get
"TypeError: Error #1010: A term is undefined and has no properties."
How do i gotoAndPlay that MC from application.swf Sames happen with MovieClip(root).CloseButton.visible = true;
I'm making obstacles for my game, and basically what I have is a movieclip called char on the maintimeline and a movieclip called floor.. within the movieclip floor i put a movieclip called obstacle in. What I want to do is check to see if char hit obstacle, so itd be like hitTestObject(floor.obstacle) then make the main timeline go to frame 2..
I've been trying to load a movie clip from a movie clip that has been loaded. I am trying to provide a simple means to change the look / feel of the flash application by placing the graphics and controls into a second swf. Each different screen is represented by a different movie clip that is in the second swf. So I've got app.swf loading ui.swf. I want to load screen1_mc from ui.swf.
The app.swf is loaded by a master swf. There may be multiple copies of the app.swf that can be loaded by the master.swf and each app.swf could be configured differently. For each "unique" app.swf it is stored under a unique folder that is not known to me in advance. Since I don't know the unique folder in advance, I can't use import / export for runtime sharing. Is there any way to load the movie clips from the loaded movie clip? (Basically, I want to treat the ui.swf as an extension to the library.)
I'm working on a flash site and I'm having some trouble with the programming for it. I'm not so great at action script, so I'm hoping that my troubles are caused by my own stupidity and that some cool smart person will have an answer for me. So, I have a main menu flash file that functions like the one in this tutorial: http://www.kirupa.com/developer/mx/p...transition.htm I set it to load various swf files and it's works just fine. What I want to do is have it load a swf that functions exactly the same (buttons that load external clips with transitions) as the main swf- this is a sub page menu. So, in theory, the sub menu page should load the final content, and three swfs would be seen stacked ontop of each other.
I changed the instance names in the sub menu file to be different than that in the main menu file. This fixed the original problem of it loading the content clip into the clip that the sub menu should stay in. Now, It loads the sub menu just fine, but then it gets stuck and never loads the content. The sub menu buttons will not function at all. Independent of the main menu, the sub menu file works perfectly What can I do??? Does it have anything to do with the "_root"? I never understood the concept, so I'm having trouble with it.
No matter what I try to access this swf..._root, _parent, _level0, etc...I can't get to it. I did a targetPath and it returned "level0"...so I'm not sure what I'm missing.
Code: var player1holder:MovieClip = _root.createEmptyMovieClip("player1holder", 0); var player1loader:MovieClipLoader = new MovieClipLoader();
I've got a shell that loads a class, "course.as", which parses an array, "Components", from an xml document.I can trace the results of that array just fine from the shell using:
Code: trace("comp "+this.course.Components.toString()); I use the following code to load a swf into a placeholder clip:
I am targeting a a movie clip. The problem is that all the syntax I have found for targetting clips looks like this: _root.sample_mc.sample2.mc. etc. The problem is, my target clip is in an swf that I've loaded into a container clip from my main timeline. So, essentially, I have a home.swf that loads menu.swf into a container called 'location'. In menu.swf, I have an MC called center, which contains the MC I am targetting called 'target'.
How can I access variables defined on root from a loaded movieclip? The loaded movieclip path can differ, so I cannot get to root like parent.parent, for example. I thought something like this.root.varName may work, but it obviously doesn't.
i got a school flash project where i need to access the _y properties of many movie clips buttons that set with name like sel 1 sel2 sel 3 and so on the problem is i have 2 sets of those, one on the main timeline which i can access with "for" looped _root["sel"+i]._y and one which is inside another movieclip problem is i don't know how to access the later using for loop? this is the script that i used to access the _y on the _root.selx
I'm trying to use the scroll pane component for the first time, and I've spent most of the day getting nowhere. Based on my experience with other components and with loading content into movie clips, I expected that I would point my scroll pane to its content and be off and running, but that hasn't happened.
I wonder how can i find the place or the target of a movie clip i working in.So, i have a movie clip on frame 50 of the root flash;=> On that movie clip 'player' i have a mediaDisplay with an instance name 'video' and in the some movie clip i have another mc 'play'so, how can i access to instance video from mc play.
var = '../.video' and var = _root.video.player.video ;
after loading an external movie clip called "mv_frame" into the main flash file , i need to access a movie clip inside the loaded movie called "hit" in as2 we do that using the point (.) to navigate into movie levels , but my question is how to do that in AS3?
ActionScript Code: public function layoutLoad(e:Event):void { FlashConnect.trace("Display.loadLayout()");
[Code].....
It will compile but I get a "Cannot access a property or method of a null object reference." So I am not targeting right. I did double check my instance name is correct and in the root of the loaded SWF
I'm designing an interface which lets the user control the timeline of a movie clip, by dragging a slider up or down with the mouse. And I can now drag the slider around, an archivement for which I am way proud. But I have some problems:
1) When the user drag the curser away from the slider movie clip and let go of the mouse buttom, the MOUSE_UP is not detected. I need a way to detect a MOUSE_UP in general.
2) The current frame of mcTheAnimation should always be locked to the vertical position of the slider. How do I access the timeline of that movie clip?[URL]..
i have this code in an as layer within a movie clip called pages
ss_btn.addEventListener(MouseEvent.CLICK,reportCli ck); function reportClick (myevent:MouseEvent):void { // do something in response addChild(img_holder); removeChild(img_holder);
but the ss_btn im trying to access is within another movie clip called menu is there a way i can access the button
I have a flash file which uses php to manipulate a database and returns a variable (data_xml) of xml formated data from the database. This happens, along with other things, within the parent. Now I have a child movieclip that displays the parsed data but I am having trouble accessing the variable from within the child movieclip. The code related to this is:
var myXML:XML = new XML();var myXML = XML(event.currentTarget.root.data_xml);
and I get the following two errors which point to the second line as the problem:
1151: A conflict exists with definition myXML in namespace internal.
Warning: 3596: Duplicate variable definition.
I have unchecked "Automatically declare stage instances" because I've seen that suggested for the 1151: error, but I still get the same two errors.
I have one button its name a_btn. this button is inside one move clip name a_mc. this button is on first frame. so when write code for that:
function submit(event:MouseEvent):void { trace("hii") } a_mc.a_btn.addEventListener(MouseEvent.CLICK, submit);
its working. but when i keep this button on 2nd frame or any where not in 1st frame inside that movie clip, then i get runtime error like: TypeError: Error #1009: Cannot access a property or method of a null object reference.at NewFlashDocument_fla::MainTimeline/NewFlashDocument_fla::frame1(). how can i access that button on second frame...
I have a button (myButton_btn) which is nested inside a few movie clips. How do I access it from the main time line? Does this look like a proper code:
firstLevel_mc.secondLevel_mc.thirdLevel_mc.myButton_btn.addEventListen er(MouseEvent.CLICK, onClick_goHome); function onClick_goHome(event:MouseEvent): void { this.gotoAndPlay("homesequence"); }
I have movie clip in an array (newStep) that is being added to the stage dynamically. It's randomly choosing a frame to go to every time an instance is added. There is a nested movie clip (stepLine) that i need to change the alpha of. This code actually works for adding a string to to the dynamic text box (pointsDText) but when i try to access the nested movie clip (stepLine) it gives me 1009 null object reference error. The funny thing is the code actually works and does change the alpha of the movie clip but i still get that error, and i think it's making my game more glitchy. I've tried using if(contains(steps[r].stepLine)) too but it doesn't work. Is there a better way to access this movie clip without getting the error?
I have a flash project consisting of a single frame in the main time line. Upon user interactions many movie clips fade into the stage. My problem is that i am unable to continue working on these animations when i set the movie clips 1st frame to zero opacity. What is the correct way to access my movie clip instances when I am unable to simply double click on them?
I have a movie clip that exists only in the library linked to a scrollpane component using its linkage identifier (the name of this MC is content_mc). It scrolls perfectly. However, in the movie clip there are additional movie clips I would like to control (green_mc), but for that I need to be able to access them using DOT syntax. How can this be done? I'm assuming that since the movie clip in the library has "export in first frame" checked that I would be able to access it somehow like this[code]...