Note that there are some explanatory texts on larger screens.

plurals
  1. POActionscript ReferenceError 1069: Flash is trying to call a function as a property, and I don't know why
    primarykey
    data
    text
    <p>I've written a basic form library to mimic HTML forms in ActionScript, and everything was going well until Flash randomly decided my function call is no longer a function, but a property (or something along those lines.) I have an IFormElement interface, and HiddenElement implements it. When validating an element, FormManager calls clearValidationErrors() on that element, which is a function defined in the interface. When this happens on a HiddenElement, I get the following error:</p> <p>ReferenceError: Error #1069: Property dls.formmanager.form:IFormElement::clearValidationErrors not found on dls.formmanager.form.HiddenElement and there is no default value.</p> <p>The relevant code is copied below:</p> <p><strong>FormManager</strong></p> <pre><code>/** * helper function to check a single element's validity */ public function validateElement(element:IFormElement):Vector.&lt;IValidationError&gt; { Debug.out("Validating element " + element.name + " with value " + element.value + "...", Debug.DETAILS, _debugOptions); var errors:Vector.&lt;IValidationError&gt; = _formValidator.validateElement(element); element.clearValidationErrors(); if (errors.length &gt; 0) { watchElement(element); for each (var error:IValidationError in errors) { element.addValidationError(error); } } return errors; } </code></pre> <p><strong>IFormElement</strong></p> <pre><code>package dls.formmanager.form { import dls.formmanager.validator.errors.IValidationError; import org.osflash.signals.Signal; public interface IFormElement { function get name():String; function get value():*; function get valueChanged():Signal; function get validationRules():Object; function addValidationError(error:IValidationError):void; function removeValidationError(error:IValidationError):void; function clearValidationErrors():void; } } </code></pre> <p><strong>HiddenElement</strong></p> <pre><code>package dls.formmanager.form { import dls.debugger.Debug; import dls.formmanager.form.IFormElement; import dls.formmanager.validator.errors.IValidationError; import org.osflash.signals.Signal; /* * This class is used to represent non-interactable items in forms. */ public class HiddenElement implements IFormElement { ... /** * empty function, hidden element will never respond to removing errors */ public function clearValidationErrors():void { } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload