Why movieclips, buttons & images on the stage literally disappeared when run.

I'm really noob in AS3.

I had the design of clips and other places on the stage.

And I got 1 framework for the code below.

Some clips will be visible and not visible, sometimes while loading external swf files.

I think that its on the clips to be dynamically on the stage.

Error output:

TypeError: Error #1009: cannot access a property or method of a null object reference.

at main4_fla::MainTimeline/advantanMCs() [main4_fla. MainTimeline::frame2:141]

to Function / main4_fla:MainTimeline/launchSWF/main4_fla:onLoadCompleteHandler() [main4_fla. [May nTimeline::frame2:46]

Here is my code:

import flash.display.MovieClip;

import flash.display.Loader;

import flash.net.URLRequest;

to import flash.events.ProgressEvent;

import flash.events.IOErrorEvent;

import flash.events.Event;

var swfList: Array = new Array ('1.swf', '2.swf', '3.swf', '4.swf');

var container: MovieClip = new MovieClip();

var currentSWF: MovieClip = new MovieClip();

var swfNo: number = 0;

function launchSWF

function launchSWF (swfBox, swfFile) {}

swfLoader var: Loader = new Loader();

var swfURL: URLRequest = new URLRequest (swfFile);

swfLoader.contentLoaderInfo.addEventListener (ProgressEvent.PROGRESS, onProgressHandler);

swfLoader.contentLoaderInfo.addEventListener (Event.COMPLETE, onLoadCompleteHandler);

swfLoader.contentLoaderInfo.addEventListener (IOErrorEvent.IO_ERROR, onIOErrorHandler);

swfLoader.load (swfURL);

function onIOErrorHandler(event:_IOErrorEvent):void {}

trace ("file not found!" swfFile + event);

}

function onLoadCompleteHandler(event:_Event):void {}

trace (swfFile + "loaded file.");

swfBox.removeChild (preLoader);

swfBox.addChild (swfLoader);

{If (swfFile == {swfList [0]})}

swf1MCs();

currentSWF.x = 247.45.

currentSWF.y = 251.45;

{} ElseIf (swfFile == {swfList [1]})}

swf2MCs();

currentSWF.x = 62;

currentSWF.y = 199.50;

{} ElseIf (swfFile == {swfList [2]})}

swf3MCs();

currentSWF.x = 132.50;

currentSWF.y = 225,50;

{} ElseIf (swfFile == {swfList [3]})}

swf4MCs();

currentSWF.x = 62;

currentSWF.y = 226.50;

}

currentSWF = MovieClip (swfLoader.content);

currentSWF.gotoAndPlay (1);

currentSWF.addEventListener (Event.ENTER_FRAME, checkLastFrameHandler);

function checkLastFrameHandler(event:_Event):void {}

trace (swfFile + "is the image of '+ currentSWF.currentFrame +'.'");

if(currentSWF.currentFrame == currentSWF.totalFrames) {}

currentSWF.stop ();

removeSWF();

}

}

function removeSWF(): void {}

swfBox.removeChild (swfLoader);

currentSWF.removeEventListener (Event.ENTER_FRAME, checkLastFrameHandler);

trace (swfFile + "deleted.");

launchNextSWF();

}

}

var preLoader: loader = new loader();

{If (swfFile == {swfList [0]})}

preLoader.x = mc1Frame.x / 2;

preLoader.y = mc1Frame.y / 2;

{} ElseIf (swfFile == {swfList [1]})}

preLoader.x = mc2Frame.x / 2;

preLoader.y = mc2Frame.y / 2;

{} ElseIf (swfFile == {swfList [2]})}

preLoader.x = mc3Frame.x / 2;

preLoader.y = mc3Frame.y / 2;

{} ElseIf (swfFile == {swfList [3]})}

preLoader.x = mc4Frame.x / 2;

preLoader.y = mc4Frame.y / 2;

}

swfBox.addChild (preLoader);

function onProgressHandler(event:_ProgressEvent):void {}

var dataAmountLoaded: number = event.bytesLoaded / event.bytesTotal * 100;

preLoader.bar.scaleX = dataAmountLoaded / 100;

preLoader.percent.text = int (dataAmountLoaded) + "%";

trace ("preLoader:" + preLoader.percent.text);

}

} / / end of launchSWF

function launchNextSWF() {}

trace ("launch of the next");

If (swfNo < (swfList.length - 1)) {}

swfNo ++;

trace ("Now Playing" + swfNo + "swf");

launchSWF (container, swfList [swfNo]);

} else {}

trace ("at the end");

}

} / / end of launchNextSWF

put on stage

addChild (container);

launchSWF (container, swfList [swfNo]);

mc swf1 behavior

function swf1MCs() {}

mc1Frame.visible = false;

mc2Frame.visible = false;

mc3Frame.visible = false;

mc4Frame.Visible = true;

headerBg.gotoAndStop("1");

mc1MC.gotoAndStop("1");

mc2MC.gotoAndStop ("default");

mc3MC.gotoAndStop ("default");

mc4MC.gotoAndStop ("default");

}

SWF2 mc behavior

function swf2MCs() {}

mc1Frame.visible = false;

mc2Frame.visible = false;

mc3Frame.visible = false;

mc4Frame.Visible = true;

headerBg.gotoAndStop("2");

mc1MC.gotoAndStop("2");

mc2MC.gotoAndStop ("default");

mc3MC.gotoAndStop ("default");

mc4MC.gotoAndStop ("default");

}

swf3 mc behavior

function swf3MCs() {}

mc1Frame.visible = false;

mc2Frame.visible = false;

mc3Frame.visible = false;

mc4Frame.Visible = true;

headerBg.gotoAndStop("3");

mc1MC.gotoAndStop("3");

mc2MC.gotoAndStop ("default");

mc3MC.gotoAndStop ("default");

mc4MC.gotoAndStop ("default");

}

SWF4 mc bahavior

function swf4MCs() {}

mc1Frame.visible = false;

mc2Frame.visible = false;

mc3Frame.visible = false;

mc4Frame.Visible = true;

headerBg.gotoAndStop("4");

mc1MC.gotoAndStop("4");

mc2MC.gotoAndStop ("default");

mc3MC.gotoAndStop ("default");

mc4MC.gotoAndStop ("default");

}

I kinda stuck with the code. Much of the code I got from a blog I think useful for what I'm working on.

One thing that bothers me, is that I movieclips, buttons and images on the stage literally.

When I decide to enter the movieclips disappeared.

Any help is appreciated.

The first line in an error message reference is the closest to the problem.  All the others are right along the processing chain, so line 141 is where you need to focus.

If you get the error 1009 for this line, it is indicating that the mc1Frame object does not exist for which is that the code is... you don't see this object as being present.

This may mean that the object...

-is declared but not instantiated

n ' is not have an instance name (or the name of the instance is misspelled)

n ' is not in the frame where this code tries to talk to her

-is animated in place, but is not assigned the name of the instances of each keyframe for her

-is one of the two or more consecutive keyframes of the same objects without a name assigned in the image previous (s).

Tags: Adobe Animate

Similar Questions

  • How to remove a listener added to an image on the stage of a symbol?

    Hello I need to remove an ENETR. Listener of the frame to an image on the stage of a symbol.

    use:

    MovieClip (root) .removeEventListener (Event.ENTER_FRAME, MovieClip (root) .loop);

  • Anyone know why I can't buy the Portugal LR6? When I select the desktop application of most place hiden in the site Web of the page turns out to be empty! Other areas which is not the case, but since I am connected to the Portugal I'm not able to purchase

    Anyone know why I can't buy the Portugal LR6? When I select the desktop application of most place hiden in the site Web of the page turns out to be empty! In other regions that is not the case but since I am connected to the Portugal, I'm not able to buy elsewhere.

    Please check the availability of https://www.adobe.com/content/dam/Adobe/en/products/creativecloud/cc/pdfs/cc-availability-matrix.pdf

    Concerning

    Stéphane

  • Select the first value in the list of values when running in poplist

    Hello
    IM using forms 6i. I filled the poplist by request. But what I need, I want to choose the first value in the list of values when running...

    That is to say, during execution, the poplist should have chosen its first value in the list of values.

    What to do...

    Concerning
    Sery

    WHEN CREATING a RECORD of the block of the list item or after the filling of the list item, you can write

    : my_list_item: = GET_GROUP_CHAR_CELL ('my_list_item', 1); / * If the data type of the item in your list is character.*.

    Here, instead of 1, you can give any clue... 1: value to the first list item position

  • How to remove a loaded image on the stage of a symbol containing a button?

    1st configuration:

    1. General map is loaded

    Texas1.png

    2. on a click event, a larger image of the region is loaded with the following code (thanks Joel demo). Mouse is displayed the name of the County and then the click on a popup (symbol) shows some info.

    $(' < img id = "Région1" width = "310" height = "475" src="images/region1.png" usemap = "#region1" > '+' < nom de la carte = "Région1" > "+...)

    ' < area id = "Dallam" shape = "rect" title = "Dallam" coords = "29,17,97,58" / > "+...

    texas2.pngtexas3.png

    3. in the symbol of the pop-up window, I want to expand the plan to be delete on the click event of the button: 'display another region '. I have the following code that does not work (the image is not deleted) resulting in what you see below:

    sym.playReverse ();

    sym.getComposition () .getStage () .stop (0);

    sym.getComposition () .getStage ().getElementById("region1").remove ();

    texas4.png

    So my question is how can I delete the image (image large region in purple here loaded as described in 2.)?

    I got it. It should be:

    $("#region1").remove ();

    # was missing.

    In fact, I added that to the time 0 on the main timeline, so when I got there he deletes the image.

    It doesn't have the side still, but I guess I should get finally it works from there, instead.

    Thanks for your time.

  • Display a series of images on the stage based on the value of a variable

    Hi all

    Here's another interesting problem! Well, I have an interactive retention test which is charge of an xml file based on the value of a variable scenario (for example, if script = Architecture, then load Q_set 1, if scenario = history then load something else). Now, I would like to extent this and display a series of images on my stage which will be valid only in the current scenario. Here is my code so far. I thought load a list of images on the beginning of the film (for example, Architecture_list, History_list) and then call them according to the value of the variable of scenario, but I would like to hear what you have to say. Any ideas?

    The answer is a series of managers: one called at the beginning of the movie to fill the lists of the appropriate folders (based on the value of the variable gimage) and the other called next and previous. Here they are in case yu need:

    ---------
    Global gFileList, gImagePath, gimages

    on buildList

    gFileList =]

    -defining the path to images:

    gImagePath = "@images /" & gimages & ' / ' "»

    Repeat with i = 1 to the maxinteger
    thisFile = getNthFileNameInFolder (gImagePath, i)
    If thisFile = EMPTY then exit
    If thisFile = the movie then the next repetition
    types of files = [".pct", ".jpg", ".bmp", ".gif"]
    howManyTypes = count (fileTypes)
    Repeat with thisType = 1 to howManyTypes
    extension = getAt (file types, if thisType)
    If thisFile contains extension then
    gFileList.append (thisFile)
    end if
    end repeat
    end repeat

    Member ("Display"). FileName = gImagePath & gFileList [1] - put the first image in the folder at the appropriate place

    Member ("Display"). Picture = .photo member ("display")

    buildList end

    --------------------
    Global gFileList, gFileIndex, gImagePath

    on nextFile

    gFileIndex = gFileIndex + 1

    If gFileIndex > count (gFileList) then

    whichFile = gFileList [1] - set the image = in the last loaded picture holder
    gFileIndex = 1 - the value of the index to the last trick question

    Member ("Display"). FileName = gImagePath & whichFile
    Member ("Display"). Picture = .photo member ("display")
    updateStage

    -go to the audio issues

    _movie. GB (31)

    on the other

    whichFile = gFileList.getAt (gFileIndex)

    Member ("Display"). FileName = gImagePath & whichFile

    Member ("Display"). Picture = .photo member ("display")

    updateStage
    end if

    end

    Global gFileList, gFileIndex, gImagePath
    -----------------------------------------------------------
    the backfile

    gFileIndex = gFileIndex - 1

    If gFileIndex = 1 then

    whichFile = gFileList [1]
    Member ("Display"). FileName = gImagePath & whichFile
    Member ("Display"). Picture = .photo member ("display")
    updateStage
    Sprite (17) TRUE = FALSE - disable the "back" button

    -gFileIndex = count (gFileList)
    end if

    If gFileIndex > 1 then

    whichFile = gFileList.getAt (gFileIndex)

    Member ("Display"). FileName = gImagePath & whichFile
    Member ("Display"). Picture = .photo member ("display")
    updateStage
    end if
    end

  • How to add background images to the stage?

    I use the last version (2014.1.1)

    I want to add a photo to be a background image in the stadium.

    So I do:

    1. Add 'compositionReady' to the stage

    (2 key - in: sym.$("Stage").css("background-image","url(images/bg.png)"); "

    but I can't see the picture and to develop tools, the tag had background-image.

    How to solve the problem?

    You are missing quotes in your code.

    SYM.$("stage"). CSS({"background-image":"URL('images/BG.png')"});)

    or

    SYM.$("stage"). CSS ("background-image", "URL('images/BG.png')");

  • create a button to resize the stage?

    Hi all

    So I put buttons menu (created on the edge) for a Web site.  But each page, obviously, has a different amount of content, so I'm curious to know if it is possible to use the buttons of menu also adjust the height of the stage (in order to accommodate the largest graphics and eliminate the need for a scrolling region in the page).  It would be something in the sense of "sym.getComposition"? () .getStage () .resizeY (numberofpixels)  I tried

    "sym. $(internship).css({"height":"900px"});)" but that has not worked. Any thoughts?

    Thank you

    I'm not sure it would work, but in the meantime, you must wear the quotes around stage.

    "sym.$("Stage").css ({"height":"900px"});}).

  • Why fonts look better on the stage?

    I have a paragraph of the text on the stage that seems good (Helvetica Neue ultralight), but when I play the movie it looks much thinner and really bad. Why the text on the stage doesn't match the film?

    If it's static text and you are using a dynamic textfield, try to change to a static textfield.  In addition, you can try different settings of anti-aliasing for textfield (via the properties panel).  If you do something to filter the text, as the application of a drop shadow, it may also concern the appearance.  If all else fails, try another font.

  • Why are JPEG images on the hard drive of my computer all of a sudden now Virgin?

    JPEG images on the hard drive of my computer are now white (it reads 0kb and the tile is missing) and when I go to open it in Windows Photo Viewer, it gives me an error saying that there is not. I noticed that it happens to almost all of the photos that I have edited in Lightroom 5. I shot an entire season of football last year, all in JPEG format and with my guards, I advanced and edited in Lightroom and now they are virgins. I never moved my photos anywhere. I turned the game in November, created the folder for this game, and that's all. I'm almost a year more later to print them for my portfolio and the file is missing! Lightroom can show the photo, but I can't make adjustments in the develop module because the file is blank on my computer. The weird part is that the sticker is there, the number of correct image is there, and when I click to display in the Explorer in Lightroom, it pulls up the JPEG right, if the location is OK in Lightroom, just no thumbnail image and no image size when I go to open it using the Windows Photo Viewer. I checked the other games that I shot and it's happened to almost all games.

    If you have pictures on your camera cards, then of course you can simply copy them to the appropriate locations.

    There are plug-ins in Lightroom that can recover the preview using Lightroom, but these will be smaller and lower in quality than the original. Perhaps one of our plug-ins experts can suggest the good plug-in.

    If the hard drive goes really wrong, as I suggested, you definitely want to be replaced. If this is the case, you won't continue to use it. You might want to run some diagnostic disk on this subject.

  • Why does my toolbar on the bottom suddenly disappear all the time?

    The inferior plate which has all my other applications stay in place. My browser is not set to mode full screen. They tend to stay on the bottom.

    Sometimes Firefox is confused about the dimensions of the screen and the bottom of its window go behind or in front of the Windows taskbar. The typical 'quick fix' for this is to delete the settings file that lists the wrong size. You have activated the memory of this as clear Firefox toolbars. Here's how:

    Open the settings folder (AKA Firefox profile) current Firefox help

    • button "3-bar" menu > "?" button > troubleshooting information
    • (menu bar) Help > troubleshooting information
    • type or paste everything: in the address bar and press Enter

    In the first table of the page, click on the view file"" button. This should launch a new window that lists the various files and folders in Windows Explorer.

    Leave this window open, switch back to Firefox and output, either:

    • "3-bar" menu button > button "power".
    • (menu bar) File > Exit

    Pause while Firefox finishing its cleanup, then rename xulstore.json to something like xulstore.old. If you see a file named localstore.rdf, rename this to localstore.old.

    Launch Firefox back up again. Windows normally appear again?

    To activate the different bars on and outside, you can use one of the following methods to view the list of the toolbar, then select the desired bars it:

    To activate the menu bar, toolbar bookmarks or other bars, click it in the list.

  • My button send and the toolbar have disappeared from the left side of the screen

    The button send and the toolbar usually located on the left side of the screen disappeared.

    It is the part of the records.

    In the menu bar select view-presentation-folder pane

    Make sure it is checked.
    If it is checked, and it always shows he was not pushed on the left side of the screen. Move your mouse on the left margin of the screen and look for that to change in a double headed arrow. When he, left click, hold down and drag to the right to find the folders pane.

  • SWF freezes on the first image in the browser, plays OK when opened in Flash. Number, nothing changed

    I installed a test site: [removed by the moderator at the request of the OP]

    If you click 'Show the gesture of task' a short clip should play. However, it freezes on the first image.

    If you download and run it locally in Flash, it works as expected.

    It worked for a few weeks (until I think that the last update of flash player...) nothing has changed on our end. Any help would be appreciated. Thank you

    Post edited by: Peter Spier

    Looks like a known issue with Flash Player: https://bugbase.adobe.com/index.cfm?event=bug&id=3160365

    Thanks for the help.

    EDIT: Can a moderator please remove the reference to the test file in the original post? Thank you

  • The div background image in the process of disappearance in the product page of model

    Hello

    I created a Web page using css and DIV tags  I created an editable region that has a background in her image.  Within this editable area there are a couple of ther tags div too.  When I look at the page as a template, it looks fine, but when I produce a new page of this model, the background image disappears?


    Can anyone help with this?

    Thanks in advance.

    Andy

    What file name is the background image? The path is correct?

  • I'm cutting an image with the pen tool and when I make a selection it selects the entire image and not cutting. How can I stop this?

    The selection inverse basically when I don't want to do that! Any help would be great, it becomes very annoying.

    Thank you

    You will need to have the selected operation before you begin to chart your way?

    You can always for this instance to save time you Ctrl + Alt + I, and then return?

Maybe you are looking for

  • Major problems of its Tecra 9100

    I hope someone can help me with this, it makes me crazy. I can't get the sound to work on my Tecra 9100. The system does not recognize that there is a map of his present. When I try to install the drivers downloaded from the Toshiba site, installatio

  • TouchSmart Envy 17-j153cl: how to replace HDD on Touchsmart Envy 17-j153cl

    Hello! So, I am trying to replace the magnetic hard disk of my envy 17 1 to with a form factor of the Samsung 850 Evo Sata 500 GB SSD. I followed the guide maintenance and replacement to http://h10032.www1.hp.com/ctg/Manual/c04091762 , but when it ca

  • TestStand does not display a return of the C++ module string

    I have a c++ module that returns a string value.  TestStand doesn't seem to be able to see the strings as return value.  Is it possible for c ++ return a string to teststand?  I have other methods that return values of return bool and float and TestS

  • Point by Point to the incorrect values

    I use a loop that retrieves data every 10 seconds or more (ends up being a little more, but is not question.) and whenever it gets data (temperature), it passes through the gap of Point by Point VI in order to produce a cumulative gap and the average

  • I get "error number 0 x 80040706 Description: object reference not set" while trying to install Empire Earth 2

    Original title: error number 0 x 80040706 Description: object reference not set I can't install Empire Earth 2 on my PC because of this error. It is not the disc and I have no drivers up to date. I've tried every suggestion I could find but nothing w