Add a border to a flash.display.Loader.

I'm developing an application ActionScript 3 for Blackberry PlayBook.

I am loading an image with flash.display.Loader.

I want to show that image with a black border of 5px.

How can I do?

Put the charger in a Sprite with x, y of 5.5 and then draws on the graphics of the sprite of the border property.

Tags: BlackBerry Developers

Similar Questions

  • necessity of flash.display.loader

    IM currently a library containing flash.display.loader need. I searched in google, but the libraries I've found does not display.loader. Could you give me the link where I can download this? Thank you guys.

    It is part of the 'package' of Adobe standard. You already have Flash professional or Flex SDK... I don't know what you use...

    Just add a line at the beginning of the friend code:

    import flash.display.Loader;
    
  • Property not found on flash.display.Loader charger and there is no default value

    Hi, I want to drag a single image of set of images loaded via xml, but it is showing an error.

    ReferenceError: Error #1069: property not found on flash.display.Loader charger and there is no default value.

    "hand / mouseDownHandler ()" thanks in advance...

    XML

    /////////////////////////////////////

    <? XML version = "1.0" encoding = "utf-8" standalone = "yes"? >

    < GALLERY >

    < IMAGE THUMB = "photo_tb/pic1.jpg" / > "

    < IMAGE THUMB = "photo_tb/pic2.jpg" / > "

    < IMAGE THUMB = "photo_tb/pic3.jpg" / > "

    < IMAGE THUMB = "photo_tb/pic4.jpg" / > "

    < / GALLERY >

    /////////////////////////////////////////////

    package

    {

    import flash.display. *;

    import flash.events. *;

    flash.net import. *;

    import flash.display.Sprite;

    import flash.display.Loader;

    import flash.events.MouseEvent;

    main/public class extends MovieClip

    {

    private var levelXML:XML;

    private var myLoader:URLLoader;

    private var my_images:XMLList;

    private var my_total:Number;

    private var my_thumb_width:Number;

    private var container_mc:MovieClip;

    private var my_mc:MovieClip;

    public void main()

    {

    levelXML = new XML();

    var XML_URL:String = "data / data.xml."

    var myXMLURL:URLRequest = new URLRequest (XML_URL);

    myLoader = new URLLoader (myXMLURL);

    myLoader.addEventListener (Event.COMPLETE, lanceApp);

    }

    private void startApp(e:Event):void

    {

    var myXML:XML = new XML (e.target.data);

    my_images = myXML.IMAGE;

    my_total = my_images.length ();

    createContainer();

    callThumbs()

    for each {(var niveau: XML dans levelXML.level)}

    trace (Level.leveltitle);

    trace (Level.identifyme);

    //}

    }

    private function createContainer (): void

    {

    container_mc = new MovieClip();

    container_mc.x = 50;

    container_mc.y = 50;

    my_mc.x = 100

    my_mc.y = 100

    addChild (container_mc);

    }

    private function callThumbs (): void

    {

    trace (my_total)

    for (var i: Number = 0; i < my_total; i ++)

    {

    'loader_' + i

    my_thumb_width = 100

    var thumb_url = my_images[i].@THUMB;

    var thumb_loader = new Loader();

    thumb_loader. Load (new URLRequest (thumb_url));

    thumb_loader.contentLoaderInfo.addEventListener (Event.COMPLETE, thumbLoaded);

    thumb_loader. Name = i;

    thumb_loader.x = (my_thumb_width * I);

    }

    }

    private void thumbLoaded(e:Event):void

    {

    var my_thumb:Loader = Loader (e.target.loader);

    container_mc. AddChild (my_thumb);

    my_thumb.contentLoaderInfo.removeEventListener (Event.COMPLETE, thumbLoaded);

    Sprite: var loader = Loader (e.target);

    var my_thumb:Loader = Loader (e.target);

    trace (my_thumb)

    my_thumb.addEventListener (MouseEvent.MOUSE_DOWN, mouseDownHandler);

    my_thumb.addEventListener (MouseEvent.MOUSE_UP, mouseUpHandler);

    }

    private void mouseDownHandler(e:MouseEvent):void {}

    var my_thumb:Loader = Loader (e.target.loader);

    container_mc. AddChild (my_thumb);

    e.target.startDrag ();

    }

    private void mouseUpHandler(e:MouseEvent):void {}

    trace ("mouseUpHandler");

    var sprite: Sprite = Sprite (event.target);

    sprite.removeEventListener (MouseEvent.MOUSE_MOVE, OnMouseMoveHandler);

    sprite.stopDrag ();

    }

    private void mouseMoveHandler(event:MouseEvent):void {}

    trace ("mouseMoveHandler");

    event.updateAfterEvent ();

    }

    }

    }

    In your function mouseDownHandler target you 'e.target.loader', however, e.target is a Loader and Chargers have no property loader.

    private void mouseDownHandler(e:MouseEvent):void {}

    var my_thumb:Loader = Loader (e.target.loader);

    Try just "e.target" instead since this should be your code is looking for.

    var my_thumb:Loader = Loader (e.target);

    Although you might find you need to use "e.currentTarget" instead since e.target can point to the content of the loader instead of the charger itself

  • Error #1069: Property not found unloadAndStop on flash.display.Loader

    Hey all,.

    I have inhareted a flex application that was built in (I think) flex 3.x.  I am currently using Flash builder 4 and set the compiler settings to use flex 3.5.  as soon as I have for rund or debug the application, I get the following error:

    ReferenceError: Error #1069: property not found on flash.display.Loader unloadAndStop and there is no default value.

    to MethodInfo - 7)

    service /http://adobe.com/AS3/2006/builtin: apply)

    to SetIntervalTimer / onTimer)

    to::Timer/_timerDispatch() flash.utils

    to::Timer/tick() flash.utils

    I don't know what is the cause, the only thing I can think of at this point is that the app was built with a verson SDK before 3.5 and because I can't choose TI 3.5 throw this error. Can anyone confirm this or give me some advice on this.

    Thanks a ton.

    default project 3.x to assume the Flash Player 9, which did not have

    unloadAndStop on the charger.  Another code that you are running is assuming that player

    10. you want to either demote this code to take the Player 9, or set

    -target-Player = 10 on the compiler options.

  • 1067: constraint implied a value of class type to a type unrelated to flash.display:MovieClip

    Hello, I have a class named geeklog with the code:

    package

    {

    import flash.display.MovieClip;

    import flash.events.MouseEvent;

    import flash.events.Event;

    import flash.display.Loader;

    SerializableAttribute public class extends MovieClip geeklog

    {

    private var _root:MovieClip = new MovieClip();

    public void geeklog (numImages:Number, rt:MovieClip)

    {

    ...

    and I have a second class named MainJogo, that the appeal of geeklog:

    package

    {

    import flash.events. *;

    import flash.display.Loader;

    import flash.display.MovieClip;

    import flash.display.Stage;

    import of geeklog;

    public class MainJogo

    {

    #error

    private var imgMc:LoadImages = new LoadImages(2,this);

    #error

    public void MainJogo(url:String)

    {

    ...

    If I just post the MainJogo class code in the Assembly, there is no problem, but if I run the app like this with 2 classes I get the error message

    1067: constraint implied a value of class type to a type unrelated to flash.display:MovieClip.

    Can someone help me please?

    Thank you

    MainJogo is not a Movieclip, so "this" (in MainJogo) is not a MovieClip.

    If MainJogo extends the movieclip class, you will probably still 'this' thrown like a MovieClip.

    You can use:

    package

    {

    import flash.events. *;

    import flash.display.Loader;

    import flash.display.MovieClip;

    import flash.display.Stage;

    import of geeklog;

    SerializableAttribute public class MainJogo extends MovieClip

    {

    private var imgMc:LoadImages = new Loadimages() (2, MovieClip (this));

    public void MainJogo(url:String)

    {

  • #2025 error: The supplied DisplayObject must be a child of the caller.      to flash. display::DisplayObj

    Hi guys I am pullying my hair since 2 days

    Plese help me

    Is my document class

    package

    {

    import flash.display.MovieClip;

    import flash.display.StageScaleMode;

    import flash.display.StageAlign;

    /public class Main extends MovieClip

    {

    scrollerBg:ScrollerBg private var;

    public void Main()

    {

    stage.scaleMode = StageScaleMode.NO_SCALE;

    stage.align = StageAlign.TOP;

    scrollerBg = new ScrollerBg();

    addChild (scrollerBg);

    scrollerBg.x = 39;

    scrollerBg.y = 572;

    }

    }

    }

    My ScrollerBg is connect to this class

    package com.elements

    {

    import flash.display.MovieClip;

    import LeftArrow.

    import RightArrow;

    import flash.display.Sprite;

    import flash.net.URLLoader;

    import flash.events.Event;

    import flash.net.URLRequest;

    import flash.display.Loader;

    import flash.events.ProgressEvent;

    import flash.events.IOErrorEvent;

    import com.elements.PreloaderObject;

    import com.greensock.TweenMax;

    /public class Scrollercontainer extends MovieClip

    {

    leftArrow:LeftArrow private var;

    rightArrow:RightArrow private var;

    scrollerBg:Sprite private var;

    scrollerMask:Sprite private var;

    private var xmlPath:String = "xml/scroller.xml.

    xmlLoader:URLLoader private var;

    private var preloader: PreloaderObject;

    public static var bgImage:Array;

    public static var thumbImage:Array;

    public static var labelArray:Array;

    xmlData:XML private var;

    public void Scrollercontainer()

    {

    addEventListener (Event.ADDED_TO_STAGE, onAddedtoStageHandeler, false, 0, true);

    }

    onAddedtoStageHandeler(evt:Event):void private function

    {

    scrollerBg = new Sprite();

    scrollerBg.graphics.beginFill (0 x 000000, 1);

    scrollerBg.graphics.drawRect (0,0,865,78);

    scrollerBg.graphics.endFill ();

    addChild (scrollerBg);

    scrollerBg.x = 28;

    scrollerBg.y = 13;

    scrollerMask = new Sprite();

    scrollerMask.graphics.beginFill (0 x 000000, 1);

    scrollerMask.graphics.drawRect (0,0,865,78);

    scrollerMask.graphics.endFill ();

    addChild (scrollerMask);

    scrollerMask.x = 28;

    scrollerMask.y = 13;

    scrollerBg.mask = scrollerMask;

    left arrow = new LeftArrow();

    leftArrow.x = 14;

    leftArrow.y = 44;

    leftArrow.buttonMode = true;

    addChild (leftArrow);

    right arrow = new RightArrow();

    rightArrow.x = 901.

    rightArrow.y = 44;

    rightArrow.buttonMode = true;

    addChild (rightArrow);

    lodXMLinit();

    }

    private function lodXMLinit (): void

    {

    bgImage = new Array();

    thumbImage = new Array();

    labelArray = new Array();

    xmlLoader = new URLLoader();

    xmlLoader.addEventListener (Event.COMPLETE, xmlLoaded);

    xmlLoader.load (new URLRequest (xmlPath));

    preloader = new PreloaderObject();

    preloader.buildPreloader ();

    }

    xmlLoaded(evt:Event):void private function

    {

    xmlData = new XML (evt.target.data);

    var xmlList:XMLList = xmlData.slide;

    var point: XML;

    / / trace (xmlList.toXMLString ());

    for each (xmlList)

    {

    bgImage.push (item.slide);

    thumbImage.push (item.thumbImage);

    labelArray.push (item.label);

    }

    / / trace(thumbImage[1]);

    buildThumbScroller();

    }

    private function buildThumbScroller (): void

    {

    for (var i: int = 0; i < thumbImage.length; i ++)

    {

    var thumbBackground:MovieClip = new MovieClip();

    var thumbImgeBackground:Sprite = new Sprite();

    thumbImgeBackground.graphics.beginFill(0xffffff,1);

    thumbImgeBackground.graphics.drawRect (0,0,100,78);

    thumbImgeBackground.graphics.endFill ();

    thumbBackground.addChild (thumbImgeBackground);

    thumbBackground.x (100 + 20) = * i;

    thumbBackground.indexs = i;

    thumbBackground.src = thumbImage [i];

    thumbBackground.buttonMode = true;

    var preloader: PreloaderObject = new PreloaderObject();

    preloader.name = String (i);

    preloader.buildPreloader ();

    var imageContainer:Sprite = new Sprite();

    var thldr:Loader = new Loader();

    thldr.contentLoaderInfo.addEventListener (Event.OPEN, pairs loadStarted);

    thldr.contentLoaderInfo.addEventListener (Event.COMPLETE, imageLoaded);

    thldr.contentLoaderInfo.addEventListener (ProgressEvent.PROGRESS, showProgress);

    thldr.contentLoaderInfo.addEventListener (IOErrorEvent.IO_ERROR, onError);

    thldr.load (new URLRequest (thumbBackground.src));

    imageContainer.addChild (thldr);

    thumbBackground.addChild (imageContainer);

    scrollerBg.addChild (thumbBackground);

    }

    }

    loadStarted(evt:Event):void private function

    {

    trace (this); Traces [object ScrollerBg];

    this.addChild (preloader);

    }

    imageLoaded(evt:Event):void private function

    {

    }

    showProgress(evt:ProgressEvent):void private function

    {

    / / trace (this);

    var percent: Number = (1.0 / evt.bytesTotal) * evt.bytesLoaded;

    / / trace (percent);

    si (p == 1)

    {       

    this.removeChild (preloader); Here's my problem when it draws traces [object ScrollerBg];

    }

    else

    {

    preloader.loadBar.width = stage.stageWidth * per cent;

    }

    }

    onError(evt:IOErrorEvent):void private function

    {

    }

    }

    }

    and my Preloader object class is the following

    package com.elements

    {

    import flash.display.MovieClip;

    import flash.display.Shape;

    /public class PreloaderObject extends MovieClip

    {

    public var loadBar:Shape;

    public void PreloaderObject()

    {

    }

    buildPreloader(color:uint_=_0xffccdd,height:uint_=3):void of the public service

    {

    Gauge = new Shape();

    loadBar.graphics.beginFill(color,1);

    loadBar.graphics.drawRect (0.0,0.0,100,100);

    loadBar.graphics.endFill ();

    loadBar.width = 0.0;

    loadBar.height = height;

    addChild (loadBar);

    }

    }

    }

    Here, I want to show the preloader on each thumbloading process
    When tracing both parent show is the same but preloader does not work please help me
    Thanks in advance

    This is not going to work.

    you have a problem with your logic.  you have a preloader.  you have several objects that you load into a loop for.  the first object will finish loading, preloader is removed and then the next object end of loading.

    1. There is no preloader displaying prices charge when the first object is completed loading

    2. the preloader first shows the load progress of the first object only, not the load course of whatever it is you want to load

    3. the error of you know: preloader seeks to be removed, after it is already deleted.

    If you don't like about 1 and 2 do not resolve your issue, use the code that I suggested in my first post:

    {if (preloader.stage)}

    this.removeChild (preloader);

    }

    If you want to display the load progress of the rest of the loop for loads, you will need to decide what exactly you want to display.

  • No flash games load at all or are displayed.

    I had this problem with Firefox for the last couple months where no flash games load and appear as a blank screen. I tried update Javascript, Shockwave Flash and other things that I thought may be associated with the problem, but not good. I even tried turning off hardware exceleration and protected mode, AND using IE, but nothing helped. I think install Chrome, but I don't want to waste my time trying several solutions. Any help?
    I thought that it might help:

    • Adobe PDF plugin for Firefox and Netscape 10.1.14
    • Deploy Script NPRuntime plugin Library for Java (TM)
    • Next-generation Java plug-in 11.45.2 for Mozilla browsers
    • The plug-in allows you to open and edit files using Microsoft Office applications
    • Authorization plug-ins office for NPAPI browsers
    • Shockwave Flash 18.0 r0
    • Adobe Shockwave for Director Netscape plug-in, version 12.1.8.158
    • 5.1.31211.0
    • NPWLPG
    • Windows Presentation Foundation (WPF) plugin for Mozilla browsers

    Firefox Version 39
    Operating system: Windows Vista

    TheRedWall said

    He started the day, I've updated my security suite

    You should always check the updates in time.
    Many programs can be automatically configured to "Phone Home".

    This threat is useless now! Yay!

    I think you want to say "the problem is solved," Yes?
    Good day and safe surfing.

  • Add a border to my custom skin.

    Hello.

    I'm developing an ActionScript 3.0 for PlayBook application.

    I want to add a black border on my custom skin, but I don't know how.

    It is a piece of my code:

    package
    {
        import flash.display.Sprite;
        import flash.geom.Rectangle;
        import qnx.ui.skins.SkinAssets;
        import qnx.ui.skins.SkinStates;
        import qnx.ui.skins.UISkin;
        public class CustomButtonSkin extends UISkin
        {
            /** @private **/
            protected var upSkin:Sprite;
            /** @private **/
            protected var selectedSkin:Sprite;
            /** @private **/
            protected var disabledSkin:Sprite;
            /** @private **/
            protected var downSkin:Sprite;
            /** @private **/
            protected var gridRect:Rectangle;
            public function CustomButtonSkin()
            {
                super();
            }
    
            override protected function initializeStates():void
            {
                gridRect = new Rectangle(8,8,20,20);
                upSkin = new Sprite();
                upSkin.graphics.beginFill(0xFF6600);
                upSkin.graphics.drawRoundRect(0,0,172,44, 10,10);
                upSkin.graphics.endFill();
                upSkin.scale9Grid = gridRect;
    ...
    

    Hey,.

    just before:

    upSkin.graphics.beginFill(0xFF6600);
    

    put this:

    ....
    
    upSkin.graphics.lineStyle(1,0);
    upSkin.graphics.beginFill(0xFF6600);
    
    ....
    

    hope that helps. Good luck!

  • Communication between two SWFs (FLASH movie load)

    Hi all

    My first flash animation gives users a choice to display several other movies (SWF) "external" flash by loading on top of my first film.  When a user chooses an external movie, the reading head is "parked" in an empty frame in my 'initial film' and code in this framework launches the external SWF file loading.  The document of the external SWF file size is the same as the main movie then she covers it completely. The code is simple.

     //Create a new Loader instance
    var loader:Loader = new Loader();
    // Load the SWF file into the instance
    loader.load(new URLRequest("Rule1.swf"));
    // Add the instance to the main timeline's display list
    addChild(loader);
    


    My external SWF plays until it ends.  If at this point, I can go back to my first film and move the playhead I think that my problem can be solved.  This is where my problem begins.  I don't know how deparcage the playhead in my "first film" once the external SWF is complete.  How can I get the playhead parked in a specific picture in my first film for that opportunity can choose another external movie? I'd appreciate any help I can get.

    Thank you

    NCP

    You must assign an event listener for the charger so that it can perform the function loadCompleteHandler.  You must wait for the swf file to complete loading before assigning the listener - to what I show below it waiting for the INIT event, which occurs once the file loaded AND is ready for use.  So the next line should be added to your code to load before calling the function load for the charger.

    Create a new instance of charger
    var loader: Loader = new Loader();

    Assign a listener to the INIT event

    loader.contentLoaderInfo.addEventListener (Event.INIT, loaderCompleteHandler);

    Load the SWF file in the instance
    Loader.Load (new URLRequest ("Rule1.swf"));
    Add the instance to the display list of the main timeline
    addChild (loader);

  • 1119: access of nativeWindow property possibly not defined through a reference with static type flash.display:Stage.

    I tried this code:

    http://help.Adobe.com/en_US/AS3/dev/WS5b3ccc516d4fbf351e63e3d118666ade46-7e08.html

    but it displays error: 1119: access of nativeWindow property possibly not defined through a reference with static type flash.display:Stage.

    package

    {

    import flash.display.Sprite;

    import flash.events.MouseEvent;

    import flash.text.TextField;

    SerializableAttribute public class MinimizeExample extends Sprite

    {

    public void MinimizeExample (): void

    {

    var minTextBtn:TextField = new TextField();

    minTextBtn.x = 10;

    minTextBtn.y = 10;

    minTextBtn.text = "minimize";

    minTextBtn.background = true;

    minTextBtn.border = true;

    minTextBtn.selectable = false;

    addChild (minTextBtn);

    minTextBtn.addEventListener (MouseEvent.CLICK, onMinimize);

    var maxTextBtn:TextField = new TextField();

    maxTextBtn.x = 120;

    maxTextBtn.y = 10;

    maxTextBtn.text = "zoom";

    maxTextBtn.background = true;

    maxTextBtn.border = true;

    maxTextBtn.selectable = false;

    addChild (maxTextBtn);

    maxTextBtn.addEventListener (MouseEvent.CLICK, onMaximize);

    var restoreTextBtn:TextField = new TextField();

    restoreTextBtn.x = 230;

    restoreTextBtn.y = 10;

    restoreTextBtn.text = "restore";

    restoreTextBtn.background = true;

    restoreTextBtn.border = true;

    restoreTextBtn.selectable = false;

    addChild (restoreTextBtn);

    restoreTextBtn.addEventListener (MouseEvent.CLICK, onRestore);

    var closeTextBtn:TextField = new TextField();

    closeTextBtn.x = 340;

    closeTextBtn.y = 10;

    closeTextBtn.text = 'close this window ';

    closeTextBtn.background = true;

    closeTextBtn.border = true;

    closeTextBtn.selectable = false;

    addChild (closeTextBtn);

    closeTextBtn.addEventListener (MouseEvent.CLICK, onCloseWindow);

    }

    function onMinimize(event:MouseEvent):void

    {

    this.stage.nativeWindow.minimize ();

    }

    function onMaximize(event:MouseEvent):void

    {

    this.stage.nativeWindow.maximize ();

    }

    function onRestore(event:MouseEvent):void

    {

    this.stage.nativeWindow.restore ();

    }

    function onCloseWindow(event:MouseEvent):void

    {

    this.stage.nativeWindow.close ();

    }

    }

    }

    You can not force-close a browser with the exception of a window with javascript window.

  • ReferenceError: Error #1069: property not found on flash.display.Stage length

    Hi all

    I have 3 input textfield. Each textfield has a string pre-loaded in it. When the user presses Tab, the focus must be cycled around textfield 1-3. Now, I'm trying to set the index of the caret to the last letter of the TextField. What is the problem with the code?

    Code:

    public function myTabKeyDown(event:KeyboardEvent):void
              {
                 if (event.keyCode == Keyboard.TAB)
                 {
                        //set caret selection
                        event.currentTarget.setSelection(event.currentTarget.length, event.currentTarget.length);
                 }
              }
    

    Error:

    ReferenceError: Error #1069: the property not found on flash.display.Stage length and there is no default value.

    Thank you

    Zainuu

    If your textfields are named (you went for each text field properties and gave it a unique name) you can use the Manager of Focus see IFF it has focus to set the selection to the end.

    http://help.Adobe.com/en_US/FlashPlatform/reference/ActionScript/3/FL/managers/FocusManage r.html? filter_flash = cs5 & filter_flashplayer = 10.2 & filter_air = 2.6

  • Flash will load audio but not video... and then crashes...

    Flash will load the audio from a video, but the video display will be green.  The player then crashes.  Initially, this was just my videos from YouTube.com, but now I have problems with Windows Media Player Classic (and sometimes with Windows Media Player).  I tried uninstalling and reinstalling several times.  Flash is not displayed in my programs, but can I uninstall in Control Panel.

    I have Windows 7 and 64-bit.

    I use the 10.3.181.34 version.  According to http://www.adobe.com/software/flash/about/ I have a flash installed successfully.  Yes, I see the image.

    These are the files in my SysWOW64 > C:\windows\system32\macromed > Flash

    Flash10m.ocx

    FlashInstall.log

    flashplayer. XPT

    FlashUtil10u_Plugin.exe

    install.log

    Npswf32.dll

    I use Firefox 5.  Shockwave Flash 10.3.181.34 is enabled.

    I have no idea what to do. Help.

    As soon as I read 'green' in any position, the first thing that comes to mind is to disable hardware acceleration.  Right-click on the Flash Player test page and select settings.  Then on the display panel uncheck "enable hardware acceleration".

  • Error 5000: The class 'Particle' must subclass 'flash.display.MovieClip' because it is linked to a symbol in the library of this type.

    Running Flash CS3, I looked at the tutorial from lynda.com on strengthening the systems of particles in ActionScript 3.0 to create a few sparks shooting in an animation.  I'm stuck to what I think is a point really basic, but I can't seem to cross it.  Basically, all I'm doing at this point is to create a class called particle (that I'll learn to do things that the particles to make a little later) bind it to a MovieClip on the stage in my .fla file and use the function to update the particle to move it around the stage in a way defined in the instance (so I can later give properties of different movement to) each as an instance generated the MC).  I know there are easier ways to accomplish my basic task without loading an external module, but this seems to makes it so I have to hurt something very simple, that I can't see so I thought I'd post the code here and see what I'm missing.

    I start with a file called Particle.as in the same folder as my file Test.fla Spark.

    In Particle.as, I have the following code:

    package
    {
    import flash.display. *;

    Particles/public class extends MovieClip
    {
    public xVelocity:Number;
    public yVelocity:Number;

    public void Particle()
    {
    xVelocity = 0;
    yVelocity = 0;
    }

    public void update (): void
    {
    This.x += xVelocity;
    This.y += yVelocity.

    }
    }
    }

    So, I declare that all the particles are built with no movement, but if they are explicitly granted an x or y velocity, they will pass by there a lot when updating the instance function is called in the timeline panel.

    Then in my file Test.fla spark, I have a small shape in a MovieClip called Spark.  In the properties of binding of spark, I chose to export for ActionScript and export in first frame.  The class is called Spark and the Base class is the particle.  For testing purposes, I dropped an instance on the stage and called spark.  Then in the layer actions in the first image (the timeline is just the spark layer and the layer actions, a long frame each with no "stop();" so it should run forever), I have included the following code:

    spark.xVelocity = 5;
    spark.yVelocity = - 1;

    function updateSpark(event:Event):void
    {
    Spark.Update ();
    }

    addEventListener (Event.ENTER_FRAME, updateSpark);

    Is what it seems that this should be on every Flash ENTER_FRAME should call updateSpark, which is a function that handles the event update() for the instance of the spark which is a movieclip instance that has an update event that moves x and y of the position of their relative velocity variables.  It seems simple enough to me, but when I ctrl-enter to test the movie, I get the following compiler 3 errors:

    Particle.As line 1: 5000: the class 'Particle' must subclass 'flash.display.MovieClip' because it is linked to a symbol in the library of this type.

    Particle.As line 7:1071: syntax error: expected a keyword (for example function definition) after the public attribute, not xVelocity.

    Particle.As line 7:1084: Syntax error: expecting rightbrace before the semicolon.

    Since I imported flash.display. * and declares the class public particle so it extends MovieClip I have no idea why I get this error of 5000.  I see this issue come up a lot when searching Google and forums, but none of the resolutions that I could find have suggested an approach that applies to me or solve the problem.

    Any help to fix this would be appreciated.  I enclose a zip of the FLA a files as described above in case there is something in the settings of publication that I messed up inadvertently.  In addition, if you can get this to compile without error, then the problem may be due to my Flash CS3 Pro install which will result in the problem isn't with my code and start looking at me in a different direction.

    Thank you

    Scott

    Yes, 'var '.

  • Hello Mr President! I have a few questions about the Word report generation please.1.How can I add a border to a page in word? 2. How can I add gridlines to a table generated related word?. Can 3. how I add a border to a picture of the Word report?. Thank

    Hello!

    Sir, I have a few questions about generating word reports using (C language in labwindows) please.

    1. How can I add a border to a page in word?

    2. How do I add border lines and grid to a table generated in Word report (not "cvi control table"inserted from gui, I wonder about the table generated in Word report)?

    3. How can I fill a table cell of report word with the data type other than 'character '.

    And sir a question on the use of the timer in labwindows cvi please.

    Sir, I'm trying to set a time minimum interval timer to 1millisecond (0.001 s), that I have set, timer cares about the interval set by me he only meets the minimum default time interval which is, I think as 10milliseconds (I'm using windows xp service Pack 3 version 2002).

    Concerning

    Imran

    Pakistan

    Have you read this statement ? It explains how to set the registry value:

    If the REG_SZ useDefaultTimer does not already exist, you must create it under HKEY_LOCAL_MACHINE\SOFTWARE\National Instruments\CVI Run-Time Engine\cvirte. "" This can be done navigate to the appropriate folder, and then click Edit "New" string value. Then, click on means the name of the new value created, select Rename, and then specify useDefaultTimer as the name. Finally, double click on the name and specify the value True or False.

  • Support for Pixel Bender? (flash.display.Shader)

    Anyone who has studied if the runtime takes in charge flash.display.Shader (the "kernel Pixel Bender's" what's new in Flash 10)?

    The AIR docs say only that it can or is not supported on a mobile device.

    In this message @gluth user said that he used the PixelBender stuff with success in the old and the new Simulator (beta 2) without any problem.  (The thread is something else, but if we don't know what it is made reference, get two or three messages where he talked using PixelBender gray buttons, and I was questioned that).

Maybe you are looking for