property undefined hitTestObject

Hello. I do a game, it involes shooting target. the way it works is that I have a small dot (pixel) and when the user clicks a mouse button, check if its hit a target.

in my target.as file I have the following error:

Line 23 1120: Access of undefined property poi.

POI is the name of the instance of thing that checks to see if his hitting the target. (point of impact)


If (target.hitTestObject (poi))

This is the code giving the error.

public void Target()
{

this.addEventListener (MouseEvent.CLICK, detectCollision);
on click of the mouse, see if the POI (point of impact) is above the target
function detectCollision()
{
If (target.hitTestObject (poi))
{
removeChild (target);
remove the target, say kongregate as a target has been hit
Kongregate.stats.Submit("TargetHit",1);
There is no target on stage
var targetAlive = 0;
}
}


This is the code that surround it.
Thanks for the help

If "poi" is really the name of object instance, you must use:

target.hitTestObject (getChildByName ("poi"))

also his idea perhaps not good to use 'target' or 'Target' as a class and instances, since it is a keyword in Actionscript

Tags: Adobe Animate

Similar Questions

  • load property undefined html file error

    in the following code take 4 errors on 2 lines "BOLD"

    Mdapp, layer "inputpage", image1, line 25 1046: Type was not found or is not a constant of compilation: file.

    Mdapp, layer "inputpage", image1, line 26 1046: Type was not found or is not a constant of compilation: file.

    Mdapp, layer "inputpage", image1, line 25 1120: access of undefined property file.

    Mdapp, layer "inputpage", image1, line 26 1120: access of undefined property file.

    Copy the html outside of the application directory

    var templateFile:File = File.applicationDirectory.resolvePath ('adview.html');
    var workingFile:File = File.createTempFile ();

    templateFile.copyTo (workingFile, true);

    Try

    {

    webView.loadURL (workingFile.url);

    where is my fault?

    a loot once again, thank you

    So to summarize, this site

    http://www.Webkitchen.be/2011/05/17/displaying-ads-in-your-mobile-air-application/

    haves of the method that we can use to include adMob in actionscript in the applications that are built into Adobe flash cs and AIR.

    only must include the adview.htnl in the folder of the project and also to include in the draft "in the file-> settings of publication...". "read above

    I try in test mode and I'll try in test mode not that I hope to see the ads...

  • textLayout open source code debug property undefined in flash cs4

    Hi all

    I have downloaded the open source svn 'textLayout framework' and files src folder defined as class path in flash cs4

    When I am trying to publish a player example gives me this error:

    1120: access of undefined property debug.

    CONFIG::Debug {Assert (normalizeStart < = textLength, "damage incorrect length") ;}}

    you have an idea?

    Thank you.

    The workflow being considered is to use a TextLayout.swc compiled in Flash Pro. When we compile the EFA, we give the compiler of the configuration information to determine if we are compiling debug or release CFC. I don't know if this can be done in Flash Pro, so I recommend that you only set the CFC on your way, not the complete source.

  • Strange property undefined object

    I created a clip and exported if ACE, naming the class "Tank." The clip has a couple of labels of image with a few photos inside on each label.

    The SWF file opens, it gets added dynamically to the scene as follows:

    var charMC:MovieClip = new Char();
    addChild (charMC);
    charMC.x = 164;
    charMC.y = 624;

    It works fine without error.

    However, further down I have a function that will call this clip and move it into a different image. As follows:

    function someFunction (): void

    {

    a few things

    charMC.gotoAndPlay ("start");

    }

    This does not work, and I get the error "Property not set of charMC access."

    Note This function has not yet been called yet, I get the error when compile the swf file. It makes no sense to me. What I am doing wrong? It seems that the variable/object is in scope, as it has already been set and even added to the scene.

    Where are you declaring and adding the clip?

    If var charMC:MovieClip = new Char();

    is inside a function, then it is not available everywhere, but inside this function.

  • 3rd party plugins all undefined

    I can't get any 3rd party plugin working in my application. I use the generator phonegap online on build.phonegap.com. When I debug the application on an android with gapdebug phone, I get messages like:

    «Cannot read property undefined barcodeScanner.»

    everything else seems to work very well outside but only when a 3rd party plugin is called, he says its not defined... I have tried everything, but I can't seem to find what the problem is.

    My config file:

    <? XML version = "1.0" encoding = "UTF-8"? >

    " < widget xmlns =" http://www.w3.org/ns/widgets "xmlns:gap =" " http://PhoneGap.com/ns/1.0 " "id = "com.test.testapp" version = "1.0.0" xmlns:android = " http://schemas.Android.com/APK/RES/Android "> "

    < name > test < / name >

    < description > test < / description >

    " < author href = ' http://test.com "email =" " [email protected] ' > test < / author > .

    < = "permissions" option name value = "none" / >

    < name of option = "orientation" value = "default" / >

    < name of option = "target device" value = "universal" / >

    < name of option = "full screen" value = "false" / >

    < name of option = "webviewbounce" value = "true" / >

    < name of option = "rentals-icon" value = "true" / >

    < = "stay webview" option name value = "false" / >

    < name of option = value 'ios-statusbarstyle"="Black opaque"/ >

    < name of option = "detect types of data" value = "true" / >

    < = 'exit suspend' option name value = "false" / >

    < option value = "show-splash-screen-spinner" name = "true" / >

    < option value = "auto-hide-splash-screen" name = "true" / >

    < name of option = "disable-cursor" value = "false" / >

    < name of option = "android-minSdkVersion" value = "14" / >

    < = "android-installLocation' value = 'auto' option name / >

    < name of option = value "android-build-tool" = "gradle" / >

    < gap: config-platform leader = parent "android" = "/ manifest" >

    < application android: debuggable = "true" / >

    < / gap: config-file >

    < name = "" org.apache.cordova.camera gap: plugin ' spec = "0.3.6" source = "CDP" / > "

    < name="org.apache.cordova.media-capture"/ gap: plugin >

    < name="org.apache.cordova.console"/ gap: plugin >

    < name="org.apache.cordova.contacts"/ gap: plugin >

    < name="org.apache.cordova.device"/ gap: plugin >

    < name="org.apache.cordova.dialogs"/ gap: plugin >

    < name="org.apache.cordova.file"/ gap: plugin >

    < name="org.apache.cordova.file-transfer"/ gap: plugin >

    < name="org.apache.cordova.geolocation"/ gap: plugin >

    < name="org.apache.cordova.inappbrowser"/ gap: plugin >

    < name="org.apache.cordova.media"/ gap: plugin >

    < name="org.apache.cordova.network-information"/ gap: plugin >

    < name="org.apache.cordova.splashscreen"/ gap: plugin >

    < name="org.apache.cordova.vibration"/ gap: plugin >

    < plugin name = "cordova-plugin-imagepicker" source = "MNP" / >

    < name of the plugin = "phonegap-plugin-barcodescanner" / >

    < src="res/icon/ios/icon-57-2x.png"/ icon >

    "< src="res/icon/ios/icon-57-2x.png icon "gap: platform = gap: qualifier 'android' ="ldpi"/ >

    "< src="res/icon/ios/icon-57-2x.png icon "gap: platform = gap: qualifier"android"="mdpi"/ >

    "< src="res/icon/ios/icon-57-2x.png icon "gap: platform = gap: qualifier 'android' ="hdpi"/ >

    "< src="res/icon/ios/icon-57-2x.png icon "gap: platform = gap: qualifier 'android' ="xhdpi"/ >

    "< src="res/icon/ios/icon-57-2x.png icon "gap: platform = gap: qualifier 'android' ="xxhdpi"/ >

    "< src="res/icon/ios/icon-57-2x.png icon "gap: platform ="blackberry"/ >

    "< src="res/icon/ios/icon-57-2x.png icon "gap: platform ="blackberry"gap: state ="high"/ >

    "< src="res/icon/ios/icon-57.png icon "gap: platform ="ios"width ="57"height ="57"/ >

    "< icon src="res/icon/ios/icon-72.png "gap: platform ="ios"width ="72"height ="72"/ >

    "< src="res/icon/ios/icon-57-2x.png icon "gap: platform ="ios"width ="114"height ="114"/ >

    "< src="res/icon/ios/icon-72-2x.png icon "gap: platform ="ios"width ="144"height ="144"/ >

    "< src="res/icon/ios/icon-57-2x.png icon "gap: platform ="webos"/ >

    "< src="res/icon/ios/icon-57-2x.png icon "gap: platform ="winphone"/ >

    "< src="res/icon/ios/icon-57-2x.png icon "gap: Platform = 'winphone" gap: role = "background" / >

    < access origin = "*" / >

    < plugin name = "cordova-plugin-whitelist" source = "MNP" / >

    " < allow intention href = ' http://*/* "/>

    " < allow intention href = ' https://*/* "/>

    < allow intention href = "Tel: *" / >

    < allow intention href = "sms: *" / >

    < allow intention href = "mailto:*" / >

    < allow intention href = "geo: *" / >

    < platform name = "android" >

    < allow intention href = "market: *" / >

    < / platform >

    < platform name = "ios" >

    < allow intention href = "itms: *" / >

    < allow intention href = "itms-apps: *" / >

    < / platform >

    < / widget >

    extract the file index.html:

    < script type = "text/javascript" src = "cordova.js" > < / script >
    < script type = "text/javascript" src = "barcodescanner.js" > < / script >
    < script type = "text/javascript" src = "imagepicker.js" > < / script >

    < script type = "text/javascript" src = "js/index.js" > < / script >

    < script type = "text/javascript" >
    App.Initialize ();
    < /script >
    < / body >

    < / html >

    I call the 3rd plugins part using functions that are called onclick of a button in the application:

    function barcodeScan() {}

    I tried with cordova.plugins, window.plugins, window.plugin, etc. All the same.

    () cordova.plugin.barcodeScanner.scan

    {function (result)

    Console.log ("We got a barcode\n" +)

    "Result:" + result.text + "\n" + ".

    "Format:" + result.format + "\n" + ".

    ("Canceled:" + result.cancelled);

    },

    function (error) {}

    Console.log ("scan failed:" + error);

    }

    );

    }

    function getMultiplePhotos() {}

    {cordova.plugins.imagePicker.getPictures (function (results)}

    for (var i = 0; i < results.length; i ++) {}

    Console.log ("URI of the Image:" + results [i]);

    }

    }, {function (error)}

    Console.log ("Error:" + error);

    },{

    maximumImagesCount: 10.

    Width: 1600

    });

    }

    I think I found the problem after 2 weeks of pulling on my hair. For anyone that has this problem, I hope that this will save you the aggravation and time. Using the phonegap constructor, I also activated moisture that allows the application to pull in updates and "automatic update" without having to reinstall the file apk or ipa. I completely removed the app and reinstalled manually without depending on hydration and resolved all the issues.

    I think there is a problem with moisture by adding support for correctly plugin files and adding in libraries, and it was causing unnecessary problems.

  • Try to use getJSON with function onClick but get eception TypeError

    Eception TypeError: cannot read property ' $"undefined


    Hi, I am using the getJSON function when a button is clicked. However, I get the above error. However if I use the code under compositionReady, everything works fine.


    But I want my app to work so that, when I click the button, the function gets information about the json file and displays information dynamically. What is the right solution to implement this function. I think I can use this function inside the compositionReady function, just hide the information and display when the user clicks the button. But is there another way or approach I can take?


    $.getJSON ("content. JSON")

    (.the)

    {function (Data)}

    Console.log ("incoming data:", data);

    $(données, fonction (index, item) {} .each)

    var l = sym.createChildSymbol ('template', 'content');

    l. $("item") (item.item) .html.

    l. $("description") .html (item.description);

    l.Play (index *-500);

    });

    });

    Looking at your files.

    If you replace this line: var s = sym.createChildSymbol ('template', 'content');

    by this line: var s = sym.createChildSymbol ('template', sym.getParentSymbol (). $("content"));
    Your JSON file is returned but...

  • Unable to access MovieClips and functions in a loaded SWF

    Hello world

    I'm just trying access anything whatsoever within the loaded SWF and all I get is 'null '.

    I have the code in the SWF parent who must tell the SWF movieclip child what to do, but nothing works. It's a piee of cake into AS2, and I can't seem to get anything of crossover in AS3.

    Here is my code:

    import com.greensock.TweenMax;
    import flash.display.MovieClip;
    
    var myLoader:Loader = new Loader();
    var url:URLRequest = new URLRequest("SWCS_S3_500x250_exp_panel_2.swf"); // in this case both SWFs are in the same folder 
    myLoader.load(url);  // load the SWF file
    panel2.addChild(myLoader);   // add that instance to the display list, adding it to the Stage at 0,0
      
    panel2 = myLoader.content as MovieClip;
    
    photo_about.alpha = 0;
    photo_downloads.alpha = 0;
    
    //panel2.content_about.alpha = 0;
    //panel2.content_downloads.alpha = 0;
    
    function closeSection():void
    {
              panel2.controlsMC.forcePause();
    
              TweenMax.to(photo_about, .5, {alpha:0});
              TweenMax.to(photo_downloads, .5, {alpha:0});
              TweenMax.to(photo_home, .5, {alpha:0});
      
              TweenMax.to(panel2.content_about, .5, {alpha:0});
              TweenMax.to(panel2.content_downloads, .5, {alpha:0});
      
              TweenMax.to(panel2.controlsMC, .5, {autoAlpha:0});
              TweenMax.to(panel2.content_home, .5, {alpha:0});
    }
    
    

    Panel2 traces null and all clips loaded in draw property undefined errors.

    Can someone please tell me what I'm doing wrong? I would be happy to see what Miss me and feel like this should be a piece of cake.

    Thanks for any help!

    You do not add the content of the scene to 0.0, you add it to panel2 to 0,0.  Then you take panel2 and assign to something that probably does not exist at the time wherever you set it.  You must wait until the loader load before trying to do something with its content, otherwise it has no content (null).  Similarly, you can not control anything in the loaded swf file, until it is fully charged.  So to assign an event listener for the property contentLoaderInfo the loader to determine when loading is complete, and have the event handler works deal from interacting with it.

    var myLoader:Loader = new Loader();

    var url: URLRequest = new URLRequest ("SWCS_S3_500x250_exp_panel_2.swf");

    myLoader.contentLoaderInfo.addEventListener (Event.COMPLETE, processLoadedSWF);

    myLoader.load (url);

    function processLoadedSWF(evt:Event):void {}

    deal with the swf loaded here

    but you do not want to be assigned to the panel2 object that contains the charger

    }

    With regard to the control of anything anyone inside of the swf you are loading, is an AS1/2 or an AS3 swf?

  • problem by returning the value of getChildByName

    Hello world
    I was faced with a big problem. I work in AS3 in which I wrote a file in which I appointed as cell.as (which extends from the cell as MovieClip) and I stated a user set a Boolean variable called startup: Boolean; and I wrote another as a file in which I referred this cell.as as newCell: new cell() and do a 5 x 5 grid. the problem is that whenever I traced the value, simply creating a new instance, say txt.text = (newCell.startUp) m:System.NET.SocketAddress.ToString (); (txt being textField), I get the value (true or false) according to my setting but if I when used the code as follows:
    for (i = 1; i < = 5; i ++) {}
    for (j = 1; j < = 5; j ++) {}
    var newCell:cell = new cell(20,20,"newCell"+i+j);
    newCell.name = "newCell" + i + i;
    this.addChild (newCell);
    If (I == 3 & & j == 2) {}
    txt. Text = ((newCell.parent.getChildByName ("newCell" + i + j)) .startUp). ToString();
    }
    }
    }


    I got an error like: the use of the property undefined, start.
    Why?

    Is the return value of getChildByName () does not support any user defined properties (variables).


    Any comments will be useful.
    Kind regards
    Alexson

    getChildByName() returns a DisplayObject, who does not start field. You need to cast the object to the to use as a cell. for example:

    var child: Object = newCell.parent.getChildByName("newCell"+i+j);
    MyCell var: cell = cell (child); Cast
    txt. Text = mycell.startUp.toString ();

  • Confirm the dialogue?

    As a beginner in flex with a fairly good knowledge of Javascript, I was thrilled to find available Alert.show () function to replace the function alert(), I often used in Javascript. Who did... was wondering y at - it a corresponding function for the confirm() function as well? I tried Confirm.show (), but with no luck, as who stands as a property undefined.

    I was hoping there is a simple way to activate the modal dialog boxes for confirmation, I wouldn't have to build an entire component just for that.

    Thank you
    Josh

    Well, it's a parent just a solution for this:

    Make a button with calls to a function when you click on:

    Use the following implementation of eventhandler:


    Import mx.controls.Alert;
    Import mx.events.CloseEvent;

    The event handler function uses a static method to display
    a window pop up with the title, message, buttons requested.
    private void clickHandler(event:Event):void {}
    Alert.Show ("Do you want to save your changes?", "Save Changes", 3, this, alertClickHandler);
    }

    Event handler function to display the selected Alert button.
    private void alertClickHandler(event:CloseEvent):void {}
    If (event.detail is Alert.YES)
    Status.Text = "You answered Yes;"
    on the other
    Status.Text = "You said no";
    }

    ]]>

  • ERROR: Adding an event listener to a button in the main scenario

    I'm trying to get a simple script to work temporarily to show features. This file is a menu.swf file that loads below content.swf.

    There are 4 buttons on the main timeline and a stop at frame 40. On the same layer that my button is and frame 40, I have this code under actions. dineContent is the instance name of the button that I am referencing.

    However, I get access error 1120 property undefined.

    I know that I can add an event listener to an instance name. I have to create a film about all these buttons and then reference the instances of button inside the movie?

    I started playing with a bit more and found the solution.

    SOLUTION:
    in the property inspector to my instance of dineBtn named "dineContent", there is a contextual list under the "instance of: _" txt where you can choose between the track as button or Menu item.

    You must use the track as Menu item. the default value is button.

  • 1120: access of undefined property

    Hi, I need a solution to my script for school work.

    This is my code:

    Stop();

    var Keo: Boolean = false;

    var kiri:Boolean = false;

    var jumlah:int = 0;

    var n = 0;

    var t = 3;

    Kalah.Visible = false;

    mulai.addEventListener (MouseEvent.CLICK, mulaimain);

    function mulaimain(event:MouseEvent):void

    {

    Kalah.Visible = false;

    Mulai.Visible = false;

    Home.Visible = false;

    n = 0; score. Text = string(n);

    t = 3; Lives.Text = String (t);

    stage.addEventListener (KeyboardEvent.KEY_DOWN, tekantombol);

    stage.addEventListener (KeyboardEvent.KEY_UP, lepastombol);

    cacto.addEventListener (Event.ENTER_FRAME, jalan);

    taco.addEventListener (Event.ENTER_FRAME, set);

    heart.addEventListener (Event.ENTER_FRAME, jatuhhati);

    function tekantombol (event: KeyboardEvent): void

    {

    switch (event.keyCode)

    {

    -case Keyboard.RIGHT: {kekchose = true; break ;}}

    -case Keyboard.LEFT: {kiri = true; break ;}}

    }

    }

    function lepastombol (event: KeyboardEvent): void

    {

    cacto.gotoAndPlay (1);

    switch (event.keyCode)

    {

    -case Keyboard.RIGHT: {kekchose = false; jumlah = 0; break ;}}

    -case Keyboard.LEFT: {kiri = false; jumlah = 0; break ;}}

    }

    }

    jalan function (event: Event): void

    {

    Cacto.x += jumlah;

    If (kanan) {cacto.gotoAndStop (3); jumlah = 11 ;}}

    If (kiri) {cacto.gotoAndStop (2); jumlah = - 11 ;}}

    If (cacto.x > = 997) {cacto.x = - 10 ;}

    If (cacto.x < =-37) {cacto.x = 977 ;}

    }

    function jatuh(event:Event):void

    {

    Taco.y += 7;

    If (taco.y > = 390)

    {

    t = t-1; Lives.Text = String (t);

    Taco.y =-2;

    Taco.x = Math.Floor (Math.Random () * 800);

    }

    If (Taco.hitTestObject (Cacto))

    {

    n = n + 1; score. Text = string(n);

    Taco.y =-2;

    Taco.x = Math.Floor (Math.Random () * 800);

    }

    if(t==0)

    {

    cacto.removeEventListener (Event.ENTER_FRAME, jalan);

    taco.removeEventListener (Event.ENTER_FRAME, set);

    Kalah.Visible = true;

    Mulai.Visible = true;

    }

    function jatuhhati(event:Event):void

    {

    Heart.y += 12;

    If (heart.y > = 390)

    {

    Heart.y =-30;

    Heart.x = Math.Floor (Math.Random () * 800);

    }

    If (Heart.hitTestObject (Cacto))

    {

    t = t + 1; Lives.Text = String (t);

    Heart.y =-30;

    Heart.x = Math.Floor (Math.Random () * 800);

    }

    }

    }

    }

    Scene 1, Layer 'Actions', frame 1, line 261120: access of undefined property jatuhhati.

    and this output:

    ReferenceError: Error #1065: Variable TCMText is not defined.

    Can someone help me?

    For Error 1120, you seem to have nested in another function jatuhhati function.  The compiler cannot see because of that.  Never recommended to nest the functions called within other functions.  Get what it out on its own so that you can see when the assignment of the listener that uses it gets compiled.

    With regard to the 1065 error will I can't see any of this object named in your code.  This usually makes me conclude that there is a component any you use which has such a textfield.

    One thing you should always do when you start getting errors is to go to your publication of Flash settings and select the option to enable debugging.  This can help in pointing to more specific information in the error messages you get, such as line numbers.

  • Windows Media Player Script ERREURUne error has occurred on this page of script line: 303 tank: 25 error: the value of the property 'btnfinish_onclick' is null or undefined, not a function of object Code: 0

    Where to find information on the album in Media Player, I get the following message appears when I click on the button "Finish":

    An error has occurred on this page of script
    Online: 303
    Tank: 25
    Error: the value of the property 'btnfinish_onclick' is null or undefined, not a function object
    Code: 0
    URL: HTTP://FAI.MUSIC.METASERVICES.MICROSOFT.COM/FAI/ALBUMMATCH.ASPX?LOCALE=409&GEOID=F4&VERSION=11.0.6002.18311&USERLOCALE=409
    Do you want to continue?
    By clicking 'Yes' or 'No' doesn't produce any action. Does 'Cancel' which is there for that.
    This feature works flawlessly for months and now I can't download the album or graphics information.
    Help, please. Thank you
    original title: Windows Media Player Script error

    I solved this on my machine after a few game.

    When you arrive at the last stage of the search for album information, before you click on finish, click the small globe in the upper left corner of the dialog box.  This refreshes the connection to the server.  Click on finish, then it started working again.

    Refresh a couple of times before that it worked but so far 2 of 2 machines working again on my other maching.

    Hope this helps!

    Thank you thank you. Sometimes, it takes "Refresh" several times but finally the player "seems" to calm down.

  • Problem with the context menu: eception typeError: cannot read property CONTEXT_IMAGE undefined

    Hi, I wanted to try the following context menu with the javaScript function:

    function addMyItem() {
            var myItem = { actionId: 'Delete', label: 'Delete', icon: 'delete.png' },
                contexts = [blackberry.ui.contextmenu.CONTEXT_IMAGE, blackberry.ui.contextmenu.CONTEXT_INPUT];
            blackberry.ui.contextmenu.addItem(contexts, myItem, function () { console.log('hi') });
        }
    

    I have this function of reference on the API [1]

    When I try to run this function, I get the error:

    Eception typeError: cannot read property CONTEXT_IMAGE undefined

     


    What's not here?

    EDIT: I have the function ID in my config

    
    

    [1] https://developer.blackberry.com/html5/apis/blackberry.ui.contextmenu.html

    I have a little differently, but have checked that it worked for me during a test.

    var share = {
      actionId: 'share',
      label: 'Share Image',
      icon: '../images/share.png'
    };
    
    var contexts = [blackberry.ui.contextmenu.CONTEXT_IMAGE];
    
    blackberry.ui.contextmenu.addItem(contexts, share, function(){
      alert('Sharing is caring!');
    });
    

    If this does not work, can you let us know what development kit software that you use, and we can test again if necessary?

  • Animate CC HTML5 Timer Error: ' Eception TypeError: cannot set property 'text' undefined '.

    Guys, I'm stuck for the third day and wonder if anyone can give me an idea what I am doing wrong. I am creating a simple timer in mode CC animate HTML5 Canvas. I found a script javascript timer job and I'm trying to fit my needs.

    I keep getting the error "Eception TypeError: cannot set the property 'text' undefined ' in the Console. For some reason I can't update dynamic text with variable of time. I've highlighted the offensive line in my code Action below.


    Here's all the code of the Action that I have in my file:

    -------------------------------------------------

    var time = 0;

    running of var = 0;

    This.btn_startPause.addEventListener ("click", startPause.bind (this));

    This.btn_reset.addEventListener ("click", reset.bind (this));

    function startPause() {}

    If (running == 0) {}

    running = 1;

    Increment();

    this.startPause.text = "Pause";

    } else {}

    running = 0;

    this.startPause.text = "resume";

    }

    }

    function reset() {}

    running = 0;

    time = 0;

    this.startPause.text = "Start";

    this.timeDisplay.text = "00:00";

    }

    function increment() {}

    If (running == 1) {}

    setTimeout (function () {}

    time ++;

    var minutes = Math.floor (time/10/60);

    var s = Math.floor (time/10% 60);

    If (mn < 10) {}

    min = "0" + min;

    }

    If {(dry < 10)

    seconds = '0' + dry;

    }

    Console.log (min + ":" + seconds);

    this.timeDisplay.text = minutes + ":" + seconds;

    Increment();

    (}, 100);

    }

    }

    -------------------------------------------------

    I downloaded all my files online, so you can see the error by yourself: HTML file; FLA file; and the original file working I am using.


    Can someone point me in the right direction? (I know, it's somewhere in the area of RTFM (Read The friendly Manual))

    Thank you!

    As suggested above, the problem is caused by an incorrect reference to 'this' itself.

    'This' store on the main timeline as a different variable and use this variable for other functions instead of 'this', or

    Replace this.timeDisplay.text by exportRoot.timeDisplay.text

  • JQuery: Eception TypeError: cannot read property 'setDefaults"undefined

    Hello

    My page was working fine, until I started to add more and more jquery library.

    Here is the error I get in the developer console:

    appointment_new_validation.js:3 Eception TypeError: cannot read property 'setDefaults"undefined

    The jquery validation plugin is not working now

    I tried to put the library links (in red) in all positions in the header and still get the error message.

    Here is the content of the page:

    <! doctype html >

    < html >

    < head >

    < meta charset = "utf-8" >

    < title > new appointment < /title >

    "< link rel ="icon"href ="... /... ' / images/favicon.ico "type =" image/x-icon"/ >

    " < script src =" https://code.jQuery.com/jQuery-2.1.1.min.js "type =" text/javascript"> < / script > "

    < script >

    function getDealership (val) {}

    $.ajax({)

    type: 'POST',

    URL: "appointment_new_check.php",

    data: 'dealershipgroup_id =' + val;

    success: {function (data)}

    $("#dealership_id").html (data);

    }

    });

    }

    {.changes (function ($(«#dealership_id»))

    Alert ('DOING GARAGE BOX VISIBLE');

    });

    < /script >

    " < script src =" http://AJAX.aspnetcdn.com/AJAX/jQuery/jQuery-2.1.3.min.js "> < / script > .

    " < script src =" http://AJAX.aspnetcdn.com/AJAX/jQuery.validate/1.13.0/jQuery.validate.min.js "> < / script > .

    " < script src =" http://AJAX.aspnetcdn.com/AJAX/jQuery.validate/1.13.0/additional-methods.min.js "> < / script > .

    < script src = "appointment_new_validation.js" > < / script >

    <! - delete notes jQuery - >

    < script type = "text/javascript" >

    $(document) .ready (function () {}

    $(".delete").click (function () {}

    $("#note_modal").show ();

    var note_id = $(this) .attr ('dir');

    $('.note_id').val (note_id);

    Alert (note_id);

    });

    $("#note_modal_button_no").click (function () {}

    $("#note_modal").hide ();

    });

    });

    {$(document) .ready (function ()}

    $(' #note_modal_button_yes') .css ('cursor', 'point') ravishing (function () {}

    var note_id = $('.note_id').val ();

    $.ajax({)

    type: 'POST',

    URL: "note_delete.php",

    data: {}

    note_id: note_id

    }

    {.done (function ())}

    Alert ('record has been deleted");

    Location.Reload ();

    });

    });

    });

    < /script >

    <!--> date picker

    "< link href="/scripts/jquery-ui-1.11.4.custom/jquery-ui.css "rel ="stylesheet"type =" text/css">

    "< script src="/scripts/jquery-ui-1.11.4.custom/external/jquery/jquery.js "> < / script >

    "< script src="/scripts/jquery-ui-1.11.4.custom/jquery-ui.js "> < / script >

    < script >

    {$(function()}

    $(«.datepicker»).datepicker({)

    numberOfMonths: 2.

    showButtonPanel: true,

    dateFormat: "dd-mm-yy".

    });

    });

    < /script >

    <! - time Picker - >

    "< link rel ="stylesheet"href="//cdnjs.cloudflare.com/ajax/libs/timepicker/1.3.5/jquery.timepicker.min.css ">

    < script type = "text/javascript" >

    $(document) .ready (function () {}

    $('.timepicker').timepicker ({}

    timeFormat: "HH: mm"

    interval: 15,.

    minTime: '10'.

    maxTime: '22',

    defaultTime: '7'.

    startTime: 7:00 ',

    Dynamics: false,

    drop-down list: true,

    ScrollBar: true,

    });

    });

    < /script >

    < / head >

    < body >

    < name of the form = "new_appointment" id = "new_appointment" method = "POST" action = "appointment_new_create.php" >

    < div class = "column_2" >

    < div class = "column_section" >

    < div class = "column_section_header" > basic Details </span > < / div >

    <! - Person ID - >

    < div class = "form_field_tag" > customer < / div >

    < div class = "form_field_wrapper" >

    < input name = "personid" type = "text" class = "form_field" readonly value = "[ID: <?]" PHP echo $person_row ["renid"];? >] <? PHP echo $person_row ["title"].' '. $person_row ["FirstName"].' '. $person_row ['name'];? > ">"

    < / div >

    <! - DATE - >

    < div class = "form_field_tag" > appointment Date < / div >

    < div class = "form_field_wrapper" >

    < input type = "text" class = "datepicker form_field" name = 'date' >

    < / div >

    <! - TIME - >

    < div class = "form_field_tag" > appointment time < / div >

    < div class = "form_field_wrapper" >

    < input type = "text" class = 'timepicker form_field' name 'time' = >

    < / div >

    < / div >

    < / div >

    < div class = "column_2" >

    < div class = "column_section" >

    < div class = "column_section_header" > appointment location < / div >

    <!--dealer group-->

    < div class = "form_field_tag" > dealer group < / div >

    < div class = "form_field_wrapper" >

    < select class = "form_field" name = "dealershipgroup" id = "dealershipgroup-list" onChange = "getDealership (this.value); ">

    < option value = "-1" > select dealer group < / option >

    < option value = "-1" > - < / option >

    <? PHP {? >}

    < option value = "<?" PHP echo $dealership_group_row ['id'];? > "> <?" PHP echo $dealership_group_row ['name'];? > < / option >

    <? PHP} while ($dealership_group_row = $dealership_group_query-> fetch_assoc());? >

    < / select >

    < / div >

    <! - dealer - >

    < div class = "form_field_tag" > dealer < / div >

    < div class = "form_field_wrapper" >

    < select class = "form_field" name = 'dealer' id = 'dealership_id' >

    < option value = "-1" > select dealer < / option >

    < / select >

    < / div >

    < / div >

    < / div >

    < div class = "column_1" >

    < div class = "column_section" >

    < div style = "" text-align: center; ">"

    < input type = "submit" name = "submit" class = "form_submit_button" value = "Create appointment" >

    < / div >

    < / div >

    < / div >

    < / make >

    < / div >

    "< script src="//cdnjs.cloudflare.com/ajax/libs/timepicker/1.3.5/jquery.timepicker.min.js "> < / script >

    < / body >

    < / html >

    Any help would be much appreciated!

    You should have 1 single jQuery core library by document.  At the top of your page you referenced jQ 2.1.1 and further down you have a reference 2nd in 2.1.3.  Delete a.

    Best practices: put all your scripts and functions at the bottom of the page.  Your page will load a little faster.

    Nancy O.

Maybe you are looking for