Add variables to movieclip via addchild

When I didn't not use classes, I could easy attach my variables custom clips using this code;

MovieClip.customvariable = value;

but now, I'm working with classes, and it is no longer possible.

I'm trying to fix chip variables and sensor to the child like this: [eiland1 is the movieclip]

eiland1. Chip = 1;
eiland1. Sensor = teller1;

but then I get this error:

1119: access of property may be undefined chip through a static reference type Eiland.

It goes the same for sensor variable.

Ella is the class that the child is from.

So, how can I add custom variables as I usually, Childs, through classes.

You can add variables to custom classes 'dynamic '.

then, use:

public custommovieclipclass dynamic extends MovieClip {}

Instead of

public custommovieclipclass extends MovieClip {}

Tags: Adobe Animate

Similar Questions

  • ability to add name of movieclip

    Hello

    I would like to know if it is possible to add a number to a certain movieclip, for example
    something like:

    var currProj = thumbHolder.projSq + ("0");

    Thank you!

    Yes, you can do it.  the following would be an effective way to encode your buttons and have them Tween their associated movieclip.

    Import fl.transitions.Tween;

    for (var i: Number = 0; i<>

    This ["projBut" + i] .ivar = i

    This ["projBut" + i] .onRelease = releaseF;

    }

    function releaseF() {}

    var t:Tween = new Tween(thumbHolder["projSq"+this.ivar],...);

    }

    But if you want to make your own way, you would use:

    thumbHolder ["projSq" + currBut]

  • How to add and remove programs via the control panel when access pops up an error of windows\system32\rundll.exe

    need to know how to fix the windows\system32\rundll32.exe to be able to go to add remove programs and other options in the Panel

    From the other thread:

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_xp-performance/how-to-access-Add-and-remove-programs-through/852bd751-106C-481F-B471-9f32ddc40eab

    old question, new question so what I do or how to set or return rundll.exe in my computer?

    old question question/new - matter always request how to fix or recover from the windows/system32/rnudll.exe in computer science. I see no other answer to this anywhere

    Hi DadVQ,

    ·         Did you do changes on the computer before the show?

    This problem occurs because of a missing or corrupted Rundll32.exe file. This problem can also be caused by a virus.

    Follow the suggestions below for a possible solution:

    Method 1: Follow the steps mentioned in the article below and check if the problem still persists.

    Cannot find the Rundll32.exe file when you open Control Panel

    http://support.Microsoft.com/kb/812340

     

    Method 2: If the problem persists, I also suggest that you scan your computer with the Microsoft Security Scanner, which would help us to get rid of viruses, spyware and other malicious software.

    The Microsoft Security Scanner is a downloadable security tool for free which allows analysis at the application and helps remove viruses, spyware and other malware. It works with your current antivirus software.

    http://www.Microsoft.com/security/scanner/en-us/default.aspx

     

    Note: The Microsoft Safety Scanner ends 10 days after being downloaded. To restart a scan with the latest definitions of anti-malware, download and run the Microsoft Safety Scanner again.

    Important: While hard disk analysis if bad sectors are found when scanning try to repair this area, all available on which data can be lost.

    Let us know if that helps.

  • Cannot add an audio Transition VIA Drag and Drop... Next in the classroom in a book.

    I work through Premier Pro classroom in a book, and I can add audio transitions in all the different ways they ask for.

    Default shortcut as well as through the sequence menu.

    I can't add a drag and drop any kind crossfade. Not between audio or at the beginning or end of the sequence.

    Y at - it a setting that I turned on to turn it off? It seems that since I'm following the examples of book and there was no mention of any weird behaviour that should not be the case.

    We tried a few things and looked in the forums, but nobody seems to have the same problem.

    Note:

    Running a Mac with El Capitan.

    Video transitions are drag and able to receive.

    Thank you

    OK I found it.

    Looks like I got accidentally audio transition default to 0.01 seconds time in the preferences panel.

    It is in fact a framework - but not a no-brainer.

  • VMWARE ESXi 4.1: Add a DATA store via a new 4 TB SATA HARD drive

    Hi all
    Thank you for all the support and the good work that you provide!

    I'm not a VMWARE specialist.
    I'm on a DELL T610 with a VMWARE ESXi 4.1. Several virtual methods machines operate on a RAID5 grap with a PERC6i controller.
    The CDROM SATA drive is visible and usable on the hypervisor.
    In fact, I add a 4 TB SATA (Seagate ST4000NM0033).

    I see my HARD drive in the BIOS and I see too much on the vmware console:

    / dev/discs # esxcfg - mpath - l
    ........
    SATA.vmhba34 - sata.0:0 - t10. ATA___ST4000NM00332D9ZM170___Z1Z18EKC
    The Runtime name: vmhba34:C0:T0:L0
    Feature: t10. ATA___ST4000NM00332D9ZM170___Z1Z18EKC
    Full device name: Local ATA drive 4 TB
    Adapter: vmhba34 channel: 0 target: LUN 0: 0
    The identifier for the adapter: sata.vmhba34
    Target ID: sata.0:0
    Plugin: NMP
    State: Active
    Transport: sata
    .....


    Or:

    / dev/discs # esxcfg - mpath - b
    NAA.6842b2b0092e9100141774ac16c2a585: disk DELL Local (naa.6842b2b0092e9100141774ac16c2a585)
    vmhba1:C2:t0:l0 LUN:0 Status: Active Local HBA vmhba1 channel 2 target 0

    MPX.vmhba0:C0:t0:l0: Local TSSTcorp CD (mpx.vmhba0:C0:T0:L0)
    vmhba0:C0:t0:l0 LUN:0 Status: Active Local HBA vmhba0 channel target 0 0

    T10. ATA___ST4000NM00332D9ZM170___Z1Z18EKC: Local ATA disk 4To
    vmhba34:C0:t0:l0 LUN:0 Status: Active Local HBA vmhba34 channel target 0 0

    T10. DP___BACKPLANE000000: Local pregnant DP Svc Dev (t10. DP___BACKPLANE000000)
    vmhba1:C0:T32:l0 LUN:0 Status: Active Local HBA vmhba1 channel 0 target 32

    Or:

    / dev/discs # ls-l
    ........
    -rw - 1 root root 0 3 Sep 15:48 t10. ATA___ST4000NM00332D9ZM170___Z1Z18EKC
    lrwxrwxrwx 1 root root 3 73 Sep 15:48 vml.01000000002020202020202020202020205a315a3138454b43535434303030-> t10. ATA___ST4000NM00332D9ZM170___Z1Z18EKC
    .........

    ===========================================================================

    BUT: I can not add a partion on it:

    Fdisk u t10. ATA___ST4000NM00332D9ZM170___Z1Z18EKC

    I can not Use the graph console of the hypervisor , If I add un storage LUN , Nothing in the list... I can not Add ... I do not see it.

    You have a track for move me? Forums et doc VMware ne not allow me to unlock my brain (icon_rolleyes.gif)...

    I thank all for your interest and your help.

    ESXi 4.1 disc limit is 2 TB less than 512 bytes, ESXi 4.1 will not recognize more than 2 TB, check for other options as well.

  • Error in Visual Studio when you add data to boot via NuGet

    Hello

    I hope someone can help me. I recently downloaded the Visual Studio 2015 community on platform Windows 10. I'm trying to start by installing Bootstrap on my project, however I get the following error;

    Description
    '.', hexadecimal value 0 x 00, is an invalid character. Line 1, position 1.

    I searched online and did not find a solution to this. I'm pretty new to VS, so it's hard to find files/settings.

    Thank you in advance for your help!

    This issue is beyond the scope of this site (for consumers) and to be sure, you get the best (and fastest) reply, we have to ask either on Technet (for IT Pro) or MSDN (for developers)
    *
  • Change the images in a movieclip via a loaded swf file

    I am creating a game in which there are 4 buttons. The 4 buttons are baskets with labels of solids, liquids, gas and fire. When the button is clicked, the basket that keeps the catcher/character depending on which button is clicked. This time I connected this part of the game in other areas. My problem is that whenever I load this part of the game that the buttons can not change the cart that my catcher holds, it cannot change the images. But if it is played individually it works fairly well. Why is this?

    It's all over. I just copied the same framework of all my objects on catcher other steps.

  • now a multiplier of color on images

    Hello

    I have a lot of pictures and I need to put a filter of pinkish color on them... The problem I have is I can put a layer of 50% alpha rose in front of the picture, but it is much lighter than I want to as it is half transparent. So I would do some kind of multiplier effect photoshop where I merge the pink with the image. Is it possible to do this in as3?

    I saw the merger using bitmapData, but I can't work how it relate to a charge in image. Also, I saw the blendmode on movieclips, but I can't seem to get anywhere with it.

    Any ideas anyone?

    Thanks in advance

    Greg

    I worked here, for future reference for those who want to do it.

    I wanted to add a multiplier of the color B11747. You must conver Rible bits of the hex to decimal values.

    B1 is the Red
    17 is the Green
    47 is the blue

    I used this site http://www.statman.info/conversions/hexadecimal.html to convert and finished with

    B1 is 177 which gives as 177/255 = 0.6941
    17 is 23, which gives 23/255 = 0.0902
    47 is 71 which gives as 177/255 = 0.2784
    you divide the number by 255 as the decimal point is between 0 and 255

    make bitmap image
    var bmp:Bitmap = myLoader.content;
    BMP. Smoothing = true;
    var mc:MovieClip = new MovieClip();
    Add bitmap to movieclip
    mc.addChild (bmp);

    build the table and concat colors
    var matrix: Array = new Array();
    matrix = matrix.concat ([0.6941, 0, 0, 0, 0]); Red
    matrix = matrix.concat ([0,.0902, 0, 0, 0]); Green
    matrix = matrix.concat ([0, 0,.2784, 0, 0]); Blue
    matrix = matrix.concat ([0, 0, 0, 1, 0]); Alpha
    applyFilter (mc, matrix);

    apply the filter
    function applyFilter(child:DisplayObject,_matrix:Array):void
    {
    filter: var = new ColorMatrixFilter ColorMatrixFilter (matrix);
    var filters: Array = new Array();
    Filters.push (Filter);
    Child.filters = filter;
    }

  • MovieClip will not add to the list after calling addChild()

    I have a MovieClip in the library who refuses to be added to the stage during his call with addChild(). Here's the code.

    You will see a function called clickedACTDD_BTN. You will also see that the function offers a choice if the MovieClip is present, then it is deleted. If it is not present, then this is given properties and added. Also, note my tracing instructions in each choice. All signs as expected but the MovieClip ever arises. I've been on that days code and just can't see what I did wrong. Everyone sees it?

    package
    {
    PAheader 1.0

    import flash.display. *;
    import flash.events. *;
    import flash.geom. *;

    SerializableAttribute public class PAheader extends MovieClip
    {
    public var headerScreen:Screen = Screen.mainScreen;
    public var hdrLogo;
    public var BLKback;
    public var PRFLAVTR:profileAvatarMC = new profileAvatarMC(); Profile avatar
    public var msgbubble:messageBubbleMC = new messageBubbleMC(); ToolTip
    public var magGlass:magnifyingGlassMC = new magnifyingGlassMC(); In the shape of magnifying glass
    public var ACTDD_BTN:ActionsDDBtnMC = new ActionsDDBtnMC(); ACTIONS drop-down list button.
    public var HISDropD_BTN:HistoryDDBtnMC = new HistoryDDBtnMC(); HISTORY drop-down list button.
    public var REPDD_BTN:ReportsDDBtnMC = new ReportsDDBtnMC(); Button drop-down list of REPORTS.
    public var actionbucket:ActionBucket = new ActionBucket();

    public void PAheader()
    {
    addEventListener (Event.ADDED_TO_STAGE, initPAheader);
    } / - End constructor public function PAheader().

    public void initPAheader(e:Event_=_null):void
    {
    trace("==============================================");
    trace ("PAheader called.");
    trace ("of PAheader: visibleBounds.width:" + headerScreen.visibleBounds.width + "visibleBounds.width:" + headerScreen.visibleBounds.height);
    addEventListener (Event.RESIZE, resizedHeader);

    BLKback.width = AWSplash.resizeAsset(1024,headerScreen.visibleBounds.width,1024);
    BLKback.scaleY = BLKback.scaleX;
    //------------- adding Assets ----------------------------------------------------------------------------------------- ---------------------------------

    -Avatar profile
    PRFLAVTR.x = stage.fullScreenWidth - PRFLAVTR.width - 10;
    PRFLAVTR.y = height/2-PRFLAVTR.height/2;
    addChild (PRFLAVTR);
    -The ToolTip
    msgbubble.x = PRFLAVTR.x - PRFLAVTR.width - 10;
    msgbubble.y = height/2 - msgbubble.height/2;
    addChild (msgbubble);
    -Shaped magnifying glass
    magGlass.x = msgbubble.x - msgbubble.width - 10;
    magGlass.x = msgbubble.x - msgbubble.width - 10;
    magGlass.y = height/2 - magGlass.height/2;
    addChild (magGlass);

    } // ----------------------------------------------------------------------------------------- -------------------------- End public function initPAheader().
    public void resizedHeader(e:Event_=_null):void
    {
    trace ("header REDIMENSIONNE");

    } // ----------------------------------------------------------------------------------------- ------------------------- End public function resizedHeader().

    public void addActionsDDButton(caller:MovieClip):void
    {
    trace ("addActionsDDButton. the appellant is: "+ calling);

    -ACTIONS button
    ACTDD_BTN. Width = AWSplash.resizeAsset(1024,headerScreen.visibleBounds.width,60);
    ACTDD_BTN.addEventListener (MouseEvent.CLICK, clickedACTDD_BTN);
    ACTDD_BTN.addEventListener (MouseEvent.MOUSE_OUT, outACTDD_BTN);
    ACTDD_BTN. ScaleY = ACTDD_BTN.scaleX;
    ACTDD_BTN.x = HISDropD_BTN.x - ACTDD_BTN.width;
    ACTDD_BTN.y = BLKback.y;
    caller.addChild (ACTDD_BTN);
    trace ("added ACTIONS!");

    } / / - End public static void addDDButtons().

    public void addHistoryDDButton(caller:MovieClip):void
    {
    trace ("addHistoryDDButton. the appellant is: "+ calling);
    -HISTORY button
    HISDropD_BTN.width = AWSplash.resizeAsset(1024,headerScreen.visibleBounds.width,60);
    HISDropD_BTN.scaleY = HISDropD_BTN.scaleX;
    HISDropD_BTN.x = headerScreen.visibleBounds.width/2 - HISDropD_BTN.width/2;
    HISDropD_BTN.y = BLKback.y;
    caller.addChild (HISDropD_BTN);
    trace ("added HISTORY!");
    } / / - End addHistoryDDButton() of the public service.

    public void addReportsDDButton(caller:MovieClip):void
    {
    trace ("addReportsDDButton. the appellant is: "+ calling);
    -The REPORTS button
    REPDD_BTN. Width = AWSplash.resizeAsset(1024,headerScreen.visibleBounds.width,60);
    REPDD_BTN. ScaleY = REPDD_BTN.scaleX;
    REPDD_BTN.x = HISDropD_BTN.x + ACTDD_BTN.width;
    REPDD_BTN.y = BLKback.y;
    caller.addChild (REPDD_BTN);
    trace ("added REPORTS!");
    } / / - End addHistoryDDButton() of the public service.

    / * function removeButtons(theCaller:MovieClip) public
    {
    If (theCaller.Contains (HISDropD_BTN): theCaller.contains (ACTDD_BTN): theCaller.contains (REPDD_BTN))
    {
    theCaller.removeChild (HISDropD_BTN);
    theCaller.removeChild (ACTDD_BTN);
    theCaller.removeChild (REPDD_BTN);
    }
    } / / - End public static void removeButtons(). * /

    public void clickedACTDD_BTN(e:MouseEvent_=_null):void
    {
    trace ("Clicked clickedACTDD_BTN!");
    If (Contains (actionbucket))
    {
    trace (this);
    removeChild (actionbucket);
    trace ("1");
    }
    on the other
    {
    trace (this);
    actionbucket. Width = AWSplash.resizeAsset(1024,headerScreen.visibleBounds.width,161);
    actionbucket.scaleY = actionbucket.scaleX;
    actionbucket.x = ACTDD_BTN.x;
    actionbucket.y = ACTDD_BTN.y + ACTDD_BTN.height;
    actionbucket.y = ACTDD_BTN.y;
    addChild (actionbucket);
    trace ("2");
    }
    } / / - End clickedACTDD_BTN() of the public service.

    public void outACTDD_BTN(e:MouseEvent_=_null):void
    {
    If (Contains (actionbucket))
    {
    detectTarget (actionbucket);
    }
    } // ----------------------------------------------------------------------------------------- -------------------------- End public function outACTDD_BTN().

    public void detectTarget(target:MovieClip):Boolean
    {
    var mousePoint:Point = target.localToGlobal (new Point (target.mouseX, target.mouseY));
    If (Target.hitTestPoint (mousePoint.x, mousePoint.y))
    {
    trace ("equity bucket!");
    Returns true;
    }
    on the other
    {
    trace ("not on STOCK bucket!");
    Returns false;
    }
    } // ----------------------------------------------------------------------------------------- -------------------------- End public function detectTarget().
    } // ========================================================================================= ======== End public class PAheader{}.
    } // ========================================================================================= =================== End package{}.

    my mistake, this.addChild (this) is not going to work.

    PAheader is a class and a class is not on stage.

    an instance of the class could be on stage, however.

    and another instance might not be on stage.

    just because you see something that is a member of PAheader class, or maybe just looks like a class member, does not mean that all instances, or even none, are on stage.

    to be sure: trace (this.stage) = null, means the instance you are checking is not on stage.

    "(and I don't know where you want to add this instance of the class, but, assuming that your document is a MovieClip and not a Sprite), MovieClip (root) .addChild (this) might work, although it's bad coding."  and stage.addChild (this) of colin will not work because the stage is not defined in this class.

  • How to add a license via command line for C60 key

    Could someone remind me what the command would be to add a license key via the command line interface?  I want to downgrade the software and it was initially delivered with version TC7.

    Hello Douglas.

    Here are the commands:

    xCommand SystemUnit OptionKey Add Key(r):

    xCommand SystemUnit ReleaseKey Add Key(r):

    You can also enter them via the web interface by going to the maintenance > Software Upgrade.

  • How to add a MovieClip in current fla

    As in the example Rob Dillon shew me: http://www.DDG-designs.com/downloads/textOverVideo2.zip How to add the text window movieClip? I tried: 1. new as3 project 2. Add the component-> movieClip-> instance 'aa' name, but I couldn't find where was the new movieClip "aa". Please notify. Thank you,

    Normally when you create a new movieclip window opens to the timeline of the movieclip that the white screen in front of you will be inside the movieclip.  If you look in the library you should see him there as well.

  • Delete the text of the table via loop field for

    Hello

    I have a problem to delete text added via loop fields for.

    What im do is, via loop GI dynamically create menu with 10 buttons.

    Each button contain, created dynamically, background (shape) and the text field.

    And all is well.

    But when im trying to delete text fields, then I got this error:

    -I'm using the button to remove text fields - lang_btn.addEventListener (MouseEvent.CLICK, clickHandler);

    ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
              at flash.display::DisplayObjectContainer/removeChild()
              at Loading_Img_fla::MainTimeline/xmlLoaded()
              at flash.events::EventDispatcher/dispatchEventFunction()
              at flash.events::EventDispatcher/dispatchEvent()
              at flash.net::URLLoader/onComplete()
    
    

    In the script below marked in red is what should remove the fields of text in a table, instead me gives error.

    Here's my script

    // Create for loop
    for (var i:int = 0; i < 10; i++)
    {
              for each (xml in listItems)
              {
                        if (i == xml.attribute("Id"))
                        {
                                  // Add MovieClip to stage to hold the data
                                  addChild(lmHolder);
                                  lmHolder.x = 0;
                                  lmHolder.y = 0;
      
                                  // Create new MovieClip to hold buttons
                                  lmButtonsMCArray[i] = new MovieClip();
                                  lmButtonsMCArray[i].buttonMode = true;
                                  lmButtonsMCArray[i].mouseChildren = false;
                                  lmButtonsMCArray[i].x = 20;
                                  lmButtonsMCArray[i].y = 20 + btCount * buttonSpace;
    
    
                                  // Add each button MovieClip to lmHolder MovieClip
                                  lmHolder.addChild(lmButtonsMCArray[i]);
    
    
                                  // Create Background to buttons
                                  lmButtonsArray[i] = new Shape();
                                  lmButtonsArray[i].graphics.beginFill(lmBgColor0, 1);
                                  lmButtonsArray[i].graphics.drawRect(0, 0, 230, 85);
                                  lmButtonsArray[i].x = 0;
                                  lmButtonsArray[i].y = 0;
    
    
                                  // <<-- Add Background shape to the buttons MovieClips 
                                  lmButtonsMCArray[i].addChild(lmButtonsArray[i]);
    
    
                                  // Create a new array to preserve data from XML List
                                  lmNameArrayEG = new Array();
                                  lmNameArrayUS = new Array();
    
    
                                  // Create local variable to hold
                                  var lmTxtFieldContentUS:String;
                                  var lmTxtFieldContentEG:String;
                                  var lmTxtContent:String;
      
                                  // If clicked button is EG then make array with Arabic text
                                  // If clicked button is US then make array with English text
                                  if (footer.lang_btn.langState == "EG")
                                  {
                                            for each (var leftMenuName:XML in egLanguageList)
                                            {
                                                      lmNameArrayEG.push(leftMenuName);
                                            }
                                            lmTxtFieldContentEG = lmNameArrayEG[i];
                                            lmTxtContent = lmTxtFieldContentEG;
                                  }
                                  else
                                  {
                                            for each (var leftMenuNameUS:XML in usLanguageList)
                                            {
                                                      lmNameArrayUS.push(leftMenuNameUS);
                                            }
                                            lmTxtFieldContentUS = lmNameArrayUS[i];
                                            lmTxtContent = lmTxtFieldContentUS;
                                  }
                                  // Setup new text field each time script is executed
                                  lmTxtFieldsArray[i] = new TextField();
                                  lmTxtFieldsArray[i].width = 110;
                                  lmTxtFieldsArray[i].border = false;
                                  lmTxtFieldsArray[i].wordWrap = true;
                                  lmTxtFieldsArray[i].multiline = true;
                                  lmTxtFieldsArray[i].selectable = false;
                                  lmTxtFieldsArray[i].embedFonts = true;
                                  lmTxtFieldsArray[i].antiAliasType = AntiAliasType.ADVANCED;
                                  lmTxtFieldsArray[i].autoSize = TextFieldAutoSize.CENTER;
                                  lmTxtFieldsArray[i].text = lmTxtContent.toUpperCase();
                                  lmTxtFieldsArray[i].x = 10;
                                  lmTxtFieldsArray[i].name = "lmTxtFieldName" + i;
    
    
                                  // <<-- Add Text fields to the Movie Clip
                                  lmButtonsMCArray[i].addChild(lmTxtFieldsArray[i]);
    
    
                                  // If clicked button is EG then set Arabic text format, and make array with Arabic text fields
                                  // If clicked button is US then set English text format, and make array with Egnlish text fields
                                  if (footer.lang_btn.langState == "EG")
                                  {
                                            lmTxtFieldsArray[i].setTextFormat(txtFormat_lm_eg);
                                            // Make array from text fields;
                                            pushEgTFintoArray.push(lmTxtFieldsArray[i]);
                                  }
                                  else
                                  {
                                            lmTxtFieldsArray[i].setTextFormat(txtFormat_lm_us);
                                            // Make array from text fields;
                                            pushUsTFintoArray.push(lmTxtFieldsArray[i]);
                                  }
      
                                  // If clicked button is EG then loop thrue the for loop and remove English text fields from array
                                  // If clicked button is EG then loop thrue the for loop and remove Arabic text fields from array
                                  if (footer.lang_btn.langState == "EG")
                                  {
                                            for (var rNr_us:Number = 0; rNr_us < pushUsTFintoArray.length; rNr_us++)
                                            {
                                                      //remove the text field array from the display
                                       removeChild(pushUsTFintoArray[rNr_us]);
                                            }
                                            //clear the array
                                            pushUsTFintoArray = [];
                                  }
                                  else
                                  {
                                            for (var rNr_eg:Number = 0; rNr_eg < pushEgTFintoArray.length; rNr_eg++)
                                            {
                                                      //remove the text field array from the display
                                       removeChild(pushEgTFintoArray[rNr_eg]);
                                            }
                                            //clear the array
                                            pushEgTFintoArray = [];
                                  }
                        }
              }
    
    
              btCount++;
    }
    
    

    If you don't know what you're doing, you can always use:

    {If (pushUsTFintoArray [rNr_us] & {pushUsTFintoArray [rNr_us] .stage)}

    pushUsTFintoArray [rNr_us].parent.removeChild (pushUsTFintoArray [rNr_us]);

    }

  • Calling functions / set variables in loaded SWF

    You know how you can create a Movieclip object, add a function or a variable, and then call this function or change this variable to the SWF file that includes? I want to be able to do it, only with SWFs that are loaded at run time.

    My "main" SWF is just something the type of menu. The user clicks a button in my HAND. SWF and the HAND. SWF and then load the SWF associated with this button, using the AS 3.0 method Loader () - URLRequest () - addChild () that everyone always asks questions on prescribed.

    It works very well. But now I have a few custom and other objects (ie., not only the channels) in my HAND. SWF I want power sharing with the loaded SWF files. preferably, I'd use a function of the type of accessor (ie., LoadedSWF.GiveMeTheCoolObject (MyCoolObject)); Although at this point, I'm willing to hack the object itself (ie., LoadedSWF.CoolObject.CoolField = MyCoolObject.CoolField ;) if that's what it takes.

    I tried to call the functions and setting the fields, but the AS 3.0 compiler doesn't care for this kind of nonsense on its objects defined by the generically. Also note that, at runtime, a call to LoadedSWF.hasOwnObject ("GiveMeTheCoolObject") returns true.

    So my colleagues big brain, what is the magic?

    In advance, thank you for the help!
    Scott

    Kglad,

    Quote:
    Posted by: kglad
    the error message, seems, your function expects a member of the class MyCoolObject, correct?
    and MyCoolObject is not an instance of this class. so, you have to fix that. That is to say, create a member of this class, and use this class as a parameter of the function member.

    Heh, that's what the error message says all right. But the object IS actually an object of class MyCoolObject. I looked at this thing for hours and MyCoolObject IS an instance of this class. I tried different combinations of casting (including the cast on an object and passing that) but had no luck whatsoever.

    So I googled this particular runtime error message ("Error #1034: has no Type constraint: cannot convert '" ") and found a ton of links to other people with a similar problem. As a general rule, the problem was just as you say, someone passes a button as a string, that kinda thing. But a guy had a problem with an object that it has derived from the event class. Once the hours spent trying to make it work, he has tried to override clone() of the base class method and got it to work:

    http://www.assertTrue.com/articles/2006/10/14/custom-events-in-ActionScript-3-0

    As for my project, I took a long, hard look at the overall architecture of my project and decided it would be better if all the 'real work' is held in the HAND. SWF file. This approach would solve some other problems, and it makes sense in a mindset of "separating the display of data.

    If (and this is the interesting part) I changed the API for the LOADED. SWF to accept the pairs of strings (ie., LoadedSWF.AddToDisplay (String Name, String Data)) rather than accept MyCoolObj. Ran and Viola, now we work without any throw exceptions in. After this moment of glory, I created a couple of other APIs that comes from base classes (a type int, the other a type function) agreed and was happily on my way.

    On this basis, I understand while passing another base class objects (IE, the derived class) to load MovieClips via custom function API is... perhaps not so simple you'd expect. In the grand scheme of things well, not a big deal: as far as I'm concerned AS3 rocks.

    Kglad, thanks again for all the help: your comments on how this was the big push that I needed to get through the last barrier of this project.

    For those who read this topic for the ' how to call functions or set variables in a loaded SWF file?

    The short answer is cast to the SWF file that is loaded as a MovieClip content object and then call the function or change the variable:

    Load the SWF file (you saw this code a million times)
    var LoadedSWFObj:Loader = new Loader();
    var MyURL:URLRequest = new URLRequest("LoadThisSWF.SWF");
    LoadedSWFObj.load (MyURL);

    It is within your Event.COMPLETE Manager:

    Cast as a MovieClip object and work with it.
    var LoadedSWF:MovieClip = LoadedSWFObj.content as MovieClip;

    or another way to perform a cast:
    var LoadedSWF:MovieClip = MovieClip (LoadedSWFObj.content);

    Call yer function:
    LoadedSWF.CallMe ();

  • How to load external png image via xml?

    Can someone help me with the addition of a png image to a mc with an instance name.

    I want only to display a single image (no Gallery)

    I would like to get the url of the image via an xml.

    Here's a copy of my current action script which has already pulled in xml data that includes the node with the url of the photo.

    import flash.events.Event;

    import flash.events.MouseEvent;

    import flash.net.URLLoader;

    import flash.net.URLRequest;

    var myXML:XML;

    var myLoader:URLLoader = new URLLoader();

    myLoader.load (new URLRequest ("links.xml"));

    myLoader.addEventListener (Event.COMPLETE, processXML);

    function processXML(e:Event):void

    {

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

    trace (myXML);

    menumv.carbtn.addEventListener (MouseEvent.CLICK, openCURL);

    menumv.edubtn.addEventListener (MouseEvent.CLICK, openEURL);

    menumv.psybtn.addEventListener (MouseEvent.CLICK, openPURL);

    menumv.stubtn.addEventListener (MouseEvent.CLICK, openSTURL);

    menumv.busbtn.addEventListener (MouseEvent.CLICK, openBURL);

    menumv.shabtn.addEventListener (MouseEvent.CLICK, openSURL);

    studentmv.stuname.Text = myXML.student.name;

    }

    function openCURL(e:MouseEvent):void

    {

    navigateToURL (new URLRequest (myXML.car.url));

    }

    function openEURL(e:MouseEvent):void

    {

    navigateToURL (new URLRequest (myXML.edu.url));

    }

    function openPURL(e:MouseEvent):void

    {

    navigateToURL (new URLRequest (myXML.psy.url));

    }

    function openSTURL(e:MouseEvent):void

    {

    navigateToURL (new URLRequest (myXML.stu.url));

    }

    function openBURL(e:MouseEvent):void

    {

    navigateToURL (new URLRequest (myXML.bus.url));

    }

    function openSURL(e:MouseEvent):void

    {

    navigateToURL (new URLRequest (myXML.sha.url));

    }

    And here's a copy of the node that contains the url

    <menu>
        <student>
        <name>testnamehere</name>
        <photo>http://10.0.0.2/test/photos/testnamephoto.jpg</photo>
        </student>
    </menu>
    

    I saw this tutorial but it was for a gallery, and I couldn't not to hack and slash to do what I want.

    http://Tuts.flashmint.com/creating-a-simple-XML-Gallery-in-ActionScript3/

    Thanks again in advance for any help.

    Check if this gives null if yes it would output menu.student.photo

    trace (Student.photo)

    var _request:URLRequest = new URLRequest (student.photo);

    var _ldr = new Loader();

    MC's movieclip where you add your image

    mc.addChild (_ldr);

    _ldr. Load (_REQUEST);

    _ldr.contentLoaderInfo.addEventListener (Event.COMPLETE, load_complete, false, 0, true);

    function load_complete (event): void

    {

    whatever it is may be melted in the image

    }

  • loading movieclip

    Got a little problem.  Say that I have on my stage different buttons and each of them will load a movieclip in the library, how can I go to achieve this?  I tried to do a charger to charge all different movieclips.   When it goes into service with a click of a button, I unloadAndStop, I think this will remove anything from the charger if something already exists.  I then try to do things like

    myLoader.load(new URLRequest("myMovieClip"));
    myLoader.addChild(myMovieClip); 
    etc
    

    None of the above seem to work.

    Any advice appreciated

    see you soon

    Nick

    You want to add symbols from the library onto the stage? If so, you don't need class Loader - loader is for external content (another *.swf on the server).

    You instantiate directly your symbols from the library:

    (1) in the library, select the symbol that you want to add to the scene via ActionScript, rightclick-> properties

    (2) set the export for actionscript: true

    (3) in the class field, type "MySybol".

    -in fact, you can type any name you want - this is the identifier of the symbol fo ActionScript

    -You can also use packages: ui.buttons.NextPageButton

    in the code, you type:

    var mySymbolInstance = new MySymbol();
    addChild(mySymbolInstance);
    

Maybe you are looking for

  • Not able to access iCloud on Web

    iCloud is not loaded in the web browser for the past two weeks. is there a question?

  • Satellite C650 - Question about the capacity of the HARD disk

    I just bought a Satellite C650. The specifications indicate 320 GB hard drive, but the diagnostic system indicates the disk space is 286 GB (free capacity is GB 261). Please indicate why this might be the case.

  • System bios disabled

    HP Envy 17 3D Looks like a common situation, but after a few attempts at password I have the message system disabled with the code 70767007 Thanks for any help you can give.

  • Parts of some pages won't load not

    Nice day. I own a desktop computer, and is the serial number, {deleted personal information}. The product number is, bm415aa #aba. When I go on our radar local viper which shows where storms are and how much time until they come to your area, the map

  • Who should I contact to remove the code from my acer?

    Hello as I have read on several threads here, the main ID acer (on https://account.acer.com ) is not editable): http://community.Acer.com/T5/software-solutions-and/update-Acer-ID-email-in-user-profile/m-p/139257/... So I want to ask who I contact to