AS3 parent loading in AS2 child that in turn loads in jpegs *Problem*

Hiya everybody.
I'm getting a bald patch on my head from frustration with the following problem.
I have a parent AS3 swf which loads in a AS2 swf like so;
stop();
var ldr:Loader = new Loader();
ldr.load(new URLRequest( "as2child.swf"));
addChild(ldr);
contained in the AS2 file is the following script which loads in jpegs when the user clicks the next button, etc.
//stuff that loads in different photos
stop();
var i:Number = 1;
//load first image straight away.
function initialloadup () {
i = 1;
startLoading("pic"+i+".jpg");
initialloadup();
next_btn.onRelease = function () {
/*on clicking next image button load next image in sequence*/
i++;
if (i > 11 ) {i = 1};
startLoading("pic"+i+".jpg");
trace("pic"+i+".jpg");
prev_btn.onRelease = function () {
//on clicking previous image button load prev image in sequence
i--;
if (i < 1 ) {i = 11};
startLoading("pic"+i+".jpg");
function startLoading(whichImage) {
loadMovie(whichImage, "imageLoader");
however when you view the AS2 swf via the AS3 swf it does not seem to load in the jpgs when requested.
I need to retain the AS2 file so cannot rewrite in AS3 as the image loading thing is only a small part of the AS2 file.
Any ideas? might it be to do with how the AS2 is read in AS3?
Cheers for your reading this
Melacroso

Hi Ned,
Cheers for your thoughts. I've heard of the lockroot thingymajig. Tried it out but to no avail.
I've attached a zip file containing the fla's and swf's and jpgs, just incase anyone yourself included might have anymore ideas.
Thanks for your time
Alec

Similar Messages

  • Loading an external swf that loads an object from url

    i am trying to load an external swf that in turn automatically loads an object. i want the external swf to only be loaded once the object is loaded in it. right now it loads the external swf first and then the external swf loads the object specified at a url...

    thanks kglad. i think i need to try and load the external swf, wait for it to load its object, and then display it... will look into it and get back...

  • SQL Server 2012 Management Studio:In the Database, how to print out or export the old 3 dbo Tables that were created manually and they have a relationship for 1 Parent table and 2 Child tables?How to handle this relationship in creating a new XML Schema?

    Hi all,
    Long time ago, I manually created a Database (APGriMMRP) and 3 Tables (dbo.Table_1_XYcoordinates, dbo.Table_2_Soil, and dbo.Table_3_Water) in my SQL Server 2012 Management Studio (SSMS2012). The dbo.Table_1_XYcoordinates has the following columns: file_id,
    Pt_ID, X, Y, Z, sample_id, Boring. The dbo.Table_2_Soil has the following columns: Boring, sample_date, sample_id, Unit, Arsenic, Chromium, Lead. The dbo.Table_3_Water has the following columns: Boring, sample_date, sample_id, Unit, Benzene, Ethylbenzene,
    Pyrene. The dbo.Table_1_XYcoordinates is a Parent Table. The dbo.Table_2_Soil and the dbo.Table_3_Water are 2 Child Tables. The sample_id is key link for the relationship between the Parent Table and the Child Tables.
    Problem #1) How can I print out or export these 3 dbo Tables?
    Problem #2) If I right-click on the dbo Table, I see "Start PowerShell" and click on it. I get the following error messages: Warning: Failed to load the 'SQLAS' extension: An exception occurred in SMO while trying to manage a service. 
    --> Failed to retrieve data for this request. --> Invalid class.  Warning: Could not obtain SQL Server Service information. An attemp to connect to WMI on 'NAB-WK-02657306' failed with the following error: An exception occurred in SMO while trying
    to manage a service. --> Failed to retrieve data for this request. --> Invalid class.  .... PS SQLSERVER:\SQL\NAB-WK-02657306\SQLEXPRESS\Databases\APGriMMRP\Table_1_XYcoordinates>   What causes this set of error messages? How can
    I get this problem fixed in my PC that is an end user of the Windows 7 LAN System? Note: I don't have the regular version of Microsoft Visual Studio 2012 in my PC. I just have the Microsoft 2012 Shell (Integrated) program in my PC.
    Problem #3: I plan to create an XML Schema Collection in the "APGriMMRP" database for the Parent Table and the Child Tables. How can I handle the relationship between the Parent Table and the Child Table in the XML Schema Collection?
    Problem #4: I plan to extract some results/data from the Parent Table and the Child Table by using XQuery. What kind of JOIN (Left or Right JOIN) should I use in the XQuerying?
    Please kindly help, answer my questions, and advise me how to resolve these 4 problems.
    Thanks in advance,
    Scott Chang    

    In the future, I would recommend you to post your questions one by one, and to the appropriate forum. Of your questions it is really only #3 that fits into this forum. (And that is the one I will not answer, because I have worked very little with XSD.)
    1) Not sure what you mean with "print" or "export", but when you right-click a database, you can select Tasks from the context menu and in this submenu you find "Export data".
    2) I don't know why you get that error, but any particular reason you want to run PowerShell?
    4) If you have tables, you query them with SQL, not XQuery. XQuery is when you query XML documents, but left and right joins are SQL things. There are no joins in XQuery.
    As for left/right join, notice that these two are equivalent:
    SELECT ...
    FROM   a LEFT JOIN b ON a.col = b.col
    SELECT ...
    FROM   b RIGHT JOIN a ON a.col = b.col
    But please never use RIGHT JOIN - it gives me a headache!
    There is nothing that says that you should use any of the other. In fact, if you are returning rows from parent and child, I would expect an inner join, unless you want to cater for parents without children.
    Here is an example where you can study the different join types and how they behave:
    CREATE TABLE apple (a int         NOT NULL PRIMARY KEY,
                        b varchar(23) NOT NULL)
    INSERT apple(a, b)
       VALUES(1, 'Granny Smith'),
             (2, 'Gloster'),
             (4, 'Ingrid-Marie'),
             (5, 'Milenga')
    CREATE TABLE orange(c int        NOT NULL PRIMARY KEY,
                        d varchar(23) NOT NULL)
    INSERT orange(c, d)
       VALUES(1, 'Agent'),
             (3, 'Netherlands'),
             (4, 'Revolution')
    SELECT a, b, c, d
    FROM   apple
    CROSS  JOIN orange
    SELECT a, b, c, d
    FROM   apple
    INNER  JOIN orange ON apple.a = orange.c
    SELECT a, b, c, d
    FROM   apple
    LEFT   OUTER JOIN orange ON apple.a = orange.c
    SELECT a, b, c, d
    FROM   apple
    RIGHT  OUTER JOIN orange ON apple.a = orange.c
    SELECT a, b, c, d
    FROM   apple
    FULL OUTER JOIN orange ON apple.a = orange.c
    go
    DROP TABLE apple, orange
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Loading an AS2 Swf into an AS3 project

    I have a need to be able to load legacy AS2 SWF's into a new
    AS3 project. I know that this is not readily possible, because you
    can only communicate between the two via the LocalConnection class.
    So, what I have done is to create an AS2 proxy SWF. This SWF will
    handle the loading of all legacy SWF's and act as a middleman to
    pass the function calls between the pre-compiled SWF and the new
    SWF using the LocalConnection class. The new SWF also needs to be
    able to load AS3 SWF's, though.
    Because of this, I have the need to detect the AS version of
    the loaded SWF. If 1 or 2, then change the source to the
    AS2Proxy.swf, if 3 then simply load it.
    I have written the following code. My problem comes in when
    the init event fires. Regardless of the compiled version of the
    loaded SWF, it always traces 3 as the AS version.

    Alright, I solved this problem, only to come up with many
    more.
    To solve this problem, I needed to point to the loaderInfo
    object of the UILoader's content. So:
    simulation.content.loaderInfo.actionScriptVersion.
    Now the proxy loads correctly, but I start getting errors
    immediately. Let me paste some code to show the next steps:
    First off. I immediately receive a StatusEvent error, though
    the path gets sent into the proxy and loads correctly.
    Next, when the complete event fires in the AS2 SWF - it sends
    a completion back up to let the AS3 SWF know that it finished (and
    any handling that needs to happen at that point.) I receive the
    following error:
    Error #2044: Unhandled AsyncErrorEvent:. text=Error #2095:
    flash.net.LocalConnection was unable to invoke callback loadSwf.
    error=ReferenceError: Error #1069: Property loadSwf not found on
    com.applied.flash.events.AS2Connect and there is no default
    value.

  • Loading an AS2 swf into a AS3 project?

    I have an AS2 swf that is merely an image gallery made with a few components. I tried loading this swf into an AS3 project I am working on and it seems to load in and play properly in my AS3 file. I'm not looking to communicate with the AS2 swf with AS3 code, I just want to display it and be able to use the component buttons in the AS2 file that play or stop the images from being played.  I was wondering if using this will cause any potential issues in my AS3 project. It seems to render and work fine on my machine. Thanks

    as2 swfs will play without problem when loaded into an as3 swf.

  • How do you load an AS2 swf into AS3?

    I think this is the way around my dilemma. How do you load and AS2 .swf into an AS3 file?
    thanks again!
    Steve

    check that code in your last thread:
    What is the  code to load a .swf file in AS3 on the same layer?

  • Problem:  Unable to call a function in parent swf from the child swf.

    I am working on a site right now that has a parent loader
    (all it contains are the menu bar [which is as3 tweened] and the
    functions for calling all of the other pages.) The problem that I
    am having right now, are some of the internal or child pages, need
    to call functions that are in the parent loader. For what ever
    reason, I am unable to do any of that.
    I have attached the code so you can look at that.
    Let me see if I can explain it any better.
    The code I just posted is for the Main Stage swf called
    loader.swf. It has the menu, and all the functions that control the
    menu's movement and when to load all the other swfs. The easiest
    way for me to ask this, is to show you.
    click
    http://dev.locallinux.com/mystictan/layout2.html
    When you get there, you will see the menu bar, and it is
    loading home.swf onto the stage behind the menu.
    Mouse over "The Perfect Tan" and click on "1: Base"
    You will notice it just loaded a new swf called ptbase.swf.
    Well in that swf is a button for "Products" That button
    basically needs to take you to "Products > 1: Base" on the menu
    (not working yet, I know. But theres no point in me making that,
    until I could get this working"
    What I would like is when you click on "Products" in
    ptbase.swf, it calls the function clickedProductsBase(), which does
    its thing. But that function is back in the loader.swf. Does that
    make sence?
    What am I missing here?

    RyanORo, thank you very much for your response.
    I try that, and I get this sort of error when I click on it:
    TypeError: Error #1006: fwd is not a function.
    at ptbase_fla::MainTimeline/testing()
    I know all that code that I posted was a bith much, but here
    is the movie loading part:
    function loadComplete(event:Event):void
    loaderbar.visible = false;
    mainbody.removeChild(thisMC);
    thisMC = MovieClip(myloader.content);
    myloader.unload();
    mainbody.addChild(thisMC);
    thisMC.gotoAndStop(1);
    TransitionManager.start(thisMC, {type:Fade,
    direction:Transition.IN, duration:5, easing:Strong.easeOut});
    mainbody is an empty mc under the menu, so that the loaded
    swf file appears under the menu.
    You know what, scratch all that . *MOOWHA* I could KISS you
    right now. "(parent as MovieClip).clickedProductsBase()" did not
    work because it was calling it out of the wrong parent. Just did
    "(this.parent.parent as MovieClip).clickedProductsBase()" and that
    did the magic I needed. Thanks...

  • Loading external SWF's into an SWF Loader as3 style?

    Hi,
    I've recently made the switch from as2 to as3 and am still struggling to get my head around one aspect in particular. I've managed to load one external swf into a blank file via the script
    import LoadDisplayObject;
    var loader:LoadDisplayObject = new LoadDisplayObject("button_01.swf", true);
    loader.addEventListener("displayObjectLoaded", onComplete, false, 0, true);
    addChild(loader);
    function onComplete(evt:Event):void {
         trace("loaded complete received");
         loader.scaleX = loader.scaleY = .75;
    .....however I'm struggling with the script to make a swfs load into a space when one of my 3 buttons is clicked....
    My page currently has three buttons (button_01, button_02 and button_03) and in a local folder three separate swfs with the same names which I wish to load in, when the appropriate button is pressed. 
    I have managed to get them to load in using a tutorial...however they load over the top of each over...far from ideal. From research on the internet I've found a range of different script...but I just can’t find anywhere I can find script to make this work..hence why I have turned to here.
    Any help much appreciated...thanks in advance.

    Hi,
    Just throught I would let you know that I've manged to get this to work this morning. Changed the script slightly and used a different method of:
    var home:MovieClip = this;
    function butt1Click(evt:MouseEvent):void {
        var ldr:Loader = new Loader();
        ldr.load(new URLRequest("button_01.swf"));
        ldr.contentLoaderInfo.addEventListener(Event.INIT, loaded);
    function butt2Click(evt:MouseEvent):void {
        var ldr:Loader = new Loader();
        ldr.load(new URLRequest("button_02.swf"));
        ldr.contentLoaderInfo.addEventListener(Event.INIT, loaded);
    function butt3Click(evt:MouseEvent):void {
        var ldr:Loader = new Loader();
        ldr.load(new URLRequest("button_03.swf"));
        ldr.contentLoaderInfo.addEventListener(Event.INIT, loaded);
    function loaded(evt: Event):void {
        if(contentClip.numChildren > 0){
            contentClip.removeChildAt(0);
        contentClip.addChild(evt.target.content);
    button_01.addEventListener(MouseEvent.MOUSE_UP, butt1Click);
    button_02.addEventListener(MouseEvent.MOUSE_UP, butt2Click);
    button_03.addEventListener(MouseEvent.MOUSE_UP, butt3Click);
    seems to work well. Only small question is if I want one page to load automatically upon opening...how do I alter the script to do this??? Thanks

  • Change loaded movie from child

    Hi,
    I am new to AS3. Here I want to ask how to change the loaded movie from child?
    Here is my working code, but it doesn't works...
    Root:
    var contentMovie:MovieClip = new mcMain;
    contentMovie.name="content_mc";
    addChild(contentMovie);
    Child Content:
    changecontent_btn.addEventListener(MouseEvent.CLICK,LoadContent);
    function LoadContent(event:MouseEvent):void
       parent.contentMovie = mcNew;
    When I try to run, Flash shows the error "1119: Access of possibly undefined property contentMovie through a reference with static type flash.display:DisplayObjectContainer."

    use:
    var contentMovie:MovieClip = new mcMain();
    contentMovie.name="content_mc";
    addChild(contentMovie);
    Child Content:
    changecontent_btn.addEventListener(MouseEvent.CLICK,LoadContent);
    function LoadContent(event:MouseEvent):void
    // the next line doesn't make any sense but if it did, this is how it should be written
      MovieClip(parent).contentMovie = mcNew;

  • Using loaded fonts in child swf

    Hello,
    I have an ad container that loads a handful of resources of which some are fonts and some are swfs. My problem is that the font is loaded from an url, is registered and works fine embedding it to the textfields created in the ad container. The problem is that when I try to embed it to the textfields in some of those loaded SWFs it does not work.
    The font loads and gets registered before the swf gets loaded. The SWF file then gets an event telling it to embed the font there as well. While checking, from within the child SWF file, the Font.enumerateFonts() array I can see that the fonts have been succesfully registered. My problem is that even if that array shows me the fonts, when I try to embed them in the child SWF file nothing appears. I even use something like myTextFied.font = Fonts.enumerateFonts()[0].fontName, while embedFonts is set to true and antiliasing is set to advanced.
    I tried it in all manner of ways and none gives me any results. The font which is loaded is stored as a library item with Linkage inside a SWF file. So to load a font I load SWF file containing that font. It works fine for the ad container (main SWF) but not for children SWFs.
    Any suggestions?
    Thank you a lot!
    Vlad

    You may need to create instance of font class and register font in every loaded swf. This is an RSL approach.
    This post outlines the idea:
    http://krasimirtsonev.com/blog/article/AS3-flash-runtime-font-loading-embedding

  • How to get the parent window in sub-child controller class in javafx?

    how to get the parent window in sub-child controller class in javafx?

    You can get the window in which a node is contained with
    Window window = node.getScene().getWindow();Depending when this is invoked, you might want to check the Scene is not null before calling getWindow().
    If the window is a stage that is owned by another window, you can get the "parent" or "owner" window with
    Window owner = null ;
    if (window instanceof Stage) {
      Stage stage = (Stage) window ;
      owner = stage.getOwner();
    }

  • Embed AS3 swf into a AS2 FLA?

    HI, I have a flash site designed in AS2 and want to embed a
    AS3 video player in it. If I republish the AS2 site to AS3 the
    website doesnt function, and if I load the AS3 swf into the
    website, the Player doesnt function.
    I need the AS2 functionality on the website and I need the
    advanced AS3 functionality on the video Player.
    Is there any way to get these two guys to talk to each
    other?

    Creating a 3rd fla, to load the AS2 Fla and the AS3 FLA just
    aint gonna fly. This website is updated daily and its just too much
    of a maintenance nightmare.
    However, I do want to use Wabbits suggestion but I dont know
    how to create a web object.
    The GetURL function opens the swf on its own, which I dont
    want to do. I want it to open the AS3 SWF in a small window within
    the page.
    Can someone help please? Thanks in advance,

  • Calling a Function in the Parent Window from the Child Window

    QUESTION: How do I call a function resident in the parent
    window from a child window?
    BACKGROUND
    I have a JavaScript function resident in the parent window
    that reformats information obtained from the Date object and writes
    the result to the parent window using the document.write( ) method.
    I would like to call this function from the child window and have
    it write to the child window instead. Is this possible? If not,
    must I rewrite the entire function and nest it in the below code?
    If so, what is the proper form of nesting?
    CODE: The code that creates and fills the child window is
    provided below. The highlighted area indicates where I would like
    to enter the information from the function resident in the parent
    window. I have tried every imaginable permutation of code that I
    can imagine and nearly destroyed my parent document in the process.
    I am very happy that I had a back-up copy!
    function openCitationWindow() {
    ciDow = window.open("", "", "width=450, height=175, top=300,
    left=300");
    ciDow.document.write("A proper way to cite a passage of text
    on this page:<br /><br />Stegemann, R. A. 2000.
    <cite>Imagine: Bridging a Historical Gap</cite>. " +
    document.title + ". [<a href='" + location.href + "'
    target='_blank'>online book</a>] &lt;" + location.href
    + "&gt; (");
    MISSING CODE;
    ciDow.document.write(").<br /><br /><input
    type='button' value='Close Window' onclick='window.close()'>");
    ciDow.focus();

    Never mind - I was doing something very stupid and wasn't
    calling the function as a method of a movie clip. I was simply
    calling checkTarget(event) rather than
    event.currentTarget.checkTarget(event); which seems to work.

  • ModuleViewLoader - does it load modules into child application domains by default ?

    Is the Cairngorm 3, "ModuleViewLoader" loading modules into child application domains by default, or we have to do it our self like this:
    public function init():void{
         var childDomain:ApplicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
      modelLoader.applicationDomain = childDomain;
    <module:ModuleViewLoader id="moduleLoader"
                      moduleId="{ moduleId }"
                      moduleManager="{ moduleManager }"
                      skinClass="com.adobe.cairngorm.module.ModuleViewLoaderSkin"
                      visible="{this.visible}"
                      width="100%" height="100%">
         <module:loadPolicy>
              <module:BasicLoadPolicy/>
         </module:loadPolicy>
    </module:ModuleViewLoader>
    I think it's important to know regarding unloading the modules.
    Thanks,

    Hi Adrian,
    We are following the behaviour of the Flex ModuleManager:
    We use the applicationDomain provided by the user when available
    Otherwise we create a sub applicationDomain from the current domain.
    Here is an extract of the ParsleyModuleInfoProxy
    private function createDefaultApplicationDomain(applicationDomain:ApplicationDomain):ApplicationDomain
                // If an applicationDomain has not been specified and we have a module factory,
                // then create a child application domain from the application domain
                // this module factory is in.
                // This is a change in behavior so only do it for Flex 4 and newer
                // applications.
                var tempApplicationDomain:ApplicationDomain = applicationDomain;
                if (tempApplicationDomain == null && moduleFactory)
                    var currentDomain:ApplicationDomain = moduleFactory.info()["currentDomain"];
                    tempApplicationDomain = new ApplicationDomain(currentDomain);
                return tempApplicationDomain;
    We will update the documentation to highlight the fact that a sub ApplicationDomain is created by default.
    Thanks.

  • Get Parent container to change child height on resize Event

    Ok,
    I've created a composite component called ResizableTextArea.
    The parent is an extended class of Canvas called ResizableCanvas.
    The child is an extended class of TextArea called myTextArea.
    In myTextArea, there's an update function that makes the
    textarea change it's height based on explicit height (how many
    lines it actually has). when you add text, the height expands for
    the new text. When you delete, the textarea's height shrinks to
    contain the text. Beautiful.
    Now, the parent, ResizeableCanvas, has a button that let's me
    drag the width. The child's width is set to 100% of parent so it
    resizes along with it. However, no matter what I try, when I resize
    the parent canvas, the child textarea will not update its height.
    I've tried everything I know and some, but nothing triggers
    the change. Please assist!

    Sure, just focus on the last class, ResizableTextArea. Canvas
    on the outside, Textarea on the inside.

Maybe you are looking for

  • Migration from sqlserver 2005 to Oracle 10.1.0.3

    I'm new to the migration workbench. But I was successful in converting our sqlserver 2005 db to Oracle 10.1.0.3 using the Offline capture method. This isn't a terribly complex db - 100 tables, many are empty. The trouble started when I tried to conve

  • Can't Burn. error 4280

    Everytime i try to burn a Cd, i get an "unknown error" number 4280. it doesn't matter if i burn mp3 or an audio cd. i've changed media brands and still the same problem. itunes recognizes my drive and i have no idea what the problem could be.

  • BT Infinity in our area but cabinet not supported

    Everybody on the streets around us can get bt infinity, yet before when we checked for bt infinity we got the following message: This postcode has some Exchange Only lines This means there is currently no cabinet to run FTTC from. Openreach may deplo

  • Older version of Youveiw box delivered

    Hi. I have been on the phone since 1300 as my new Youviewbox was delivered today, but having been promised by BT and sent documents about their latest BT Youview box, what arrived was an older version. This is grey type not black version. Also it is

  • How to create plant wise STO from multiple requisition through Me59N

    How to create plant wise STO from multiple requisition through Me59N