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 4061232
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:26:28+00:00 2026-05-20T15:26:28+00:00

I know there are a number of posts dealing with this issue. But, I’m

  • 0

I know there are a number of posts dealing with this issue. But, I’m still not understanding it.

I keep getting a “1120: Access of undefined property CSSloader.” in the following script:

package as3.comp{

import flash.events.Event;
import flash.events.ProgressEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.display.Loader;
import flash.display.MovieClip;
import flash.text.StyleSheet;


public class cont extends MovieClip {

    public var contentWidth:Number;
    public var contentHeight:Number;

    private var myXML:XML;
    private var myLoader:URLLoader;

    public function cont():void {
        //Start
    }

    public function start():void {
        myTooltip.start();
        myTooltip.followMouse(false);
        myTooltip.hide();
        myWaiting.start();
        myWaiting.hide();
        myXML = new XML();
        myXML.ignoreComments=true;
        myXML.ignoreWhitespace=true;
        contentWidth=100;
        contentHeight=100;
        contentSpace.width=contentWidth;
        contentSpace.height=contentHeight;
        //myWaiting.hide(); //hide clock
    }

    public function loadMc(contentFile:String):void {

        var pictLdr:Loader = new Loader();
        var pictURL:String=contentFile;
        var pictURLReq:URLRequest=new URLRequest(pictURL);
        pictLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, imgLoadedF);
        pictLdr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, preloader);
        pictLdr.load(pictURLReq);
        contentLoadMC.addChild(pictLdr);

    }

    private function imgLoadedF(event:Event):void {
        myTooltip.hide();
        MovieClip(parent.parent).addContentMovie(this);
        MovieClip(parent.parent).refresh();
    }

    private function preloader(event:ProgressEvent):void {
        var pcent:Number=event.bytesLoaded/event.bytesTotal*100;
        myTooltip.show(""+int(pcent));
    }

    public function loadCSS(event:Event):void {
        var CSSloader:URLLoader = new URLLoader();
        var req_css:URLRequest = new URLRequest("example.css");
        CSSloader.load(req_css);
        CSSloader.addEventListener("complete", loadXML);
    }

    public function loadXML(contentFile:String) {
        var XML_URL:String=contentFile;
        var myXMLURL:URLRequest=new URLRequest(XML_URL);
        myLoader=new URLLoader(myXMLURL);
        myLoader.addEventListener("complete", xmlLoaded);
    }

    private function xmlLoaded(event:Event):void {
        myXML=XML(myLoader.data);
        myXML.ignoreWhite = true;

        var sheet:StyleSheet = new StyleSheet();
        sheet.parseCSS(CSSloader.data);
        myHtmlText.styleSheet = sheet;


        myHtmlText.htmlText="HERE" + myXML.pageTop;
        myHtmlText.width=contentWidth-10;
        myHtmlText.height=myHtmlText.textHeight+30;
        myHtmlText.x=10;
        myHtmlText.y=10;
        contentSpace.width=contentWidth;
        contentSpace.height=myHtmlText.height+4;
        myWaiting.hide();
        MovieClip(parent.parent).addContentMovie(this);
        MovieClip(parent.parent).refresh();
        myLoader.removeEventListener("complete", xmlLoaded);

    }

    public function loadContent(contentFile:String) {
        if (contentFile.substr(-3)=="xml") {
            myWaiting.show();//show clock
            loadXML(contentFile);
        } else {
            myTooltip.show("0");
            loadMc(contentFile);
        }
    }
}

}
I’ve tried adding the code within loadCSS to both loadXML and xmlLoaded, but get the same error.

Any help would be GREATLY appreciated. Thanks.

  • 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-05-20T15:26:28+00:00Added an answer on May 20, 2026 at 3:26 pm

    You declared CSSloader in the function loadCSS, but you get the error in the function xmlloaded, which is a different scope. If you want CSSloader to be scoped for all functions, you’ll have to declare it as a variable outside these functions – by convention at the top. (Unfortunately you have omitted the context of this code, but I assume this is inside a class?).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I know there have been a number of similar posts, but I think
I know there is a lot of controversy (maybe not controversy, but arguments at
I know there is ongoing work for in this regards but what is the
I know there are a lot of questions on here about this, but most
I know that there have been a number of posts regarding the height:100% declaration
Now i know there are loads of posts on this subject and i have
Well, I know there is a lots of posts about it, but I have
Yes I know there has been similar posts to this however after looking through
I know there are ways to get the number of digits after a decimal
Does anyone know if there is a limit to the number of applications I

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.