Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7740391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:45:59+00:00 2026-06-01T08:45:59+00:00

I have a protected function defined in a script block of a component defined

  • 0

I have a protected function defined in a script block of a component defined in mxml like so:

<s:VGroup xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx" creationComplete="onCreationComplete()">
    <fx:Script>
    <![CDATA[
    protected function onCreationComplete():void {

    }
    ...

Is it possible to override the function in an instance of the component like so:

<gen:CreateObjectFormSubmit id="formSubmit">
     <fx:Script>
     <![CDATA[
          override protected function onCreationComplete():void {
              form=form1;
          }
     ]]>
     </fx:Script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T08:46:00+00:00Added an answer on June 1, 2026 at 8:46 am

    Just be careful with where and how you are declaring your super class. From the syntax provided above, it appears you might be trying to declare a <component> tag in your mxml class, in which if this is the case – the compiler treats this as a separate child object and not an actual extension.

    For one, root level tags cannot declare an id (but components can – and this becomes the Class name), and you would most likely need to explicitly declare all your xml namespaces.

    In order for it to be a true extension, your first <VGroup> Class would need to be named CreateObjectFormSubmit, this becomes the root tag of your extending class. There is one gotcha though, if you extend from an mxml class you cannot declare any additional children (in mxml notation because of layout rules).

    If as you say an instance of your class, then no you wouldn’t be able to override it, since the function scope of the <Script> tag would still reside within the root level. This is also sometimes referred to as the ‘outerDocument’ when declaring <component> tags.

    The above wouldn’t be any different doing it in regular AS like the following:

    class SomethingCool extends UIComponent {
        ...
        public function addButtons():void
        {
             var btn:Button = new Button();
                 btn.id = 'formSubmit';
                 //can't declare an override of Button here
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have something like this: abstract class Parent { protected function foobar($data)
I have an aspx page defined as follows: <html xmlns=http://www.w3.org/1999/xhtml> <head runat=server> <title></title> <script
I have the following code: protected function safePath($path) { $path = (string) $path; $path
I have the following bit of code: protected function onEnterFrame(e:Event):void { var diff:Number; //
I have this reduce function: protected void reduce(Text key, Iterable<SortedMapWritable> values, Context context) throws
Suppose I have a free function called InitFoo . I'd like to protect this
I'd like to be able to have two protected classes in my package. That
I have code as following: Public Class xxxSvcHostFactory Inherits ServiceHostFactory Protected Overrides Function CreateServiceHost(ByVal
I have defined a function called is_logged_in? in a user defined library stored in
I have created a class say A which has some functions defined as protected.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.