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.

Similar Messages

  • AS3 loading external swf files with buttons from inside a movieclip

    In my main .swf I have labels on the timeline, navs for those btns are on the first frame of the AS layer and each button sends the playhead to a different frame.
    On one frame called fr1 there is an mc called mc_1 that appears on stage when the playhead stops there. Inside mc_1 are a set of navigation buttons that need to call external .swfs.
    Do I add event listeners on the last frame of mc_1 for each button?
    how do I call the loaders for the swfs on the buttons since the swfs will load on the main timeline NOT the mc_1 timeline?
    So label on main timeline called fr1 will load external1 swf , on fr10 external 2.swf will load and so on.
    any help?

    The code for that button's event listener needs to be placed wherever it has direct access to the button.  Not necessarily on the same timeline, but in a place where both the button and the code are present at the same time.
    The code could be placed at the frame in the main timeline where the movieclip with the button(s) is, targeting the buttons via the movieclip (mc.button.addEvemtListener...) , unless the buttons are somewhere down the timeline of that movieclip.
    If they are down the timeline of that movieclip, then you would need to have the event listener also inside the movieclip, down its timeline where the buttons are finally settled in... being sure to assign instance names to the buttons at every keyframe.

  • Accessing a movieClip inside a movieclip in as2

    I am trying to get to a
    movieclip nested inside a movieclip in As2:
    MovieClip1.movieClip2.movieClip3.gotoAndStop(2)
    MovieClip1, MovieClip2, MovieClip3 is instances Names.

    Your approach is correct.  Based on the change in spelling between the two lines you show, if you are having a problem, that may be the cause.

  • Referencing a button on main stage from inside a movieclip

    I am banging my head against the wall on this.
    On the main stage I have a button that I have made invisible once the file is loaded.  Inside a movieclip I have on frame 15 the following actionscript 3 code
    button_mc.visible = true;
    I want the button to become visible at the end of this movieclip.  I am not using an external as3 file, I am putting the as3 code in its own layer on the first frame.
    I know it has something to do with the path to the button, but I cannot figure it out.  If there is anyone who can point me in the right direction for referencing instances by instance name that reside on the main satge from inside a movieclip I would be very grateful.
    Thanks
    Thepopguy

    Try:
    MovieClip(this.parent).button_mc.visible = true;

  • Help (retrieving image name from xml then will be echoed inside the movieclip

    Hello guys, I just want to ask sometihng on how to show the image inside the movieclip by pulling the image name inside the xml file.
    this is my xml file.
    <?php
    header("Content-type: text/xml");
    $host = "localhost";
    $user = "root";
    $pass = "";
    $database = "test";
    $gelo= "image1.jpg";
    /*xml output*/
    $xml_output = "<?xml version=\"1.0\" ?>";
          $xml_output .= "<GALLERY>";
              $xml_output .="<IMAGE>" . $gelo . "</IMAGE>";
         $xml_output .= "</GALLERY>";
    echo $xml_output;
    ?>
    //this is the code inside my actionscript
    stage.scaleMode = StageScaleMode.NO_SCALE;
    var loader:URLLoader = new URLLoader();
    loader.dataFormat = URLLoaderDataFormat.TEXT
    loader.addEventListener(Event.COMPLETE, loadCompleteHandler);
    loader.load(new URLRequest("http://localhost/loadimagefromxmlAS3/data.php"));
    function loadCompleteHandler(event:Event):void {
    var xml:XML = new XML(event.target.data);
    //txt.text = xml.toXMLString();
    trace(xml.IMAGE[0]);
    var list:XMLList = xml.data.title
    var loader:Loader = new Loader()
    this["holder_mc"+0].addChild(loader)
    loader.load(new URLRequest(list[0].IMAGE))    
    When I run it in flash, I got the error
    image1.jpg
    TypeError: Error #1010: A term is undefined and has no properties.
        at xml_fla::MainTimeline/loadCompleteHandler()
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at flash.net::URLLoader/onComplete()
    I hope you will consider my ignorance since im a beginner using the actionscript. Thank you

    1) You should have "Permit debugging" enabled in Publish settings so you could tell exactly witch line is wrong
    2) This line makes no sense to me: var list:XMLList = xml.data.title
         Change it to var list:XMLList = xml.IMAGE;
    3) loader.load(new URLRequest(list[0].toString()));
    4) Also this line is suspicious: this["holder_mc"+0].addChild(loader)
         Why don't just say: holder_mc0.addChild(loader)?

  • I have a movieclip running inside a movieclip and i want to trigger

    I have a movieclip running inside a movieclip and i want trigger an action on the timeline -
    in AS2 I would put _root.gotoAndPlay("start6_fl"); or _parent.gotoAndPlay("start6_fl"); depending on were I wanted to go -
    How do you do this really simple action in AS3?

    Try using...
    MovieClip(this.root).gotoAndPlay...
    or
    MovieClip(this.parent).gotoAndPlay...

  • Calling a variable from inside a movieclip AS3 in Flash CS4

    I am trying to trace a variable string from inside a movieclip which is inside another movieclip on the main timeline using:
    trace(VariableString);
    and also
    trace(stage.VariableString);
    Neither work
    The variable is an input textfield and traces fine when it is on the main timeline but will not work from inside the movieclip. I am using Actionscript 3 in Flash CS4.
    I appreciate this has probably been discussed previously on this forum but I cannot find a difinitve answer that seems to work.
    Thanks

    Thanks for the reply. However this did not seem to work.
    I think I had better explain a little better.
    On Keyfrme1 I have a MovieClip1 containing a text input component. I have created a variable on keyframe 1 using:
    var VariableString1:String = new String();
    When clicking on a seperate button this happens:
    VariableString1 = MovieClip1.text;
    I can trace this correctly on the main timeline using:
    trace(VariableString1);
    However, if I try to trace this from  another keyframe inside a movieclip2 which is inside another movieclip3 using:
    trace(MovieClip1(root).VariableString1);
    I just get the error 1180 call to a possibly undefined method MovieClip1
    Sorry if this is not very clear but I am getting very confused with this.
    Thanks again

  • I can no longer load certain games on face book after updating to 4.0.1

    after updating to 4.0.1 I can no longer load the game farmville or frontierville on facebook. i first tried to send a feed back and it indicated that I had the wrong version. I went through reseting the useragent as per your instructions but not all of your useragents you indicated were listed. I then tried again to send a feedback this time it went through but after entering my comments it would not send them. So do I uninstall firefox and start over? If I do what happens to my bookmarks?

    It went a little farther this time after disabling AVG. The problem still exists it will not continue loading the app. It just goes dead there is no traffic on the sat modem, also it does not show any friends when I try to send gifts. All of this worked with the previous version of FireFox. I tried it with Google Chrome and everything worked just fine.
    Thanks for the input - any other ideas?

  • I go to play on a game on my iPad it will load the game up and a minute later will go to a blank screen and then back to all my apps.does it everybtime? Why is that? What do I need to do to stop it?

    I go to play on a game on my iPad it will load the game up and a minute later will go to a blank screen and then back to all my apps.does it everybtime? Why is that? What do I need to do to stop it?

    1. Close all inactive apps in the Task Bar. Double-click the Home button and hold apps down for a second or two and tap the minus sign to close app.
    2. Try a reset. Hold the Sleep and Home button down for about 10 seconds until you see the Apple Logo

  • Problem in Loading a File on the MovieClip..

    I want to load an image on the MovieClip at run time..
    This should be done using file reference Class instance..
    By this user can brwose the file load whatever he wants..
    I had tried this but when user select the file in code we
    just have name of the file not whole path..
    So to load an image on movieClip we require the whole path..
    Any one knows how I can achive this...??
    Thanks...

    You have to upload it with FileReference.upload() to a PHP
    (or other server-side) script which saves it to a folder on the
    server. When the DataEvent.UPLOAD_COMPLETE_DATA event has been
    dispatched you can then use the FileReference.name to load from the
    file on the server just like any other image.

  • Load youtube video in a movieclip

    hello all,
    i m trying to load youtube videos in my flash8 application.i
    m using this code:--
    System.security.allowDomain("
    http://www.youtube.com")
    System.security.loadPolicyFile("
    http://www.youtube.com/crossdomain.xml")
    this.createEmptyMovieClip("image_mc",
    this.getNextHighestDepth())
    var mclListener:Object = new Object();
    mclListener.onLoadInit = function(target_mc:MovieClip) {
    target_mc._x = 0;
    target_mc._y = 0;
    var image_mcl:MovieClipLoader = new MovieClipLoader();
    image_mcl.addListener(mclListener);
    image_mcl.loadClip("
    http://www.youtube.com/v/818hQQmxHaM&rel=1",
    image_mc)
    This code is working fine but as i try to load other youtube
    video on same movieclip on a button click event it loads nothing.
    //code written on click event of button:--
    on(click)
    _root.image_mcl.loadClip("
    http://www.youtube.com/v/5-43Xu6wrK0&rel=1",
    _root.image_mc)
    please help me on this issue.
    thanks in advance

    thanks for your reply.I have updated my code as u told me but
    my problem is still same as before.
    First time youtube video loaded properly but if i try to load
    another video on same movieclip,it display flv player with its
    control bar, but no flv file loaded on it.
    please help me again
    thanks in advance

  • Loading a SWF inside another SWF question

    Hello friends,
    1. (IMPORTANT) As all we know when putting some Flash SWF
    inside an HTML page, normally it starts playing as soon as its
    first frame is loaded.
    Now in my case I have to load a SWF (let call it Flash A)
    inside another Flash, I used mx.controls.Loader control to do this.
    But this internal loaded SWF (Flash A) doesn't display untill it is
    completely loaded. Although what is interesting is that if it
    contains a sound track I can hear it while it is being loaded.
    I wana know is there any way that we can make this Flash
    display while being still loaded.
    2. Is there anyway to change a Flash playback FPS at runtime?
    Thank you so much for any note and help.
    - M

    damatrixhasu wrote:
    > i want to know how i can load a flash inside another
    flash container
    go to help - search for 'loadmovie'
    Best Regards
    Urami
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Firefox is preventing Java from loading Pogo games which require it

    I have just updated to the latest Firefox and now java is being prevented from loading Pogo games which require it. I have unchecked the block popups box and enabled java script but each time I try to load I get a message on the java concol saying permission denied. I went to IE8 (yuck) and the game loaded fine.
    Help please.

    For as much as I spend on membership there I don't need these problems... I DIDN'T update my FF it happened automatically which * me off since i like to wait until all the bugs are gone...
    ''edited for language - TonyE''

  • Is It possible to load Html page inside Adobe Flash...?

    Hi Everyone!
    Is It possible to load Html page Inside Adobe Flash CS5.
    Any help would be a great help...!
    Originally, i wanted to bring in through <IFRAME> but i don't see that flash understands that.
    Thanks in advance!
    -yajiv

    Not exactly sure how you where planning to display that HTML content in relation to the overall page, but given the limitations of Flash... that may just not be possible...
    But, it would be a simple matter to display an HTML iframe over the top of or behind a Flash .swf... So while the iframe would not be a part of the .swf, it certainly could be designed to make it look as though it were.
    Controling the stacking order or layering of content on a Web page is accomplished through z-indexing. Correctly positioned and z-indexed, the iframe could apear over the top of the .swf... the .swf in effect being the background... OR the iframe could appear behind the .swf and with a transparent section in the .swf, the iframe would appear through that hole. If there is navigation or links in the iframe, they will be blocked by the .swf though.
    http://www.w3schools.com/cssref/pr_pos_z-index.asp
    But this may be an option....
    Best wishes,
    Adninjastrator

  • Is It possible to load Html page inside Adobe Flash Professional..?

    Hi Everyone,
         Is It possible to load Html page inside Adobe Flash Professional or Adobe Flex. Thanks in Advance.
    -Vijay

    probably not the way you are thinking.
    flash textfields and their extensions have a limited number of html tags they can parse so, in general, html from most web pages will not display, as expected in flash.

Maybe you are looking for