Putting a game inside one big movieclip

I'm using the script below on a movie clip that moves and
interacts with other movie clips. the movie clip the script is
applied to is on it's own keyframe on the timeline in the main
scene. now, i want to put everything i just made (the movie clip
the script is applied to and the movie clips it interacts with)
into one big movie clip so i can easily put it on a flash based
website. I'm pretty sure the "_root." has to be changed but I'm not
quite sure what to change it to

Jale3,
You are absolutely correct. _root refers to the main timeline
of a movie. By restructuring your timeline, many of the paths no
longer refer to actual MovieClips. There are a few ways of fixing
this.
1. Using an absolute path again. If you give the "one big
movieclip" an instance name of "big_mc", you would change all the
_root's to _root.big_mc. However, this method is not recommended as
it is what caused the problem in the first place.
2. Using a relative path. Clearly, the MovieClip with the
above code will always be on the same timeline, with the wall and
win MovieClips as well. And so, if this clip "looks" for the others
from its point of view, then there should never really be a problem
where you place the game. In this case, you could replace _root
with this._parent. "this" simply refers to the current timeline (of
the MovieClip that the code resides on) and "_parent" refers to the
parent timeline from the specific MovieClip.
3. A third, lazier option would be to make all references of
_root refer to the "big movieclip" and this can be achieved with
one line:
big_mc._lockroot = true;
Despite being the easies fix, the second method is a better
approach as there might be complications of some sort down the
line.
By the way, you might want to look into the onEnterFrame
event handler as a replacement for the outdated onClipEvent.

Similar Messages

  • Is it Ok to put many classes in one file ?

    Hi all,
    This is another beginner question. I was wondering, is it good practice to put many classes in one single file? Sometimes I notice there are many classes inside one big file and sometimes each class is in its own separate file. Is there an advantage in separating each class in each different file? For e.g. one big file, called A.java:
    class A {
        public static void main(String[] args) { }
    class B {}   
    class C {}
    class D {}Is it better to have class B in a B.java file, and class C in C.java, etc? In the real-world workplace, what is the usual practice?
    Thank you for your replies.
    P/S : I love Java, it's so cool. :-)

    I have also seen situations, in large software systems, where a compile that fails partway through will leave the top level classes that do not match the file name unbuilt, and some compilers will then not be able to build, because they cannot map the class name to the source file.
    ? {?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Loading a game inside a movieclip (AS2)

    Hello.
    I have a problem loading a game inside a movieclip (i´m using AS2)
    I have a main timeline with 6 buttons, and each button calls for an external SWF, wich loads inside an empty movie clip.
    Everything works ok, but when the game loads inside the movieclip, it won´t respond.
    The game SWF loads ok inside the movieclip, but it doesn´t respond to commands.
    If i execute the game.swf, it plays ok....but when loaded into the movieclip, it shows but you can´t play because the commands or buttons won´t respond.
    Is there a way to load this kind of swf inside a movieclip and make it work?.
    What i´m doing is:
    The button has this action:
    on (press) {
    loadMovie("game6.swf", "cargador");
    "Cargador" is the name i gave to the empy movieclip.
    I´ll appreciate any help i can get. Thanx a lot for your time.

    Hi Ned. Thanx for your reply.
    All the files are in the same folder, and all games are just 1 swf file (no php, xml, external .as or subfolders).
    About the other recomendation of using _lockroot... where should i place it? i have 3 frames (1, 2 and 3) with a stop action, and in another layer on frame 2, all the actionscript.
    If i place the code on the frame with all the actionscript, this should be at the beginning of the code, or can i place it at any line? Or is it easier to place it in one of the other frames where i placed the stop action?
    Thanx again for your reply.

  • I erased by Hard drive without backing up. Now, when I put the install disc one inside, it says that Mac os x cannot be installed on this computer. The computer was running Mac os x 10.5.8. Any help?

    I erased by Hard drive without backing up. Now, when I put the install disc one inside, it says that Mac os x cannot be installed on this computer. The computer was running Mac os x 10.5.8. Any help?

    Boot from your DVD by switching on the Mac & inserting the disc, restart it & hold the "C" key. Once the installer window loads & you have selected your language, choose Disk Utility from the Utilities Menu. You will then need to select your disk from the menu within Disk Utility & choose how you wish to format. It should be formatted Mac OS Extended (Journaled).
    Once it has formatted, you should then be able to install the OS.
    PLEASE REMEMBER...that formatting a disk will completely erase it's content. Be sure that you don't wish to recover any of your previous content before doing any of the above.
    Ben

  • Small image inside a big image

    hi
    i need to retrieve a small image inside a big image like an advertisement(small image) on the newspaper(big image). can anyone help in this regard.
    regards
    Manoj Kumar

    Do you mean that you want to cut a portion from one image to make another?
    If yes, then you can use the CUT operator which takes four arguments
    origin x, origin y width, height
    example
    srcImage.processCopy('cut 20 20 100 100', destImage);
    This cuts a 100 by 100 pixel window originating at 20,20 from the source image and puts the result into destImage.
    For more information see the Oracle Multimedia Reference Guide.

  • How can I put a subpanel inside another subpanel?

    Hi,
    Is it possible to put one subpanel o several subpanels inside one main subpanel?
    Thanks,
    ToNi.

    DFGray wrote:
    You can create something in LabVIEW to do this, but it won't be trivial. Here are some things to point you on your way. I have not done this, so it is pure speculation on how I would go about solving this problem.
    You will need to know ahead of time the maximum number of windows you will want. On your front panel, create that many individual subpanels. You can hide the border and make them transparent so you never see them unless something is in them.
    When you load a VI into the subpanel, all you get is the panel, not the title bar. You will need to create a title bar with buttons and any border you want on the VIs in the panel area. This is tedious, but fairly straightforward, especially if you use system colors to make it look like a real title bar/border. You won't be able to make it look like an XP title bar unless you use bitmaps/picture control. If you go that route, you can probably even mess with the color map to change the bitmap colors when the system color changes (have to poll, no event for system color change).
    You can resize and move the subpanels using property nodes. Getting the info to do this could be tricky, however, since you may be coordinating mouse events from the top level VI and the VI hosted in the subpanel. Should be doable, though.
    One other method is to use floating windows, but move them on top of your main window so it appears to the user it is an MDI. You won't get clipping, but everything else will look the same and you won't have to jump through hoops to create title bars, etc. You will have to write a position manager to maintain the window positions, but that is probably easier than the tricks I discussed above
    Good luck. One final question - do you really need an MDI? Floating windows with clear labels are a lot easier. Do some polling of your users to find out what they like best, then go for it.
    You should using windows reparenting functionality through windows api dll calls. Reparenting is documented well on microsoft.com. Reparenting is how Excel opens multiple worksheets inside the Excel "parent" window. I have done this on a few of projects and it works far better than subpanels because it allows you to drag windows around within a parent application. They are also far easier to work with once you get the reparenting vi's correct (you have to do some messing with Z position and window activation to get them to repaint properly) because unlike with subpanels you can view a VI diagram while it is reparented with no problem. With subpanels I have also had problems with GUI controls driving event structures when a vi is in a subpanel.
    -Devin
    I got 99 problems but 8.6 ain't one.

  • Multiple Reports inside one Single Report

    Post Author: maximus85
    CA Forum: Crystal Reports
    Hi....I'm having this problem of having multiple reports inside one single report. Basically what i wanted to built is a Dashboard that contains 4 main subjects:i)Sales   -    Contains graph that can be drill down for further detailsii)Internal Process   -  Contains tables that can be drill downiii)Profit/Lossiv)HRAs far as i know, since all four are of different fact table data, they cannot be all thrown inside one single report to be built on. So i came out with using subreports instead for each components and then finally putting them all together as subreport inside the main report(Dashboard).However, i just realized that by doing that, whenever i clicked on the reports that i wanted to drill down with, it will prompt that particular report that i clicked into a new page, and then from there only i can perform drill down.Is there anyway to enable me to straight away drill down the Sales and Internal Process reports from the main reports(Dashboard) instead of having to click twice as that will be unnecessary right?Or mayb if there's another better ways to do what I have to do? Please do advise and suggest......Thanks alot.......

    hi chack,
    doesnt matter or preferrably both, as long as i can export all the reports in 1 page into 1 excel, or 1 pdf.

  • Variable number of two dimensional arrays into one big array

    I have a variable number of two dimensional arrays.
    The first dimension is variable, the second dimension is always 7.
    i.e.:
    Object[][] array0 = {
    {"tim", "sanchez", 34, 175.5, "bla", "blub", "[email protected]"},
    {"alice", "smith", 42, 160.0, "la", "bub", "[email protected]"},
    Object[][] array1 = {
    {"john", "sdfs", 34, 15.5, "a", "bl", "[email protected]"},
    {"joe", "smith", 42, 16.0, "a", "bub", "[email protected]"},
    Object[][] arrayi = ...I'm generating these arrays with a for-loop:
         for (int i = 0; i < filter.length; i++) {
              MyClass c = new MyClass(filter);
              //data = c.getData();
    Where "filter" is another array which is filled with information that tells "MyClass" how to fill the arrays.
    "getData()" gives back one of the i number of arrays.
    Now I just need to have everything in one big two dimensional array.
    i.e.:Object[][] arrayComplete = {
    {"tim", "sanchez", 34, 175.5, "bla", "blub", "[email protected]"},
    {"alice", "smith", 42, 160.0, "la", "bub", "[email protected]"},
    {"john", "sdfs", 34, 15.5, "a", "bl", "[email protected]"},
    {"joe", "smith", 42, 16.0, "a", "bub", "[email protected]"},
    Any idea on how to accomplish this? It's blowing my mind right now.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Just brainstorming here:
    Why not put your actual data in a class and store that in a LinkedList (so you know the total number of elements for your multi-dimensional array). Then initalize your multi-dimensional array and populate it? Haven't tested the following, but thinking something along the lines of
    public class MyData {
         //data here
         public Object[] toArray() {
              //something similar to this
              return new Object[] = {"tim", "sanchez", 34, 175.5, "bla", "blub", "[email protected]"};
    LinkedList<MyData> data = new LinkedList<MyData>();
    data.add(mydata1);
    //however many times you need
    Object[][] arrayComplete = new Object[data.size()][7];
    for(int i = 0; i < data.size(); i++) {
         arrayComplete[i] = data.removeFirst().toArray();
    }Another option for knowing how many rows you would need might be using something like:
    int rows = 0;
    rows += array1.length;
    rows += array2.length;
    //etc...But is not entirely useful if you don't know how many variable arrays you have (although reflections might help if the name of the array variable is incremented systematically, someone told me earlier to avoid reflections since it could make debugging a LOT more difficult).
    Edited by: bogdana on Apr 1, 2010 10:38 AM

  • Autocommit inside one SQL command

    Hi,
    I have 2 tables A and B each have two columns id and name. I used "update A set A.name = (Select B.name from B where A.id=B.id)" to update table A's name. However, when both tables are very large( say 5M rows), Since Oracle will commit only after a command, so, the DB will hold the 5M rows in the rollback segments, if the rollback segments are not large enough, the updating will be very slow. Is there any way to let Oracle commit inside one SQL command? For exemple, auto commit after every 10000 rows get updated.
    Thanks.

    Thanks for your comments. We have done some tests:
    1. We used a flag to limit the number of rows for updating in 2000, 5000, 10000 and 50000 rows. We found that the time/rows in 2000 rows was much lower than in 50000 rows. The higher the testing rows, the higher time/rows was.
    2. We used single SQL (update ... select .. from) command to update whole table vs used one select SQL and a seperate update SQL to update table A one record by one record using Java. I thought first one should be much fast than second one. But there were not big diferrence.
    Do you have any ideal for tuning this DML?
    Thanks.

  • Choosing one big ssd drive or better having a second hdd

    I WANT TO REPLACE MY INTERNAL  320 gb hdd with a SSD, is better have a second drive (as my actual hdd) for data or one big ssd whee to put everything on is a best solution even for battery etc
    what is the incovenient to have one only SSD.

    alidav,
    It's quite nice to have a 1TB SSD (mine is almost 1TB at 960GB) and I certainly recommend buying a SSD that fits your needs. However, I would recommend that if you do buy a 1TB SSD that you also invest in, at the least, a 2TB external drive for making Time Machine backups. I use both two Time Machine drives and five clones for my backup needs (a little paranoid, I know) but I have to recommend at least one, if not more, backup schemes.
    Good luck,
    Clinton
    MacBook Pro (15” Late 2011), OS X Yosemite 10.10.1, 16GB Crucial RAM, 960GB M500 Crucial SSD, 27” Apple Thunderbolt Display

  • HT1918 i have multiple itunes accounts and want to put them all as one is that possible

    i have multiple apple id's thus accounts is there anyway to put them all as one account under one apple id

    Sorry, but it is not possible to merge Apple IDs.
    Regards.

  • How to put two ipods on one computer

    how to put two ipods on one computer

    Set up the second exactly the same way as you set up the first. If iTunes is already installed, it doesn't need to be installed again.
    (64746)

  • Can i put two ipods on one itunes

    can i put two ipods on one itunes

    The OP didn't ask how.  They only asked if it was possible, which would consist of either a yes or no answer, which is exactly what Niel provided. 
    If the OP wanted more information, they will respond asking for more information.
    B-rock

  • How to transfer games from one games centre account to another?

    I was using my brothers ipod touch to play smurfs village and then got my own. How do I transfer the game from his game centre account to my own? (I have been playing this game for ages and dont want to start all over again). Thanks in advance

    You can't transfer games from one account to another.
    What you can do is to log in from your ipod touch on his gamecenter account and download the app and play like this.
    By admin of #1 webmaster and coding community on web http://www.webmasterszone.net

  • How do i put multiple albums into one huge album collection?

    How do i put multiple albums into one huge album collection?
    Some examples include: Linkin Park - Studio Collection, Michael Jackson - The Indisposable Collection

    Hi skullkrunch3r,
    Thanks for visiting Apple Support Communities.
    If you "Get Info" on the tracks that are part of your collection, you can use the Compilation option in iTunes.
    In iTunes 8 and later, you find the option to mark multiple items as "Part of a compilation" in the Options tab of the Multiple Item Information window.
    See this article for more information on marking your albums as part of a compilation:
    Why aren't songs with the same album art grouped together?
    http://support.apple.com/kb/TS1468
    Best Regards,
    Jeremy

Maybe you are looking for