How to control a loaded flash movie? Please help!!!

Hello everyone
I'm creating a web site with multiples swf files, the navigation is controlled via drop down menu, i have resolved the script for the drop down menu main buttons and i need to control the timeline of the movies loaded with the drop down menu main sub buttons to navigate into specific frames
this is what i got:
stop();
var myrequest:URLRequest=new
URLRequest("HomeSonny.swf");
var myloader:Loader=new Loader
myloader.load(myrequest);
stage.addChild(myloader);
//main buttons
menu.nosotros.addEventListener(MouseEvent.CLICK, clickmouse);
//menu.islas.addEventListener(MouseEvent.CLICK, clickmouse);
//subButtons
menu.historia.addEventListener(MouseEvent.CLICK, subMenu);
//event listener main buttons
function clickmouse(evt:MouseEvent):void {
     trace("click")
     myloader.load(new URLRequest("swf/"+evt.target.name+".swf"));
//listener loaded movie
myloader.contentLoaderInfo.addEventListener(Event.COMPLETE, subMenu);
//event listener sub buttons control loaded movie
function subMenu(evt:MouseEvent):void {
     trace("clickSub")
     var mycontent:MovieClip=evt.target.content;
     mycontent.gotoAndStop("historia");
the problem is when i click the drop down menu sub button, does not go to the label frame of the loaded swf fil.
What am i doing wrong?
sample in the file....
thanks for watching.........

See code and comments below. I don't guarantee that it will fix all your troubles though - you have big flaws in the logic:
stop();
// declare this var here so that is accessible
var mycontent:MovieClip;
var myrequest:URLRequest=new URLRequest("HomeSonny.swf");
var myloader:Loader = new Loader();
// you need to add listener here - before you start loading
// also you shouldn't mix loading with mouse click
myloader.contentLoaderInfo.addEventListener(Event.COMPLETE, onFileLoad);
myloader.load(myrequest);
// since your content changes - you shouldn't add it here
// stage.addChild(myloader);
//main buttons
menu.nosotros.addEventListener(MouseEvent.CLICK, clickmouse);
//subButtons
menu.historia.addEventListener(MouseEvent.CLICK, subMenu);
function onFileLoad(e:Event):void {
     // remove previous content
     if (mycontent) {
          removeChild(mycontent);
          mycontent = null;
     mycontent = evt.target.content as MovieClip;
     addChild(mycontent);
function clickmouse(evt:MouseEvent):void {
     trace("click")
     myloader.load(new URLRequest("swf/"+evt.target.name+".swf"));
function subMenu(evt:MouseEvent):void {
     trace("clickSub")
     mycontent.gotoAndStop("historia");

Similar Messages

  • Variables into flash movie  -  Urgent help needed, please

    I am hoping this is simple:
    Here is my HTML code:
    <param name="movie" value="orig2.swf" /><param
    name=FlashVars VALUE="sname=video1.flv"><param name="quality"
    value="high" /><param name="bgcolor" value="#ffffff" />
    I need to pass video1.flv to the flash movie.
    Here is the MOVIE data. I was told this is how to do it, but
    I am sure it's missing something basic.
    //insert sample link below
    mediaDisplay.directLink = "
    http://flash.xxx.com/flashgen.cgi?sname=&aname=xxxxxxxx/_definst_";
    //pulls sname from param value in HTML
    mediaDisplay.simplePlaylist = sname;
    streamnameTxt.text = sname;
    So, it should pull the SNAME variable from HTML and feed it
    into player. If I type in SNAME variable and manually place it in
    DirectLink line above, it works, but I need it to feed from HTML.
    PLEASE HELP!!

    I know how to pass the variable TO flash, but how do I get
    the FLASH movie to receive it??
    Again, here is the code in the FLA file
    //insert sample link below
    mediaDisplay.directLink = "
    http://flash.xxx.com/flashgen.cgi?sname=&aname=xxxxxxxx/_definst_";
    //pulls sname from param value in HTML
    mediaDisplay.simplePlaylist = sname;
    streamnameTxt.text = sname;

  • ITunes wont open for me. it keeps saying "the Disc "untitled playlist" cannot be read. An unknown error occurred (-69)." don't know how to get it to work. Please help

    iTunes wont open for me. it keeps saying "the Disc "untitled playlist" cannot be read. An unknown error occurred (-69)." don't know how to get it to work. Please help

    It is likely a hardware failure
    http://support.apple.com/kb/TS3694?viewlocale=en_US#error1

  • TS4605 Hi, I was working in WORD on a file containing huge data. My machine just hung up one day while working and now I seem to have lost the file how do I get it back.  Please HELP me.

    Hi, I was working in WORD on a file containing huge data. My machine just hung up one day while working and now I seem to have lost the file how do I get it back.  Please HELP me.

    Well, iCloud has nothing to do with this.
    Do you have the built-in backup function Time Machine running on your Mac?
    See: http://support.apple.com/kb/ht1427

  • HT1199 Hai, i tried to open itunes on my windows 8 laptop but it comes out with 'iTunes has stop working' notification and need to close the program everytime i try to load it. Please help! thanks.

    Hai, i tried to open itunes on my windows 8 laptop but it comes out with 'iTunes has stop working' notification and need to close the program everytime i try to load it. Please help! thanks.

    Hi ajay-9,
    Thanks for visiting Apple Support Communities.
    The steps in this article can help if iTunes is quitting unexpectedly on your PC:
    iTunes for Windows Vista, Windows 7, or Windows 8: Fix unexpected quits or launch issues
    http://support.apple.com/kb/ts1717
    Cheers,
    Jeremy

  • I recently bought a dbx hardware compressor and am not quite sure how to use it in logic express 9. I hav a focusrite saffire 6 usb audio interface and am not dont how to use it in logic. Please help???

    I recently bought a dbx hardware compressor and am not quite sure how to use it in logic express 9. I hav a focusrite saffire 6 usb audio interface and am not dont how to use it in logic. Please help???

    MUYconfundido wrote:
    Pancenter,
    Thanks for the response, but I do not have a midi interface. I am using a midi to usb connector cable, thus bypassing the need for a Midi interface.
    The Mac reads the USB cable as a midi device, but not the keyboard that I am trying to use as a controller. I have tried it with my korg sp 300 and with my Nord Electro 2.
    Thoughts?
    Thanks,
    Tristan
    Tristan...
    This is what you have, correct?
    http://www.alesis.com/usbmidicable
    This from Alesis..
    "The AudioLink Series USB cable receives and outputs MIDI signal thanks to its internal interface. The USB-MIDI Cable connects plug-and-play to your Mac or PC for an all-in-one USB-MIDI solution."
    Notice, -internal interface-. What you have is a simple USB MIDI Interface. Most MIDI interfaces are USB.
    My point is (was), MIDI OUT of the Korg goes to the connector marked MIDI IN on the Alesis, those new to MIDI often get this wrong.
    pancenter-

  • I have the 10.7.4 and I cannot get the Flash Player ,, please help me.

    I have the 10.7.4 and I cannot get the Flash Player ,, please help me.

    If you downloaded it, it's likely in your Downloads folder as a Disk Image .dmg. Just open it and intall Flash player and restart your browser. Everything should work.
    Clinton

  • I just updated my iPod touch and all my pictures are gone!!! How do I get them back? Please help!!!

    I just updated my iPod touch 4th generation to iOS 6.0.1 and all my pictures are gone!!! Everything else is there but my pictures! How do I get them back? Please help!!!

    If the photos were i your iPod's Camera Roll album (taken by or saved to the iPod you can:
    - If your PhotoStream is on you can get the last 30 days worth back. See that topic here:
    iOS: Importing personal photos and videos from iOS devices to your computer
    - Or you can restore from backup if you backed up when the photos were on the iPod.
    If the photos were synced to the iPod then you have to get them from where you got them the first time.

  • How to acess Database in I18N? Please help.

    How to acess Database in I18N? Please help.

    I have tried to overide the getContents() method of ListResourceBundle class but it returning an error at run time saying null Pointer exception.
    Here are the 2 codes resp.
    import java.util.*;
    public class Test1
         static String string ;
         public static void main(String args[])
    Locale locale = Locale.ENGLISH;
    ResourceBundle myResources =
    ResourceBundle.getBundle("MyResources", locale);
    string = myResources.getString("HelpKey");
    System.out.println(string);
    import java.util.*;
    import java.sql.*;
    public class MyResources extends ListResourceBundle
         static String[][] s3= null;
    String s6= null;
         String s7= null;
    public Object[][] getContents()
    Object[][] obj= (Object[][])dataBase();
              for(int i= 0; i< obj.length;++i){
                   for(int j = 0;j<obj.length;++j){
                        System.out.println("GGGGGGGG obj["+i+"]["+j+"]"+obj[i][j]);
              //s6=(String)obj[0][0];
         //     s6= obj[0][0].toString();
              //s7=obj[1][0].toString();
    Object[][] contents = { {s6},{s7}};
         return contents;
         private static String[][] dataBase()
         {           try
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   Connection con=DriverManager.getConnection("jdbc:odbc:DSN");
                   PreparedStatement stat= con.prepareStatement("Select Value,Key from Table1 where Key= ?");
                   String s1= "HelpKey";
                   stat.setString(1,s1);
                   ResultSet rs= stat.executeQuery();
                   while(rs.next())
                        String s2= (String)rs.getString("Key");
                        String s4= (String)rs.getString("Value");
                        String[][] s3 ={{s2},{s4}};
              catch(Exception e)
              e.printStackTrace();
         return s3;

  • HT1386 I have been trying to sync my iPhone and its not syncing. I've synced it before but now it has gone away. How can I re-sync it? Please help.

    I have been trying to sync my iPhone and its not syncing. I've synced it before but now it has gone away. How can I re-sync it? Please help.

    you did enable Music syncing in iTunes, yes?

  • How do I get PBS again?  Please help!!!

    I was able to get PBS when I first got Apple TV after putting in a code, but my cable company recently changed their channel lineup, and I can no longer get PBS on Apple TV.  I used to get PBS on channel 314 on my TV, but after speaking with my cable company, I now get it on channel 198, but I can't get anything at PBS on Apple TV. All I get when I go there is the "downloading circle" and nothing happens.  The cable company can't help, and I've written to PBS several times with no reply.  I thought maybe I could get a different code and start over, but I don't know how to do that.  Can anyone help, please.  PBS is one
    of the main reasons I bought Apple TV.  Thanks. 

    I don't know who vaszandrew is, but I (diamond2277) wrote How do I get PBS again?  Please help!!! 
    It got printed and I lost my page so I started over again, and the one above with my question showed             (dated May 2, 9:56 am) as if it were an answer to vasndrew.
    After I wrote, it occurred to me that maybe if I disconnect my Apple TV and reconnect it, I will get PBS, and it worked.  Now I don't need an answer.  Thanks to anyone who was going to answer!  I have to remember my usual answer to technical problems, UNPLUG, AND START AGAIN.

  • My ebay toolbar and the ebay logo that was in my system tray at the bottom have both disappeared when I installed FireFox??? How do I get them back? Please help.

    my ebay toolbar and the ebay logo that was in my system tray at the bottom have both disappeared when I installed FireFox??? How do I get them back? Please help.

    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Repair Database. If that doesn't help, then try again, this time using Rebuild Database.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. (In Library Manager it's the FIle -> Rebuild command)
    This will create an entirely new library. It will then copy (or try to) your photos and all the associated metadata and versions to this new Library, and arrange it as close as it can to what you had in the damaged Library. It does this based on information it finds in the iPhoto sharing mechanism - but that means that things not shared won't be there, so no slideshows, books or calendars, for instance - but it should get all your events, albums and keywords, faces and places back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. 
    Regards
    TD 

  • My iphone 4 screen turns into blue, and i can't do anything because my power button is broken. How to fix my iphone back? Please help me

    my iphone 4 screen turns into blue, and i can't do anything because my power button is broken. How to fix my iphone back? Please help me

    I am having the SAME exact problem! Except instead of lock button broken it's my home button so I can't do the whole "put in recovery mode" deal. My screen only says "tap the home button 3 times" and it has my screen locked until I hit the home button but since it is broken I can't get in my phone at all. I have all of my work info in my phone so I'm screwed and can't get any help. PLEASE let me know if you find a way around this...!!!
    Thanks!

  • TS3694 How do i fix error 3194? please help!

    How do i fix error 3194? please help!

    iOS of your iPhone could be modified / hacked. No one will be able to support you in this Forum.

  • My Ipod doesen't work when I try to connect it on my iTunes! How can I solve this problem? Please help me

    My Ipod doesen't work when I try to connect it on my iTunes! How can I solve this problem? Please help me

    Itunes doesen't see the ipod and it is all dark!

Maybe you are looking for