Error parsing SWF - Error #1010

I'm trying to load an swf compiled with ASC2 and SWF Investigator can't open it.
My main purpose is test the new features (like inlining).
Is there anything that I can do?

After digging the source code for a while I found out that the problem lies in the Abc.parseCpool() method, while parsing the multinames (after line 306 in Abc.as).
I've made a simple class that shows the problem:
package 
    import flash.display.Sprite;
    public class TestClass extends Sprite
        private var testVectorProperty:Vector.<int>;
SWFs generated by ASC2 produce bytes in a different order than the ASC1 does.
This is the data I get from the Abc.names property with my debugger:
As you can see, the order in the SWF generated by ASC1 are (from names[3] to names[6]):
(QName)      private::testVectorProperty
(QName)      __AS3__.vec::Vector
(QName)      ::int
(TypeName) __AS3__.vec::Vector, [int]
But the order of the bytes in the SWF generated by ASC2 is somewhat the reverse (from names[1] to names[4]):
(QName)      private::testVectorProperty
(TypeName) undefined, [undefined]
(QName)      __AS3__.vec::Vector
(QName)      ::int
The result, as you can see, is that the TypeName (names[2]) doesn't know what names[3] and names[4] means, so it is undefined.
I don't know if this post is of any help but I did my best to chase the source of the bug, and I can't solve the problem myself, as I don't have the knowhow to do it.
But, if any brave soul can fix this, I'll give you my eternal gratitude. ^_^

Similar Messages

  • TypeError: Error #1010

    Hi, I am building a website for class and I got this error and can't figure out what is wrong in the coding:
    characters.swf
    TypeError: Error #1010: A term is undefined and has no properties.
              at TeamFortress2_mainpage_fla::lower_nav_7/buttonClick()[TeamFortress2_mainpage_fla.lower_na v_7::frame1:11]
    This is my coding:
    function buttonClick(event:MouseEvent):void
              gotoAndStop(event.target.name);
              characters.enabled = true;
              about.enabled = true;
              video.enabled = true;
              item.enabled = true;
              contact.enabled = true;
              event.target.enabled = false;
              trace(event.target.name + ".swf");
              (root as MovieClip).myLoader.load(new URLRequest(event.target.name + ".swf"));
    characters.addEventListener(MouseEvent.CLICK, buttonClick);
    about.addEventListener(MouseEvent.CLICK, buttonClick);
    video.addEventListener(MouseEvent.CLICK, buttonClick);
    item.addEventListener(MouseEvent.CLICK, buttonClick);
    contact.addEventListener(MouseEvent.CLICK, buttonClick);

    myLoader is defined?
    MovieClip(root).myLoader.load(new URLRequest(event.target.name + ".swf"));
    or try usin parent to find it
    MovieClip(parent.parent.parent).myLoader.load(new URLRequest(event.target.name + ".swf"));

  • Error #1010 on drag n drop game. Please Help

    Hello everyone,
    I am having been building a drag n drop flash game where you need to drag pictures of organisms into their position on a food web. The code was working when it was a simple food chain with each animals only have one position on the chain. I have no decided to make it a more complex and have things such as plants, having a couple of different positions in the chain. I have decided to try this using an array for each of the sets of pictures. At the moment the pictures can be picked up and moved around the screen, but not placed on any of the targets that I have put on the screen. My other problem is that the following error keeps coming up whenever I go to the frame.
    TypeError: Error #1010: A term is undefined and has no properties.
    at foodweb_fla::MainTimeline/activateDraggables()
    at foodweb_fla::MainTimeline/frame6()
    I have been trying for a couple of days now to work out whats going on withoutmuch luck due to my very average flash skills. The coding that I have done so far is below:
    [CODE]
    stop();
    var startX2:Number;
    var startY2:Number;
    var counter2:Number=0;
    score_txt.text=score;
    var dropTargetss = new Array();
    dropTargetss[0]=targetsun2_mc1;
    dropTargetss[1]=targetsun2_mc2;
    dropTargetss[2]=targetsun2_mc3;
    dropTargetss[3]=targetsun2_mc4;
    var dropTargetsp = new Array();
    dropTargetsp[0]=targetplant2_mc1;
    dropTargetsp[1]=targetplant2_mc2;
    dropTargetsp[2]=targetplant2_mc3;
    var dropTargetsi = new Array();
    dropTargetsi[0]=targetinsect2_mc1;
    dropTargetsi[1]=targetinsect2_mc2;
    var draggableObjectss = new Array();
    draggableObjectss[0]=sun2_mc1;
    draggableObjectss[1]=sun2_mc2;
    draggableObjectss[2]=sun2_mc3;
    draggableObjectss[3]=sun2_mc4;
    var draggableObjectsp = new Array();
    draggableObjectsp[0]=plant2_mc1;
    draggableObjectsp[1]=plant2_mc2;
    draggableObjectsp[2]=plant2_mc3;
    var draggableObjectsi = new Array();
    draggableObjectsi[0]=insect2_mc1;
    draggableObjectsi[1]=insect2_mc2;
    Next3_b.addEventListener(MouseEvent.CLICK, onGuessClick3);
    SA3_b.addEventListener(MouseEvent.CLICK, onSAClick3);
    bird2_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp5);
    snake2_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt5);
    bird2_mc.buttonMode=true;
    snake2_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp5);
    bird2_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt5);
    snake2_mc.buttonMode=true;
    //BUTTON FUNCTIONS
    function onGuessClick3(event:MouseEvent) {
    //if(counter2 == 11){
    gotoAndPlay(7);
    //} else {
    //reply2_txt.text = "You need to complete this food chain before moving forward!";
    function onSAClick3(event:MouseEvent) {
    gotoAndStop(1);
    //PICKUP AND DROP FUNCTIONS
    function activateDraggables():void {
    for (var i:int = 0; i < draggableObjectss.length; i++) {
      draggableObjectss[i].buttonMode=true;
      draggableObjectss[i].addEventListener(MouseEvent.MOUSE_DOWN, pickUp2);
    for (var j:int = 0; j < draggableObjectsp.length; j++) {
      draggableObjectsp[j].buttonMode=true;
      draggableObjectsp[j].addEventListener(MouseEvent.MOUSE_DOWN, pickUp3);
    for (var k:int = 0; k < draggableObjectss.length; k++) {
      draggableObjectsi[k].buttonMode=true;
      draggableObjectsi[k].addEventListener(MouseEvent.MOUSE_DOWN, pickUp4);
    activateDraggables();
    function pickUp2(event:MouseEvent):void {
    // add listener to stage to prevent stickiness
    stage.addEventListener(MouseEvent.MOUSE_UP, dropIt2);
    event.target.startDrag();
    reply2_txt.text="Now put the tile in the correct position of the food chain.";
    startX=event.target.x;
    startY=event.target.y;
    function dropIt2(event:MouseEvent):void {
    event.target.stopDrag();
    stage.removeEventListener(MouseEvent.MOUSE_UP, dropIt2);
    if (event.target.dropTarget&&dropTargetss.indexOf(event.target.dropTarget)>-1) {
      reply2_txt.text="Good Job";
      event.target.x=event.target.dropTarget.x;
      event.target.removeEventListener(MouseEvent.MOUSE_DOWN, pickUp2);
      event.target.buttonMode=false;
    } else {
      reply2_txt.text="Try Again!";
      event.target.x=startX;
      event.target.y=startY;
    function pickUp3(event:MouseEvent):void {
    // add listener to stage to prevent stickiness
    stage.addEventListener(MouseEvent.MOUSE_UP, dropIt3);
    event.target.startDrag();
    reply2_txt.text="Now put the tile in the correct position of the food chain.";
    startX=event.target.x;
    startY=event.target.y;
    function dropIt3(event:MouseEvent):void {
    event.target.stopDrag();
    stage.removeEventListener(MouseEvent.MOUSE_UP, dropIt3);
    if (event.target.dropTarget&&dropTargetsp.indexOf(event.target.dropTarget)>-1) {
      reply2_txt.text="Good Job";
      event.target.x=event.target.dropTarget.x;
      event.target.removeEventListener(MouseEvent.MOUSE_DOWN, pickUp2);
      event.target.buttonMode=false;
    } else {
      reply2_txt.text="Try Again!";
      event.target.x=startX;
      event.target.y=startY;
    function pickUp4(event:MouseEvent):void {
    // add listener to stage to prevent stickiness
    stage.addEventListener(MouseEvent.MOUSE_UP, dropIt4);
    event.target.startDrag();
    reply2_txt.text="Now put the tile in the correct position of the food chain.";
    startX=event.target.x;
    startY=event.target.y;
    function dropIt4(event:MouseEvent):void {
    event.target.stopDrag();
    stage.removeEventListener(MouseEvent.MOUSE_UP, dropIt4);
    if (event.target.dropTarget&&dropTargetsi.indexOf(event.target.dropTarget)>-1) {
      reply2_txt.text="Good Job";
      event.target.x=event.target.dropTarget.x;
      event.target.removeEventListener(MouseEvent.MOUSE_DOWN, pickUp2);
      event.target.buttonMode=false;
    } else {
      reply2_txt.text="Try Again!";
      event.target.x=startX;
      event.target.y=startY;
    function pickUp5(event:MouseEvent):void {
    event.target.startDrag(true);
    reply2_txt.text="Now put the tile in the correct position of the food chain.";
    event.target.parent.addChild(event.target);
    startX=event.target.x;
    startY=event.target.y;
    function dropIt5(event:MouseEvent):void {
    event.target.stopDrag();
    var myTargetName:String="target"+event.target.name;
    var myTarget:DisplayObject=getChildByName(myTargetName);
    if (event.target.dropTarget!=null&&event.target.dropTarget.parent==myTarget) {
      reply2_txt.text="Good Work!";
      event.target.removeEventListener(MouseEvent.MOUSE_DOWN, pickUp5);
      event.target.removeEventListener(MouseEvent.MOUSE_UP, dropIt5);
      event.target.buttonMode=false;
      event.target.x=myTarget.x;
      event.target.y=myTarget.y;
      counter2++;
    } else {
      reply2_txt.text="That tile doesn't go there!";
      event.target.x=startX2;
      event.target.y=startY2;
    if (counter2==11) {
      reply2_txt.text="Congratulations you have completed the forest ecosystem!";
      score++;
      score++;
      score++;
      score++;
      score++;
      score++;
      score_txt.text=score;
    [/CODE]
    Any help will be much appreciated. Thankyou in advance

    click file/publish settings/flash and tick "permit debugging".  retest and using the line number in the error message fix your problem or post the line with the error.

  • Error #1010 While trying to link a button to a PDF

    Hi all, I am completely new to AS3 and Flash in general, but because of a project here at work I decided to venture in creating a site. I imported a Photoshop file into the stage and created buttons from some headings. I need to link the headings to PDF files when they are clicked, but when I wrote the code (actually in various different formats) I keep getting the following error (while permitting to debug):
    TypeError: Error #1010: A term is undefined and has no properties.
        at extras3_fla::MainTimeline/frame1()[extras3_fla.MainTimeline::frame1:9]
    My simple code is
    var pdfURL:URLRequest = new URLRequest("images\Other\LetterHansen.pdf");
    //PDF Link
    function pdfLink(event:MouseEvent):void {
        navigateToURL(pdfURL,"_blank");
    Text.daniels_btn.addEventListener(MouseEvent.CLICK, pdfLink);
    Any suggestions? I'm sure it's something simply, but I figured I'd ask for help instead of banging my head against the wall
    Thanks!

    Whichever line is line 9 of your code has a problem.  If it is the last line, chances are you have not named your daniels_btn inside the Text object, or it is not named in the first frame within Text.

  • AreaSeries on chart -- Error 1010 triggered

    After reassigning the dataProvider array of my area chart, I
    get the following error:
    TypeError: Error #1010: A term is undefined and has no
    properties.
    at mx.charts.chartClasses::GraphicsUtilities$/drawPolyLine()
    at
    mx.charts.renderers::AreaRenderer/mx.charts.renderers:AreaRenderer::updateDisplayList()
    at mx.skins::ProgrammaticSkin/validateDisplayList()
    at mx.managers::LayoutManager/::validateDisplayList()
    at mx.managers::LayoutManager/::doPhasedInstantiation()
    at mx.managers::LayoutManager/validateNow()
    at mx.controls::ComboBox/::displayDropdown()
    at
    mx.controls::ComboBox/mx.controls:ComboBox::downArrowButton_buttonDownHandler()
    at
    flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.core::UIComponent/dispatchEvent()
    at mx.controls::Button/
    http://www.adobe.com/2006/flex/mx/internal::buttonPressed()
    at mx.controls::Button/mx.controls:Button::mouseDownHandler()
    at
    flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.core::UIComponent/dispatchEvent()
    at mx.controls::ComboBase/::textInput_mouseEventHandler()
    The strange thing is that the new array has 6 items! I check
    its length (length greater than 2) before I assign it. However,
    when the debugger breaks in drawPolyLine, the "pts" matrix has only
    1 item. I don't know how the array goes from having 6 items to only
    1. The stacktrace does not trace back to my code, so I am having
    trouble debugging this.
    I thought that setting the series' filterData property to
    true would prevent this from occurring, but it didn't work.
    Any ideas on how I can figure this out?
    Thank you,
    -C

    relaxatraja:
    Using permit debugging definitely helped me nail down the issue. No more 1010's.  This is a great feature.
    A couple more questions if I may - the site still experiences slow response when clicking from one song to another.  Presently I have the .mp3 files for all of the seven CDs in one folder.
    Will I increase response time between song choices if I create individual folders for each CD rather than one large folder?
    Will I increase response time by reducing .mp3 file sound quality, therefore increasing loading speed - (this one seemsan  obvious yes - and sound quality is already reasonably small)?
    Is it possibly due to the first song choice (which has fast responee time) having to fully complete loading before a subsequent song choice can start to load - and if this is the case - can I script in a stop load function when a new choice is made ?
    mememellowcore

  • ORA-03137: TTC protocol internal error : [1010] [] [] [] [] [] [] [

    Hi
    Database 11.1.0.6
    OS: EL 5
    Hi I'm frequently getting this error in the database alert log:
    ORA-03137: TTC protocol internal error : [1010] [] [] [] [] [] [] [
    and the database got shutdown.
    Anybody has any idea how to troubleshoot?

    03137, 00000, "TTC protocol internal error : [%s] [%s] [%s] [%s] [%s] [%s] [%s] [%s]"
    // *Cause:  TTC protocol internal error.
    // *Action: Contact Oracle Support Services.                                                                                                                                                                                                                                                                                                                                                           

  • (HELP) - Loading multiple external images error #1010

    I'm a newbie at Flash and spent the whole day trying to fix this one problem and can't seem to fix it no matter what I do.
    I'm using Action Script 3.0, CS5 on Windows 7.
    I'm trying to load two external images (thumbnail images) in the loader "see image below for reference", where the full image size will be. However, I am getting this error when testing my movie. What am I doing wrong?
    Test Movie error message:
    "port1_btn
    TypeError: Error #1010: A term is undefined and has no properties.
        at index_fla::MainTimeline/fl_MouseClickHandler_6()"
    "port2_btn
    TypeError: Error #1010: A term is undefined and has no properties.
        at index_fla::MainTimeline/fl_MouseClickHandler_7()"
    FYI:
    Loader instance name: mainLoader
    Thumbnail #1 instance name: port1_btn
    Thumbnail #2 instance name: port2_btn
    This is my code

    Go into your Flash Publish Settings and select the option to Permit Debugging.  Then the error messages could include an indication of which lines are causing the problem.
    And just for the sake of asking since the code is somewhat minimal... is the mainLoader inside a container named portfolioBkgd?

  • Error 1010 when vertically scrolling dynamically populated datagrid

    http://www.mail-archive.com/[email protected]/msg49767.html
    Here's an example of what I'm running into (and the code is
    much neater). For some reason, as soon as I try to scroll
    vertically, I get:
    TypeError: Error #1010: A term is undefined and has no
    properties.
    at
    mx.controls.listClasses::ListBase/mx.controls.listClasses:ListBase::scrollVertically()
    at
    mx.controls::DataGrid/mx.controls:DataGrid::scrollVertically()
    at mx.controls.listClasses::ListBase/set
    verticalScrollPosition()
    at
    mx.controls::DataGrid/mx.controls:DataGrid::scrollHandler()
    at
    flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.core::UIComponent/dispatchEvent()
    at mx.controls.scrollClasses::ScrollBar/
    http://www.adobe.com/2006/flex/mx/internal::dispatchScrollEvent()
    at
    mx.controls.scrollClasses::ScrollThumb/::mouseMoveHandler()
    Does anyone know the fix to this?

    I have the same issue, I am adding columns dynmacially, the
    grid columns are updated with user actions (add and remove)
    Michael , I looked in Flex Coders and could find link for
    possible solution
    it seems from the posting that It would be solved if I call
    validateDisplayList on the grid after.
    can you point me to more information, ( and call this method
    after what),
    I appreciate response for this, this is crazy issue
    Thanks

  • Error #1010 on dynamic array of Labels?

    I am attempting to create an array of words as dynamically-created Labels that act like buttons (ie. they are plain text but are clickable and will highlight on mouseover).  This method works (using names like "word1", "word2"..."wordN" as the array index) for inserting the word labels into a BorderContainer... so the array seems to be okay. However, when I go to mouseover, I get TypeError: Error #1010: A term is undefined and has no properties.
    Pretty cryptic. What term is undefined and has no properties? I was assuming I could self-reference the event-triggering element using "this"... is that the problem? Not sure why the label can be added as a child element okay, but when I try to access one of the labels in the array, it gives "term undefined and has no properties"...
            private function mouseoverWord(event:Event):void {
                // Event handler for what happens when a mouse is moved over a word
                clickableArray[this.id].setStyle("color", "blue");
            private function mouseclickWord(event:Event):void {
            // Event handler for when word is clicked   
            private function createTextWord(word:String, num:int):void {
                var wordLabel:spark.components.Label = new spark.components.Label;
                wordLabel.text = word;
                wordLabel.buttonMode = true;
                wordLabel.addEventListener(MouseEvent.MOUSE_OVER, mouseoverWord);
                wordLabel.addEventListener(MouseEvent.CLICK, mouseclickWord);
                wordLabel.id = "word"+num.toString();
                clickableArray[wordLabel.id] = wordLabel;

    > I was assuming I could self-reference the event-triggering element using "this"... is that the problem?
    Possibly. If this code is in MyApp.mxml (and not within a <Component> or  <Definition>, then 'this' is a reference to the instance of MyApp. The object which dispatched the event is event.target.
    Gordon Smith
    Adobe Flex SDK Team

  • Type error #1010 PLEASE HELP!!!!

    Hi I'm trying to create a website  in flashcs5 for a class project. Inside the project i have a movie clip  which contains my menu buttons and I've placed that movie clip on the  main timeline in scene1. I've used action script to link the buttons  from the mc to the main timeline. All the buttons are working except the  button "recommended". I keep getting this error:
    TypeError:  Error #1010: A term is undefined and has no properties.
        at  dreamcatcher_fla::MainTimeline/frame1()
    Here is the code  in the actionscript:
    Object(root).menu_mc.dreamcatchers_btn.addEventListener(MouseEvent.CLI  CK, fl_dreamcatchers);
    function  fl_dreamcatchers(event:MouseEvent):void
         gotoAndPlay("dreamcatchers");
    Object(root).menu_mc.legend_btn.addEventListener(MouseEvent.CLICK,  fl_legend);
    function fl_legend(event:MouseEvent):void
         gotoAndPlay("legend");
    Object(root).menu_mc.objiwe_btn.addEventListener(MouseEvent.CLICK,  fl_objiwe);
    function fl_objiwe(event:MouseEvent):void
         gotoAndPlay("objiwe");
    Object(root).menu_mc.lakota_btn.addEventListener(MouseEvent.CLICK,  fl_lakota);
    function fl_lakota(event:MouseEvent):void
         gotoAndPlay("lakota");
    Object(root).menu_mc.recommended_btn.addEventListener(MouseEvent.CLICK  , fl_recommended);
    function  fl_recommended(event:MouseEvent):void
         gotoAndPlay("recommended");
    Object(root).menu_mc.basic_btn.addEventListener(MouseEvent.CLICK,  fl_basic);
    function fl_basic(event:MouseEvent):void
         gotoAndPlay("basic");
    Object(root).menu_mc.advanced_btn.addEventListener(MouseEvent.CLICK,  fl_advanced);
    function fl_advanced(event:MouseEvent):void
         gotoAndPlay("advanced")
    I've double and  triple checked all the instance names and there are no problems. The  code for recommended is exactly the same as for all the other buttons so  I don't understand what's going on. I need to get this project done so  if anyone can help me I'd really appreciate it!!!

    Hi Aqua0315,
    programming on timeline is tricky:) especially with such "monsters" like this:
    Object(root).menu_mc.basic_btn.addEventListener(MouseEvent.CLICK,  fl_basic);
    are you sure that by the time above code executes menu_mc exists with basic_btn? To help you debug do:
    wrap each of the "addeventlistener" line you have with try catch block as in following example:
    try
    Object(root).menu_mc.basic_btn.addEventListener(MouseEvent.CLICK,  fl_basic);
    catch(err:*)
         trace("ERROR#1");//
    change "#1" to whatever you like but unique for each block then in output you will have better indication to where the problem occures,
    best regards

  • Error #1010 issue

    I'm trying to finish this code for a class project, and I keep getting this "
    TypeError: Error #1010: A term is undefined and has no properties.
        at ViolaMobileGameStudentsVersion_fla::MainTimeline/gameLoop()"
    I've debugged it and it's said that the issue is at frame 86, which is
    "menuScreen.level_txt.text = String(level);"
    Here's the whole code, it's kind of long but I can't figure anything out. All the texts have their proper names.
    Any suggestions are appreciated, I have to have this turned in by saturday..
    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    import fl.transitions.TweenEvent;
    import flash.events.Event;
    import flash.events.KeyboardEvent;
    import flash.media.Sound;
    import flash.net.SharedObject;
    import flash.events.MouseEvent;
    /**************VARIABLES**************/
    var STATE_INIT_GAME:String = "STATE_INIT_GAME";
    var STATE_START_PLAYER:String = "STATE_START_PLAYER";
    var STATE_PLAY_GAME:String = "STATE_PLAY_GAME";
    var STATE_END_GAME:String = "STATE_END_GAME";
    var gameState:String;
    var player:MovieClip;
    var enemies:Array;
    var level:Number;
    var score:Number;
    var lives:Number;
    var Bullet:Array;
    //var bulletTimer:Timer = new Timer(200);  // do not add this line
    var explosions:Array;
    var spaceKey:Boolean = false;
    var rightKey:Boolean = false;
    var leftKey:Boolean = false;
    var upKey:Boolean = false;
    var downKey:Boolean = false;
    var accel:Accelerometer;
    var hiddenOptions:Boolean = true;
    /**************SETUP**************/
    gameOverScreen.visible = false;
    optionsMenu.visible = false;
    stage.addEventListener(KeyboardEvent.KEY_DOWN, watchKeys);
    stage.addEventListener(KeyboardEvent.KEY_UP, resetKey);
    stage.addEventListener(KeyboardEvent.KEY_UP, optionsKey);
    /**************INTRO SCREEN**************/
    titleScreen.play_btn.addEventListener(MouseEvent.CLICK, clickAway);
    function clickAway(event:MouseEvent):void
        moveScreenOff(titleScreen);
    //Gesture Swipe
    Multitouch.inputMode = MultitouchInputMode.GESTURE;
    titleScreen.addEventListener(TransformGestureEvent.GESTURE_SWIPE, swipeAway);
    function swipeAway(event:TransformGestureEvent):void
        //Swipe Left
        if (event.offsetX == -1)
            moveScreenOff(titleScreen);
    function moveScreenOff(screen:MovieClip):void
        var introTween = new Tween(screen,"x",Strong.easeInOut,screen.x,(screen.width)*-1,1,true);
        introTween.addEventListener(TweenEvent.MOTION_FINISH, tweenFinish);
        function tweenFinish(e:TweenEvent):void
            gameState = STATE_INIT_GAME;
            addEventListener(Event.ENTER_FRAME, gameLoop);
    we stopped here
    /**************GAME STATES**************/
    function gameLoop(e:Event):void
        menuScreen.level_txt.text = String(level);
        menuScreen.score_txt.text = String(score);
        menuScreen.lives_txt.text = String(lives);
        switch (gameState)
            case STATE_INIT_GAME :
                initGame();
                break;
            case STATE_START_PLAYER :
                startPlayer();
                break;
            case STATE_PLAY_GAME :
                playGame();
                break;
            case STATE_END_GAME :
                endGame();
                break;
    /**************STATE_INIT_GAME**************/
    function initGame():void
        player = new Player();
        enemies = new Array();
        Bullet = new Array();
        explosions = new Array();
        level = 1;
        score = 0;
        lives = 3;
        fire_btn.visible = true;
        gameState = STATE_START_PLAYER;
    /**************STATE_START_PLAYER**************/
    function startPlayer():void
        player.x = stage.stageWidth / 2;
        player.y = stage.stageHeight - player.height;
        player.cacheAsBitmap = true;
        addChild(player);
        accel = new Accelerometer();
        if (Accelerometer.isSupported)
            accel.addEventListener(AccelerometerEvent.UPDATE, accelMove);
        else
            //If there is no accelerometer support...
            addEventListener(Event.ENTER_FRAME, movePlayer);
        gameState = STATE_PLAY_GAME;
    function accelMove(event:AccelerometerEvent):void
        player.x -=  event.accelerationX * 100;
        player.y +=  event.accelerationY * 80;
        if (player.x < 0)
            player.x = 0;
        else if (player.x > (stage.stageWidth - player.width) )
            player.x = stage.stageWidth - player.width;
        if (player.y < 50)
            player.y = 50;
        else if (player.y > stage.stageHeight - player.height)
            player.y = stage.stageHeight - player.height;
        addEventListener(MouseEvent.CLICK,fire);
    function fire(evt:MouseEvent):void
        createBullet();
    function movePlayer(Evt:Event):void
        if (rightKey)
            player.x +=  10;
        else if (leftKey)
            player.x -=  10;
        if (upKey)
            player.y -=  4;
        else if (downKey)
            player.y +=  4;
        if (spaceKey)
            createBullet();
        if (player.x < 0)
            player.x = 0;
        else if (player.x > stage.stageWidth - player.width)
            player.x = stage.stageWidth - player.width;
        if (player.y < 50)
            player.y = 50;
        else if (player.y > stage.stageHeight - player.height)
            player.y = stage.stageHeight - player.height;
    function createBullet():void
        var tempBullet:MovieClip = new Bullets();
        tempBullet.x = player.x;
        tempBullet.y = player.y;
        tempBullet.cacheAsBitmap = true;
        tempBullet.speed = 15;
        addChild(tempBullet);
        Bullet.push(tempBullet);
    function moveBullet():void
        var tempBullet:MovieClip;
        for (var i=Bullet.length-1; i>=0; i--)
            tempBullet = Bullet[i];
            tempBullet.y -=  tempBullet.speed;
            if (tempBullet.y < 0)
                removeBullet(i);
        var tempExplosion:MovieClip;
        for (i=explosions.length-1; i>=0; i--)
            tempExplosion = explosions[i];
            if (tempExplosion.currentFrame >= tempExplosion.totalFrames)
                removeExplosion(i);
    /**************STATE_PLAY_GAME**************/
    function playGame():void
        makeEnemies();
        moveEnemies();
        moveBullet();
        testForEnd();
    function makeEnemies():void
        var chance:Number = Math.floor(Math.random() * 60);
        var whichEnemy:Number = Math.round(Math.random() * 2 + 1);
        if (chance <= 1 + level)
            var tempEnemy:MovieClip;
            tempEnemy = new Enemy();
            tempEnemy.gotoAndStop(whichEnemy);
            tempEnemy.speed = 3;
            tempEnemy.x = Math.round((Math.random() * 800) + 20);
            tempEnemy.cacheAsBitmap = true;
            addChild(tempEnemy);
            enemies.push(tempEnemy);
            setChildIndex(menuScreen,numChildren-1);
    function moveEnemies():void
        var tempEnemy:MovieClip;
        for (var i:int =enemies.length-1; i>=0; i--)
            tempEnemy = enemies[i];
            tempEnemy.y +=  tempEnemy.speed;
            if (tempEnemy.y > stage.stageHeight)
                removeEnemy(i);
                lives--;
            else if (tempEnemy.hitTestObject(player))
                makeExplosion(tempEnemy.x, tempEnemy.y);
                removeEnemy(i);
                lives--;
            var tempBullet:MovieClip;
            //tempEnemy = enemies[i];
            for (var j:int=Bullet.length-1; j>=0; j--)
                tempBullet = Bullet[j];
                if (tempEnemy.hitTestObject(tempBullet))
                    makeExplosion(tempEnemy.x, tempEnemy.y);
                    removeEnemy(i);
                    removeBullet(j);
                    score +=  5;
    function makeExplosion(ex:Number, ey:Number):void
        var tempExplosion:MovieClip;
        tempExplosion = new Explosion();
        tempExplosion.x = ex;
        tempExplosion.y = ey;
        addChild(tempExplosion);
        explosions.push(tempExplosion);
        //var sound:Sound = new Explode();
        //sound.play();
    function testForEnd():void
        if (score > level * 100)
            level++;
        if (lives == 0)
            gameState = STATE_END_GAME;
    function removeEnemy(idx:int)
        removeChild(enemies[idx]);
        enemies.splice(idx,1);
    function removeBullet(idx:int)
        removeChild(Bullet[idx]);
        Bullet.splice(idx,1);
    function removeExplosion(idx:int)
        removeChild(explosions[idx]);
        explosions.splice(idx,1);
    /*********** KEY PRESS ***********/
    function watchKeys(evt:KeyboardEvent):void
        if (evt.keyCode == Keyboard.SPACE)
            spaceKey = true;
        if (evt.keyCode == Keyboard.RIGHT)
            rightKey = true;
        if (evt.keyCode == Keyboard.LEFT)
            leftKey = true;
        if (evt.keyCode == Keyboard.UP)
            upKey = true;
        if (evt.keyCode == Keyboard.DOWN)
            downKey = true;
    function resetKey(evt:KeyboardEvent):void
        if (evt.keyCode == Keyboard.SPACE)
            spaceKey = false;
        if (evt.keyCode == Keyboard.RIGHT)
            rightKey = false;
        if (evt.keyCode == Keyboard.LEFT)
            leftKey = false;
        if (evt.keyCode == Keyboard.UP)
            upKey = false;
        if (evt.keyCode == Keyboard.DOWN)
            downKey = false;
    /**************END SCREEN**************/
    function endGame():void
        accel.removeEventListener(AccelerometerEvent.UPDATE, accelMove);
        removeEventListener(Event.ENTER_FRAME, gameLoop);
        stage.removeEventListener(KeyboardEvent.KEY_DOWN, watchKeys);
        stage.removeEventListener(KeyboardEvent.KEY_UP, resetKey);
        fire_btn.enabled = false;
        fire_btn.visible = false;
        removeEventListener(MouseEvent.CLICK,fire);
        removeGame();
        gameOverScreen.visible = true;
        gameOverScreen.x = 0;
        showResults();
    /**************REMOVE GAME**************/
    function removeGame():void
        for (var i:int = enemies.length-1; i >=0; i--)
            removeEnemy(i);
        for (var j:int = Bullet.length-1; j >=0; j--)
            removeBullet(j);
        for (var k:int = explosions.length-1; k >=0; k--)
            removeExplosion(k);
        removeChild(player);
    function showResults():void
        gameOverScreen.enter_btn.visible = false;
        gameOverScreen.nameField_txt.visible = false;
        var so:SharedObject = SharedObject.getLocal("alltimeHighScore");
        if (so.data.score == undefined || score > so.data.score)
            gameOverScreen.highScore_txt.text = "You made it to level " + level + " with a high score of " + score + ". \n Enter your name below.";
            gameOverScreen.enter_btn.visible = true;
            gameOverScreen.nameField_txt.visible = true;
        else
            gameOverScreen.highScore_txt.text = "Your score of " + score + " \n does not beat " + so.data.score + " \n by " + so.data.name;
        gameOverScreen.quit_btn.addEventListener(MouseEvent.CLICK, exitApp);
        gameOverScreen.enter_btn.addEventListener(MouseEvent.CLICK, clickEnter);
        function clickEnter(event:MouseEvent):void
            gameOverScreen.highScore_txt.text = "Great job, " + gameOverScreen.nameField_txt.text + "! \n You made it to level " + level + " \n with a score of " + score + "!";
            so.data.score = score;
            so.data.level = level;
            so.data.name = gameOverScreen.nameField_txt.text;
            so.flush();
            gameOverScreen.enter_btn.visible = false;
            gameOverScreen.nameField_txt.visible = false;
        //Enables the play button
        gameOverScreen.playAgain_btn.addEventListener(MouseEvent.CLICK, clickFinalAway);
        function clickFinalAway(event:MouseEvent):void
            moveScreenOff(gameOverScreen);
    /**************OPTIONS MENU**************/
    function optionsKey(event:KeyboardEvent):void
        //Options menu, use 16777234 or Keyboard.MENU
        if (event.keyCode == 16777234)
            if (hiddenOptions)
                setChildIndex(optionsMenu,numChildren-1);
                optionsMenu.visible = true;
                optionsMenu.addEventListener(MouseEvent.CLICK, exitApp);
                pauseGame();
            else
                optionsMenu.visible = false;
                optionsMenu.removeEventListener(MouseEvent.CLICK, exitApp);
                resumeGame();
            hiddenOptions = ! hiddenOptions;
    function exitApp(event:MouseEvent):void
        //NativeApplication.nativeApplication.exit(0);
    //Keep screen awake if you are using the Accelerometer etc.
    //NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE;
    stage.addEventListener(Event.DEACTIVATE, Deactivate);
    function Deactivate(event:Event):void
        pauseGame();
    stage.addEventListener(Event.ACTIVATE, Activate);
    function Activate(event:Event):void
        resumeGame();
    function pauseGame():void
        //Remove any listener events, timers etc.
        if (gameState == STATE_PLAY_GAME)
            removeEventListener(Event.ENTER_FRAME, gameLoop);
            accel.removeEventListener(AccelerometerEvent.UPDATE, accelMove);
            removeEventListener(MouseEvent.CLICK,fire);
    function resumeGame():void
        //Activate any listener events, timers etc.
        if (gameState == STATE_PLAY_GAME)
            addEventListener(Event.ENTER_FRAME, gameLoop);
            accel.addEventListener(AccelerometerEvent.UPDATE, accelMove);
            addEventListener(MouseEvent.CLICK,fire);

    I don't see where menuScreen is intialized...  It's also long after this was due, hope you figured it out.

  • AS3 Twitter Feed Error 1010

    Hi
    I'm trying to create a simple Twitter feed for a Flash website.  When I run the flash movie however I get the following messages appear in the Output window:
    TypeError: Error #1010: A term is undefined and has no properties.
    at Cinema_fla::MainTimeline/processXML()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()
    I am using Flash CS6 and the AS3 code for my Twitter feed is shown below:
    var myXMLLoader:URLLoader = new URLLoader();
    myXMLLoader.load(new URLRequest("https://api.twitter.com/1/statuses/user_timeline.rss?screen_name=YahooMoviesUK"));
    myXMLLoader.addEventListener(Event.COMPLETE, processXML);
    function processXML(e:Event):void{
    var myXML:XML = new XML(e.target.data);
    txtTweet1.text = myXML.status[0].text;
    txtTweet2.text = myXML.status[1].text;
    txtTweet3.text = myXML.status[2].text;
    I would be grateful if anyone could give me some advice as to why this error is occurring.  If you need any more info please let me know.
    Thanks

    Ok I just tried doing the trace like you said and the output showed me that the twitter XML was using different tag names than I thought.  However, after changing the AS code to reflect this (see below) I'm still getting the same error on the same line.  I also changed the order of the complete listener and load command:
    var myXMLLoader:URLLoader = new URLLoader();
    myXMLLoader.addEventListener(Event.COMPLETE, processXML);
    myXMLLoader.load(new URLRequest("https://api.twitter.com/1/statuses/user_timeline.rss?screen_name=YahooMoviesUK"));
    function processXML(e:Event):void{
    var myXML:XML = new XML(e.target.data);
    txtTweet1.text = myXML.item.title[0].text;
    txtTweet2.text = myXML.item.title[1].text;
    txtTweet3.text = myXML.item.title[2].text;

  • Error #1010: a term is undefined

    Error #1010: Een term is ongedefinieerd ....
    TypeError: Error #1010: a term is undefined and has no properties.
    at portfolio_fla::guestbook_MC_113/serverScoreFeedback()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()
    Hi, i have this fully working fla, wich sends and gets info out of a database
    its a frame and a actionframe
    when i put these in a mc on the mainstage of another fla, its not working anymore
    ive been searching like hell, but cant find the error
    probably something thats not imported in the maintimeline.as????
    this is the code
    maintimeline.as
    ActionScript 3 Code:
    package portfolio_fla
         import flash.display.*;
         import flash.events.*;
         import flash.net.*;
         import flash.text.*;
         dynamic public class MainTimeline extends MovieClip
              public var knop_cv:SimpleButton;
              public var knop_about:SimpleButton;
              public var knop_webdesign:SimpleButton;
              public var knop_photography:SimpleButton;
              public var knop_contact:SimpleButton;
              public var diafragma:MovieClip;
              public var geklikt:String;
              public var knop_home:SimpleButton;
              public var knop_guestbook:SimpleButton;
              public var home_text:TextField;
              public var about_text:TextField;
              public var contactform:MovieClip;
              public var guestbookform:MovieClip;
              var txtFile:String = "home.txt";
              var urlRequest:URLRequest = new URLRequest (txtFile);
              var loader:URLLoader = new URLLoader();
              var txtFile2:String = "about.txt";
              var urlRequest2:URLRequest = new URLRequest (txtFile2);
              var loader2:URLLoader = new URLLoader();
              function loadHandler(e:Event):void
                   var loader:URLLoader = URLLoader(e.target);
                   home_text.text = loader.data;
                   contactform.visible = false;
                   guestbookform.visible = false;
                   about_text.visible = false;
              function loadHandler2(e:Event):void
                   var loader2:URLLoader = URLLoader(e.target);
                   about_text.text = loader2.data;
              public function MainTimeline()
                   loader.addEventListener(Event.COMPLETE, loadHandler);
                   loader.load(urlRequest);
                   loader2.addEventListener(Event.COMPLETE, loadHandler2);
                   loader2.load(urlRequest2);
                   addFrameScript(0, frame1, 19, frame20);
                   return;
              }// end function
              function frame1()
                   knop_home.addEventListener(MouseEvent.CLICK, home);
                   knop_about.addEventListener(MouseEvent.CLICK, about);
                   knop_cv.addEventListener(MouseEvent.CLICK, cv);
                   knop_webdesign.addEventListener(MouseEvent.CLICK, webdesign);
                   knop_photography.addEventListener(MouseEvent.CLICK, photography);
                   knop_guestbook.addEventListener(MouseEvent.CLICK, guestbook);
                   knop_contact.addEventListener(MouseEvent.CLICK, contact);
                   stop();
                   return;
              }// end function
              function frame20()
                   stop();
                   return;
              }// end function
              function frame40()
                   stop();
                   return;
              }// end function
              function frame60()
                   stop();
                   return;
              }// end function
              function frame80()
                   stop();
                   return;
              }// end function
              function frame100()
                   stop();
                   return;
              }// end function
              function frame120()
                   stop();
                   return;
              }// end function
              function frame140()
                   stop();
                   return;
              }// end function
              public function contact(event:MouseEvent)
                   geklikt = "Contact";
                   this.diafragma.lamel1.gotoAndPlay(2);
                   this.diafragma.lamel2.gotoAndPlay(2);
                   this.diafragma.lamel3.gotoAndPlay(2);
                   this.diafragma.lamel4.gotoAndPlay(2);
                   this.diafragma.lamel5.gotoAndPlay(2);
                   this.diafragma.lamel6.gotoAndPlay(2);
                   this.diafragma.lamel7.gotoAndPlay(2);
                   this.diafragma.lamel8.gotoAndPlay(2);
                   this.diafragma.lamel9.gotoAndPlay(2);
                   this.diafragma.lamel10.gotoAndPlay(2);
                   return;
              }// end function
              public function guestbook(event:MouseEvent)
                   geklikt = "Guestbook";
                   this.diafragma.lamel1.gotoAndPlay(2);
                   this.diafragma.lamel2.gotoAndPlay(2);
                   this.diafragma.lamel3.gotoAndPlay(2);
                   this.diafragma.lamel4.gotoAndPlay(2);
                   this.diafragma.lamel5.gotoAndPlay(2);
                   this.diafragma.lamel6.gotoAndPlay(2);
                   this.diafragma.lamel7.gotoAndPlay(2);
                   this.diafragma.lamel8.gotoAndPlay(2);
                   this.diafragma.lamel9.gotoAndPlay(2);
                   this.diafragma.lamel10.gotoAndPlay(2);
                   return;
              }// end function
              public function photography(event:MouseEvent)
                   geklikt = "Photography";
                   this.diafragma.lamel1.gotoAndPlay(2);
                   this.diafragma.lamel2.gotoAndPlay(2);
                   this.diafragma.lamel3.gotoAndPlay(2);
                   this.diafragma.lamel4.gotoAndPlay(2);
                   this.diafragma.lamel5.gotoAndPlay(2);
                   this.diafragma.lamel6.gotoAndPlay(2);
                   this.diafragma.lamel7.gotoAndPlay(2);
                   this.diafragma.lamel8.gotoAndPlay(2);
                   this.diafragma.lamel9.gotoAndPlay(2);
                   this.diafragma.lamel10.gotoAndPlay(2);
                   return;
              }// end function
              public function webdesign(event:MouseEvent)
                   geklikt = "Webdesign";
                   this.diafragma.lamel1.gotoAndPlay(2);
                   this.diafragma.lamel2.gotoAndPlay(2);
                   this.diafragma.lamel3.gotoAndPlay(2);
                   this.diafragma.lamel4.gotoAndPlay(2);
                   this.diafragma.lamel5.gotoAndPlay(2);
                   this.diafragma.lamel6.gotoAndPlay(2);
                   this.diafragma.lamel7.gotoAndPlay(2);
                   this.diafragma.lamel8.gotoAndPlay(2);
                   this.diafragma.lamel9.gotoAndPlay(2);
                   this.diafragma.lamel10.gotoAndPlay(2);
                   return;
              }// end function
              public function cv(event:MouseEvent)
                   geklikt = "Cv";
                   this.diafragma.lamel1.gotoAndPlay(2);
                   this.diafragma.lamel2.gotoAndPlay(2);
                   this.diafragma.lamel3.gotoAndPlay(2);
                   this.diafragma.lamel4.gotoAndPlay(2);
                   this.diafragma.lamel5.gotoAndPlay(2);
                   this.diafragma.lamel6.gotoAndPlay(2);
                   this.diafragma.lamel7.gotoAndPlay(2);
                   this.diafragma.lamel8.gotoAndPlay(2);
                   this.diafragma.lamel9.gotoAndPlay(2);
                   this.diafragma.lamel10.gotoAndPlay(2);
                   return;
              }// end function
              public function about(event:MouseEvent)
                   geklikt = "About";
                   this.diafragma.lamel1.gotoAndPlay(2);
                   this.diafragma.lamel2.gotoAndPlay(2);
                   this.diafragma.lamel3.gotoAndPlay(2);
                   this.diafragma.lamel4.gotoAndPlay(2);
                   this.diafragma.lamel5.gotoAndPlay(2);
                   this.diafragma.lamel6.gotoAndPlay(2);
                   this.diafragma.lamel7.gotoAndPlay(2);
                   this.diafragma.lamel8.gotoAndPlay(2);
                   this.diafragma.lamel9.gotoAndPlay(2);
                   this.diafragma.lamel10.

    well, ive tried on putting the frames not in the MC, but on the mainstage
    and the actionscript i put it into my other maintimeline.as
    all works good, untill i paste the piece of
            name_txt.text     = "";
            score_txt.text    = "";
            feedback_txt.text = "";
    then i get
    ReferenceError: Error #1065: Variabele name_txt is not defined
        at portfolio_fla::MainTimeline$cinit()
        at global$init()
    why is this?
    the code works on its own, then i didnt need to define name_txt
    this is how maintimeline.as looks like now
    package portfolio_fla
        import flash.display.*;
        import flash.events.*;
        import flash.net.*;
        import flash.text.*;
        dynamic public class MainTimeline extends MovieClip
            public var knop_cv:SimpleButton;
            public var knop_about:SimpleButton;
            public var knop_webdesign:SimpleButton;
            public var knop_photography:SimpleButton;
            public var knop_contact:SimpleButton;
            public var diafragma:MovieClip;
            public var geklikt:String;
            public var knop_home:SimpleButton;
            public var knop_guestbook:SimpleButton;
            public var home_text:TextField;
            public var about_text:TextField;
            public var contactform:MovieClip;   
            public var guestbookform:MovieClip;
            var txtFile:String = "home.txt";
            var urlRequest:URLRequest = new URLRequest (txtFile);
            var loader:URLLoader = new URLLoader();
            var txtFile2:String = "about.txt";
            var urlRequest2:URLRequest = new URLRequest (txtFile2);
            var loader2:URLLoader = new URLLoader();
            const SERVER_FILE:String  = "http://localhost/portfolio/highscore_board.php";
    const SENT_SUCCESS:String = "Successful";
    const SENT_FAILED:String  = "Unsuccessful";
    const NUM_OF_SCORES:int      = 8;
            function submitScoreToServer(evt:MouseEvent):void {
        var passChecks:Boolean = true;
        if(score_txt.text.length < 1) {
            feedback_txt.text = "Please fill in a score.";
            passChecks = false;
        if(name_txt.text.length < 1) {
            feedback_txt.text = "Please fill in a name.";
            passChecks = false;
        if(passChecks) {
            submit_btn.enabled = false;
            feedback_txt.text = "Submitting score...";
            var urlVars:URLVariables = new URLVariables();
            var urlReq:URLRequest      = new URLRequest(SERVER_FILE);
            var ldr:URLLoader           = new URLLoader();
            urlVars.todo  = "insert";
            urlVars.name  = name_txt.text;
            urlVars.score = score_txt.text;
            urlReq.data   = urlVars;
            urlReq.method = URLRequestMethod.POST;
            ldr.addEventListener(Event.COMPLETE, serverInsertFeedback);
            ldr.load(urlReq);
    function serverInsertFeedback(evt:Event):void {
        var ldr:URLLoader = evt.target as URLLoader;
        var urlVars:URLVariables = new URLVariables(ldr.data);
        if(urlVars.result == SENT_SUCCESS) {
            feedback_txt.text = "Score sent successfully.";
            getScoreFromServer();
        } else if(urlVars.result == SENT_FAILED) {
            feedback_txt.text = "Problem submitting score to server.";
        submit_btn.enabled = true;
    function serverScoreFeedback(evt:Event):void {
        var ldr:URLLoader = evt.target as URLLoader;
        var urlVars:URLVariables = new URLVariables(ldr.data);
        if(urlVars.result == SENT_SUCCESS) {
            for(var i:int = 1; i <= NUM_OF_SCORES; i++) {
                root["boardName0"  + i + "_txt"].text = "Unoccupied";
                root["boardScore0" + i + "_txt"].text = "-";
                if(urlVars["name0"  + i] != null) {
                    root["boardName0"  + i + "_txt"].text = urlVars["name0"  + i];
                    root["boardScore0" + i + "_txt"].text = urlVars["score0" + i];
            feedback_txt.text = "Score board has been updated.";
        } else if(urlVars.result == SENT_FAILED) {
            feedback_txt.text = "There was a problem retrieving the scores.";
    function getScoreFromServer():void {
        feedback_txt.text = "Retrieving scores...";   
        var urlVars:URLVariables = new URLVariables();
        var urlReq:URLRequest      = new URLRequest(SERVER_FILE);
        var ldr:URLLoader           = new URLLoader();
        urlVars.todo  = "score";
        urlReq.data   = urlVars;
        urlReq.method = URLRequestMethod.POST;
        ldr.addEventListener(Event.COMPLETE, serverScoreFeedback);
        ldr.load(urlReq);
            name_txt.text     = "";
            score_txt.text    = "";
            feedback_txt.text = "";
    submit_btn.addEventListener(MouseEvent.CLICK, submitScoreToServer);
    getScoreFromServer();
            function loadHandler(e:Event):void
                var loader:URLLoader = URLLoader(e.target);
                home_text.text = loader.data;
                contactform.visible = false;
                about_text.visible = false;
            function loadHandler2(e:Event):void
                var loader2:URLLoader = URLLoader(e.target);
                about_text.text = loader2.data;
            public function MainTimeline()
            loader.addEventListener(Event.COMPLETE, loadHandler);
            loader.load(urlRequest);
            loader2.addEventListener(Event.COMPLETE, loadHandler2);
            loader2.load(urlRequest2);
            addFrameScript(0, frame1, 19, frame20);
                return;
            }// end function
            function frame1()
                knop_home.addEventListener(MouseEvent.CLICK, home);
                knop_about.addEventListener(MouseEvent.CLICK, about);
                knop_cv.addEventListener(MouseEvent.CLICK, cv);
                knop_webdesign.addEventListener(MouseEvent.CLICK, webdesign);
                knop_photography.addEventListener(MouseEvent.CLICK, photography);
                knop_guestbook.addEventListener(MouseEvent.CLICK, guestbook);
                knop_contact.addEventListener(MouseEvent.CLICK, contact);
                stop();
                return;
            }// end function
            function frame20()
                stop();
                return;
            }// end function
             function frame40()
                stop();
                return;
            }// end function
             function frame60()
                stop();
                return;
            }// end function
             function frame80()
                stop();
                return;
            }// end function
             function frame100()
                stop();
                return;
            }// end function
            function frame120()
                stop();
                return;
            }// end function
            function frame140()
                stop();
                return;
            }// end function
            public function contact(event:MouseEvent)
                geklikt = "Contact";
                this.diafragma.lamel1.gotoAndPlay(2);
                this.diafragma.lamel2.gotoAndPlay(2);
                this.diafragma.lamel3.gotoAndPlay(2);
                this.diafragma.lamel4.gotoAndPlay(2);
                this.diafragma.lamel5.gotoAndPlay(2);
                this.diafragma.lamel6.gotoAndPlay(2);
                this.diafragma.lamel7.gotoAndPlay(2);
                this.diafragma.lamel8.gotoAndPlay(2);
                this.diafragma.lamel9.gotoAndPlay(2);
                this.diafragma.lamel10.gotoAndPlay(2);
                return;
            }// end function
           public function guestbook(event:MouseEvent)
                geklikt = "Guestbook";
                this.diafragma.lamel1.gotoAndPlay(2);
                this.diafragma.lamel2.gotoAndPlay(2);
                this.diafragma.lamel3.gotoAndPlay(2);
                this.diafragma.lamel4.gotoAndPlay(2);
                this.diafragma.lamel5.gotoAndPlay(2);
                this.diafragma.lamel6.gotoAndPlay(2);
                this.diafragma.lamel7.gotoAndPlay(2);
                this.diafragma.lamel8.gotoAndPlay(2);
                this.diafragma.lamel9.gotoAndPlay(2);
                this.diafragma.lamel10.gotoAndPlay(2);
                return;
            }// end function
           public function photography(event:MouseEvent)
                geklikt = "Photography";
                this.diafragma.lamel1.gotoAndPlay(2);
                this.diafragma.lamel2.gotoAndPlay(2);
                this.diafragma.lamel3.gotoAndPlay(2);
                this.diafragma.lamel4.gotoAndPlay(2);
                this.diafragma.lamel5.gotoAndPlay(2);
                this.diafragma.lamel6.gotoAndPlay(2);
                this.diafragma.lamel7.gotoAndPlay(2);
                this.diafragma.lamel8.gotoAndPlay(2);
                this.diafragma.lamel9.gotoAndPlay(2);
                this.diafragma.lamel10.gotoAndPlay(2);
                return;
            }// end function
           public function webdesign(event:MouseEvent)
                geklikt = "Webdesign";
                this.diafragma.lamel1.gotoAndPlay(2);
                this.diafragma.lamel2.gotoAndPlay(2);
                this.diafragma.lamel3.gotoAndPlay(2);
                this.diafragma.lamel4.gotoAndPlay(2);
                this.diafragma.lamel5.gotoAndPlay(2);
                this.diafragma.lamel6.gotoAndPlay(2);
                this.diafragma.lamel7.gotoAndPlay(2);
                this.diafragma.lamel8.gotoAndPlay(2);
                this.diafragma.lamel9.gotoAndPlay(2);
                this.diafragma.lamel10.gotoAndPlay(2);
                return;
            }// end function
           public function cv(event:MouseEvent)
                geklikt = "Cv";
                this.diafragma.lamel1.gotoAndPlay(2);
                this.diafragma.lamel2.gotoAndPlay(2);
                this.diafragma.lamel3.gotoAndPlay(2);
                this.diafragma.lamel4.gotoAndPlay(2);
                this.diafragma.lamel5.gotoAndPlay(2);
                this.diafragma.lamel6.gotoAndPlay(2);
                this.diafragma.lamel7.gotoAndPlay(2);
                this.diafragma.lamel8.gotoAndPlay(2);
                this.diafragma.lamel9.gotoAndPlay(2);
                this.diafragma.lamel10.gotoAndPlay(2);
                return;
            }// end function
           public function about(event:MouseEvent)
                geklikt = "About";
                this.diafragma.lamel1.gotoAndPlay(2);
                this.diafragma.lamel2.gotoAndPlay(2);
                this.diafragma.lamel3.gotoAndPlay(2);
                this.diafragma.lamel4.gotoAndPlay(2);
                this.diafragma.lamel5.gotoAndPlay(2);
                this.diafragma.lamel6.gotoAndPlay(2);
                this.diafragma.lamel7.gotoAndPlay(2);
                this.diafragma.lamel8.gotoAndPlay(2);
                this.diafragma.lamel9.gotoAndPlay(2);
                this.diafragma.lamel10.gotoAndPlay(2);
                return;
            }// end function
            public function home(event:MouseEvent)
                geklikt = "Home";
                this.diafragma.lamel1.gotoAndPlay(2);
                this.diafragma.lamel2.gotoAndPlay(2);
                this.diafragma.lamel3.gotoAndPlay(2);
                this.diafragma.lamel4.gotoAndPlay(2);
                this.diafragma.lamel5.gotoAndPlay(2);
                this.diafragma.lamel6.gotoAndPlay(2);
                this.diafragma.lamel7.gotoAndPlay(2);
                this.diafragma.lamel8.gotoAndPlay(2);
                this.diafragma.lamel9.gotoAndPlay(2);
                this.diafragma.lamel10.gotoAndPlay(2);
                return;
            }// end function

  • TypeError: Error #1010 on code that doesn't exist.

    Hello all,
    I have a drop down menu with 7 options. The menu is a movie clip with a mask that reveals each of the buttons when a person mouse_overs the menu button. Each menu option does the same thing, it will call a function based on the button clicked. The function for each button does the same thing:
    function INDEX_Safety (e:MouseEvent):void
              play();
              INDEX_SAFETY=true;
              Sound_Stopper ();
    Each of the functions will change the value of its respecive boolean variable. One for each button. Sound Stopper is a function that stops any FLV Sound that is currently playing.
    When it goes through play() it will come to a particular frame that has:
    Index_Jumper ();
    this function determines which boolean has been set to true, and does a gotoAndPlay("Label Name") based on the boolean that has been set to true. Then sets the boolean back to false.
    function Index_Jumper ():void
              if (INDEX_SAFETY==true){gotoAndPlay("Safety"); INDEX_SAFETY=false;}
              if (INDEX_TOOLS==true){gotoAndPlay("Tools and Positions"); INDEX_TOOLS=false;}
              if (INDEX_METHODS==true){gotoAndPlay("The Methods"); INDEX_METHODS=false;}
              if (INDEX_METHOD1==true){gotoAndPlay("Method 1"); INDEX_METHOD1=false;}
              if (INDEX_METHOD2==true){gotoAndPlay("Method 2"); INDEX_METHOD2=false;}
              if (INDEX_TDBL==true){gotoAndPlay("Installing TDBL"); INDEX_TDBL=false;}
              if (INDEX_RAISING==true){gotoAndPlay("Raising the Stand"); INDEX_RAISING=false;}
    The issue i am having: When i click on the 6th option, TDBL, i get the error:
    TypeError: Error #1010: A term is undefined and has no properties.
              at RaisingtheOperatorsPlatform_fla::MainTimeline/frame147()[RaisingtheOperatorsPlatform_fla. MainTimeline::frame147:10]
    It says frame 147:10
    From my understanding this means the 10th line on Frame 147.
    This is my frame 147:
    1. stop ();
    2. Caption ();
    3. IndexMC.Safety_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Safety);
    4. IndexMC.Tools_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Tools);
    5. IndexMC.Methods_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Methods);
    6. IndexMC.Method1_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Method1);
    7. IndexMC.Method2_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Method2);
    8. IndexMC.TBDL_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Tdbl);
    9. IndexMC.Raising_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Raising);
    I dont have a 10th line.
    also, when i click the 7th option, nothing happens. However, options 1 - 5 on the drop down menu work just fine.
    Thanks for any insight.

    Right after posting that, I got an idea to try adding the following to frame 1:
    addEventListener(Event.ENTER_FRAME, Frame_147);
    function Frame_147 (event:Event):void
              if (currentFrame==147)
                        stop ();
              Caption ();
              IndexMC.Safety_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Safety);
              IndexMC.Tools_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Tools);
              IndexMC.Methods_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Methods);
              IndexMC.Method1_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Method1);
              IndexMC.Method2_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Method2);
              IndexMC.TDBL_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Tdbl);
              IndexMC.Raising_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Raising);
    I then commented-out frame 147.
    the error i got pointed to line 36 of frame 1, which is:
      IndexMC.TDBL_Menu_Button.addEventListener(MouseEvent.CLICK, INDEX_Tdbl);
    Being able to focus on this, i see that i have IndexMC.TBDL instead of IndexMC.TDBL, i think this was one of those "been looking at this thing for too long" errors. Thank you for looking into this, the problem is now solved. As for the error pointing to a line that doesn't exist:
    I still have no idea why it would say the issue was frame 147:10

  • Error 1010: term is undefined.... ?

    i am running into the error: "#1010: A term in undefined and has no properties."
    this is refering to the line:
    trace ("btnLMain.langBoxS.name: " + btnLMain.langBoxS.name);
    but i dont understand how this could be as i have each of the above defined as shown here:
    var langBox:Shape = new Shape();
    langBox.graphics.beginFill(0x000000, .75)
    langBox.graphics.drawRect(0, 0, bxW, bxH); //i have bxW and bxH defined earlier in my code
    langBox.graphics.endFill();
    var langBoxS:MovieClip = new MovieClip();
    langBoxS.name "da Box";
    langBoxS.addChild(langBox);
    var btnLMain:MovieClip = new MovieClip();
    btnLMain.addChild(langBoxS);
    btnLMain.x = 800;
    btnLMain.x = 800;
    addChild(btnLMain);
    trace ("btnLMain.langBoxS.name: " + btnLMain.langBoxS.name);
    do you know what's possibly wrong?

    You cannot use dot notation to target dynamically added children... While it will work for manually defined objects, as Andrei showed, you will need to use the getChild... methods if you want to try to target thru parent objects.  But you do not need to target thru parent objects at all since you already have a direct reference to the intended target since it was declared independently...
    trace ("btnLMain.langBoxS.name: " + langBoxS.name);

  • The famous Error #1010...

    Hi everyone,
    I've got the same problem as many of users.... the famous error #1010.
    Don't understand why and how I can solved it... If someone could help me, it'd be fantastic !
    Here's my error :
    TypeError: Error #1010: A term is undefined and has no properties.
    at version0_fla::playerSide_5/frame1()[version0_fla.playerSide_5::frame1:1]
    at flash.display::MovieClip/gotoAndStop()
    at com.laserdragonuniversity.alpaca::Player()[C:\Users\Lord\Desktop\tonton marcel android\com\laserdragonuniversity\alpaca\Player.as:27]
    at com.laserdragonuniversity.alpaca::Engine/createBackground()[C:\Users\Lord\Desktop\tonton marcel android\com\laserdragonuniversity\alpaca\Engine.as:134]
    at com.laserdragonuniversity.alpaca::Engine/configLoaded()[C:\Users\Lord\Desktop\tonton marcel android\com\laserdragonuniversity\alpaca\Engine.as:98]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()
    and, if y ignore it, it says :
    TypeError: Error #1010: A term is undefined and has no properties.
              at version0_fla::playerTalk_22/frame1()[version0_fla.playerTalk_22::frame1:1]
              at flash.display::MovieClip/gotoAndStop()
              at com.laserdragonuniversity.alpaca::Speech()[C:\Users\Lord\Desktop\tonton marcel android\com\laserdragonuniversity\alpaca\Speech.as:95]
              at com.laserdragonuniversity.alpaca::Puzzle/firstAction()[C:\Users\Lord\Desktop\tonton marcel android\com\laserdragonuniversity\alpaca\Puzzle.as:142]
              at com.laserdragonuniversity.alpaca::Engine/removeIntro()[C:\Users\Lord\Desktop\tonton marcel android\com\laserdragonuniversity\alpaca\Engine.as:250]
    I'm using alpaca open source : http://www.alpacaengine.com/docs
    downloable here : http://www.alpacaengine.com/downloads/alpaca_sample_project_2-1.zip
    Thanks very much for your help !
    Stephan

    The error appears to be pointing at line 1 of frame 1 something called playerTalk22.  Use the trace function to narrow down which element of that line is MIA

Maybe you are looking for

  • Flip4Mac not working in safari 5

    hi guys, just noticed as i tried to listen to jazz fm that the flip4mac app thats streams wmas no longer works in safari 5, i think im on the latest version of flip4mac, anyone else got this problem or should i try reinstalling? Heres the link im try

  • How can i adjust my display on videos.  Result is dark same as with the camera .  Thank you

    How can i adjust my display on videos and camera.  Result is dark same as with the macbook camera . When i play videos , its dark . Please help.   Thank you

  • In JDeveloper10 DataSourceName modifying automatically why?

    The src code is migrated from Oracle JDeveloper 9.0.5.13 to Oracle IDE     10.1.3.36.73 The Same applicaiton is working for Oracle JDeveloper 9.0.5.13 Version but not for Oracle IDE 10.1.3.36.73 I found that the DataSource Name is changing "jdbc/Smar

  • App malfunctions when accessed via URL but not when accessed in workspace

    I have an application that I have built at work. I have it on a test box. I have been using the app for several months with no problem. Because it is on the test box I am able to use the url to log into the app e.g. http://infotest.finone.bankone.net

  • Document Distribution Log Status

    HI All, In CVI9 I can set a document distribution status to Ignore but I cannot find anywhere in the log that it records who set that status and when.  Does anyone know if there is a background table where this information is stored so I can write a