Cannot set HScrollBar & quot; Scroll & quot; variable inside the function in & lt; MX:script & gt;

Why can I not pay the scrolling feature for a bar scrolling from a function. It can be hard coded and not dynamically set. This makes it difficult to make the scroll bars on the fly.

I want to do the following:
var myBar:HScrollBar = new HScrollBar();
myBar.scroll = "myFunction (); « ;

BUIT, it is said that myBar doesn't have a variable named scroll. What is the problem?

Hi, Creo, 'scroll' is not a property of the ScrollBar class, this is an event. To do what you're trying to do, you add a listener of events, something like this:

Import mx.events.ScrollEvent;
var myBar:HScrollBar = new HScrollBar;
myBar.addEventListener (ScrollEvent.SCROLL, myFunction);

I hope this helps. -Bruce

Tags: Flex

Similar Questions

  • Get the value of the variable inside the function from the event (EventListener)

    How to get the value of the variable inside the function from the event. Variable has been declared as a function of external events.

    var StringVar="sample";
    
    
    
    
    myButton.addEventListener(MouseEvent.CLICK, myClickReaction);
    
    function myClickReaction (e:MouseEvent):void{
    StringVar="other sample";
    }
    
    trace(StringVar); /* it gives me "sample" value and i would get "other sample" value */ 
    

    This strange because if it would be the trace of a normal function would give me good result.

    var StringVar="sample";
    
    
    function myClickReaction():void{
    StringVar="other sample";
    }
    
    myClickReaction();
    trace(StringVar); /* it gives me result as i wanted to have - "other sample" value */ 
    

    I also know method of passing of arguments depending on the event, but it doesn't for me as I would like to

    var StringVar="sample";
    
    
    
    
    myButton.addEventListener(MouseEvent.CLICK, function(e:MouseEvent){ myClickReaction(e, StringVar) },false, 0, true);
    
    function myClickReaction (e:MouseEvent, StrVar:String):void{
    
    StrVar="other sample";
    }
    
    trace(StringVar); /* it also gives me "sample" value and i would get "other sample" value */ 
    

    How to do it correctly?

    I do not know the structure of your screen lists so I can't tell you how to access the variable, but you're on the right track. If it's a parent, then you can always use the .parent property to cross to the top the list display to try to access.

    for example 1 level:

    MovieClip (this.parent). StringVar = "another sample";

    Add more properties .parent to continue to move to the top of the list.

    for example:

    MovieClip (this.parent.parent). StringVar = "another sample";

    Just like always, use traces (MovieClip (this.parent). StringVar); until you get the value that you want to know that you're accessing them correctly.

  • A problem with access to the public variable inside the function

    Hello

    I received this package and I get error 1120: 1120: access of undefined property aa

    Could you explain why I get this error?

    package somepackage {}

    import flash.display.DisplayObject;
    Import mx.containers.Canvas;

    SerializableAttribute public class SoundPictureSigns extends Canvas {}

    public var aa:int = 12;

    public void SoundPictureSigns (): void {}
    }


    public static void setUpSignSizes (): void {}

    trace ("AA =" + AA); ERROR here: 1120: access of undefined property aa
    {
    .......

    Can you help me?

    Concerning

    You cannot access an instance inside a static method variable. Either make the static or non-static method.

  • cannot set file error when trying to put the photoshop button in adobe muse, he is not 'supported color space. Resave image RGB or grayscale.

    cannot set file error when trying to put the photoshop button in adobe muse, he is not 'supported color space. Resave image RGB or grayscale.

    I believe that this is already the answer here:

    https://forums.Adobe.com/thread/1917435

    Thank you

    Sanjit

  • Variables in the function MathScript ode solver

    Hello

    I'm using LabView for awhile and I started using the text tools more. To solve a system of differential equations, there is this very elegant tool to do this in a MathScript node with the ode solve algorithms (for example, "ode_adams"). As the LabView help said, I've defined a function and registered as a ".m" file. I loaded this function in mathscript and solve differential equations.

    Both and so good, but my problem is that I can not all variables in the function. I can only put numbers in the function but not variables. Unfortunately I need to define the variables outside the function in the MathScript node.

    Does anyone have an idea how to manage the variables in this case?

    I have attatched a picture of the function and test VI (LV2014).

    Greetings

    Global variables to solve this problem:

    Solution:

    Greetings

  • How can I escape commas inside the function listQualify?

    I have

    am a newbie in coldfusion. I need help. My database has records of names of companies as: abc, Inc. For now I'm using this query:

    SELECT DISTINCT COMPANY FROM ComapanyTable WHERE (Company IN (#ListQualify(form.cCompanyList2, "'", ",")#))

    This problem is that it separates CBA, Inc..

    SELECT DISTINCT Company FROM CompanyTableWHERE (Company IN ('abc',' Inc.','xyz','Inc.'))

    I need to get the list, as it is, i.e. as: "abc, Inc.", "xyz, Inc." so that I can later insert these values into a new table.

    Insert the code:

    <cfquery name="insertPair" datasource="#DSN#" dbtype="ODBC"> INSERT INTO tblChildCompanyToParent (Parent_Account_ID, Child_Account_ID) SELECT DISTINCT <cfqueryparam value = "#form.pCompanyList#" CFSQLType = "CF_SQL_VARCHAR">, Company FROM CompanyTable WHERE Company IN (<cfqueryparam value="#ValueList(insertSelect.Company,';' )#" CFSQLType = "CF_SQL_VARCHAR" list="true" separator=";">) </cfquery>

    Code of the selection list

    <select multiple name="cCompanyList2" id="cCompanyList2" class="selectCCompany" data-attribute="selCCompany" size="10"> <cfloop query="childCompanyList"> <option value="#childCompanyList.Child_Account_ID#">#childCompanyList.Company#</option> </cfloop> </select>

    Y at - it anyway to solve this problem.

    Thank you for your help.

    I managed to fix it.

    I posted the solution to StackOverflow

    SQL - how can I escape commas inside the function listQualify? -Stack overflow

    Thank you once again!

  • Can we call the procedure inside the function?

    Hello

    Can we call the procedure inside the function?

    Thank you
    Brij

    845712 wrote:

    Can we call the procedure inside the function?

    Strange question to ask.

    Yes. This is the standard behavior in most (if not all) procedural and object oriented languages.

    A procedure, function or a method is a unit of code.

    You can call one of the other units. Units can call themselves (recursion). Technically, this means simply by pushing the battery current (to save the stack of the current device memory), the call to the new unit and then popping up battery when control is returned to the unity of the appellant.

    There are very few exceptions to this. The only one that comes to mind programming languages I've used through the years, is natural 1 - could not call a new unit of code to replace the existing one in memory. If no call-and-return was possible.

    Exactly what did you ask this question? Some newcomers to confused Oracle SQL and PL/SQL - two different languages aside server. And then also mistaken for PL/SQL client command vocabulary of SQL * more.

    You will need to make sure that understand the basics of programming (applies to most current programming languages) and Oracle concepts.

  • How can I build and pass a variable to the function getField?

    I need to know how to build and pass a variable to the function getField():

    I have a form of several sections similar to a spreadsheet.  Each section contains 5 rows of 11 columns.  Currently I have calculations in the field I want to consolidate and move to the level of the document.  The field names in each column are identical except for a row identifier.  For example, in the 1st row: a_debtType1, a_debtTerm1, adebtRate1, etc.  I want to be able to pass to a function of level document line identifier and that connect a function "getField.  Here is an example:

    Document-level:

    function calculateLoan (lineNumber) {}

    var myDate = getField("a_debtType"+lineNumber).valueAsString;

    var myDate = getField("a_debtTerm"+lineNumber).valueAsString;

    .. few treatment

    return

    }

    Level of the form:

    change the information in the form is ready for line 1

    function calculateLoan("1");

    Thanks in advance for any help.

    It seems good except how you call the function of what you have. The calculation script should be something like:

    Custom calculate script

    calculateLoan("1");

    Note that you can also get the line number if it is contained in behalf of the field that calls the script if you don't disturb him passing as parameter, assuming you named the fields correctly.

    For example, to calculate the field is called "row_total.1", you can get the line number in the script like this:

    var no_lig = event.target.name.split(".") [1] ;

  • To access the Global Variables in the functions/methods

    Which of the following statements is better in terms of performance and efficiency?

    public var a: int = 0;


    public void add (): void {}

    a += 5;

    }

    Addition();

    OR

    public var a: int = 0;

    public void Addition(b:int):int {}
    b += 5;
    Back to b;
    }

    a = (a) Addition;

    I saw a lot of guides discourages the use of global variables in the functions/methods, but I just don't understand why anyone would create a copy of the variable, modify this copy and to grant this value to another variable and throw.

    You must create an instance to pass to your function.  the parameter (for example, mov) does not create a separate instance and creates only a temporary pointer to the passed object.

    If an instance is prepared for gc, having spent this instance to any number of methods (as a parameter) delay / will not interfere with ca.

    and Yes.

    MOV ['x'] = mov.x,

    MOV ["rotation"] = MOV.rotation,

    MOV [anypropertystring] = MC.anyproperty

    Flash uses array notation to solve strings into objects:

    var var1:ClassType = new ClassType();

    This ['var1'] = this.var1

  • Variable inside the Variable

    To reference a variable inside another variable, I know you can do something like:

    < cfset variable internal = 1 >
    < cfset outer_variable = "the internal variable is #inner_variable # ' >

    .. .and the #outer_variable < cfoutput > exit # < / cfoutput > would be:

    "The internal variable is 1.

    But I can't get it work with the query results. If the string, "Hello" #name # is stored in the "welcome message" field in a table in my database:

    .. #name # is stored in the variable scope on my CF page like 'joe' and when I

    < cfloop query = 'test' >
    < cfoutput > #greeting # < / cfoutput >
    < / cfloop >

    ... I get "Hello" #name # instead of "Hello Joe".

    Basically, there is a double standard. With regular variables, works of art, basic, but with some query variables it doesn't. Any ideas why or, more important, how to work around?

    I need this is because I am storing the emails that we send to customers in a database. The body of the email contains variables holding individual information (name, password, etc.). To get the password inserted in the body of the email or name of each person, I need to use variables in the variables.

    OK, found the solution. In addition to using the evaluate function, I had to close my email body variable (or the 'outside') quotes in the database record itself. so it would be stored in the DB as:

    "Hello #name #

    and I'd call it:

    #evaluate (email_body) #.

    At this point, I don't know why it is like that, but I'll take it...

  • Error: The installer cannot set Windows XP required configuration information during the upgrade to Windows XP Home SP3 of Windows XP Pro.

    Original title: OEM Windows XP Home SP3 update XP Pro

    Here is a compilation of the messages from another forum regarding
    My problem:
    ---------------------------------------------------------------

    I'm trying to upgrade a Windows XP Home Sp3 OEM system to
    Windows XP Pro. (There are a few Pro features
    that are not available in the House I now need: (1) the files offline and
    (2) an add-on available for free to Onenote 2007, Top2onenote, requires a Pro).
    I don't want a clean install, but an upgrade. I bought a Windows XP Pro
    Upgrade CD on Ebay that was Windows XP Pro
    Gold (v2002). I'm sure that's true for the following reasons:

    It has been listed as an upgrade, but the CD is not labeled "Upgrade".
    It seems very authentic with all Microsoft holography.
    He came in the standard package of Windows XP (without box),
    and it was sealed.
    The name of volume for the CD is WXPFPP_EN. The Internet,.
    It is the retail of Windows XP Pro RTM (gold)!

    Here are things I tried initially.

    (1) I tried to upgrade to Pro from the purchased CD. It is immediately
    has refused to upgrade indicating the upgrade OS (Pro) is older than the
    installed OS (home)...

    (2) I read about "slipstreaming". "Slipstreaming" allows to integrate
    a service pack with an earlier version of the operating system. I created a
    upgrade XP Pro SP3 with Nlite slipstreamed CD image (and
    Autostreamer later, but it made no difference) from the purchased CD
    and a file containing SP3.

    After you burn the CD and start the upgrade
    (Windows installation), the upgrade process
    product through "information collection."
    "Dynamic update" and "Preparation of Installation" with
    no problems. My computer restarted and returned to
    "Installation preparation". A progress bar called 'Progress '.
    quickly filled to about 90% and the hanging system
    at that time there for about 15 minutes.
    Then, I got the following error message:

    Setup cannot set the required Windows XP configuration
    information. This indicates an internal Setup error.

    This is where I am stuck. I had to leave the installation at this point.
    My drive is starts raining and I had to restore a backup.

    (3) just for the heck of it, I formatted my hard drive and
    reinstalled my original OEM XP Home SP3 OS (no clean up, no user file).
    I immediately used my XP CD slipstreamed Pro to try one
    upgrade to XP Pro and IT WORKED! I need to find out why the
    properly clean XP Home OS upgraded to XP Pro but my pre-existing
    (with the files users, drivers, etc..) XP Home OS does not level
    successfully to XP Pro.
    -------------------------------------------------------------

    Another post:

    Yet once, today, I installed a new copy of OEM Windows XP Home Sp3.
    I continue with installation of all the essential and the add-on
    pilots (essentially all my original version). Then, I
    set up a network connection and firewall. With this configuration,.
    I ran the Pro XP slipstreamed SP3 CD. The upgrade to XP Pro
    success (even if the upgrade not configured my graphics
    card properly). I guess my current problem is either the registry,
    the WINDOWS, some user file or parameter file.
    ---------------------------------------------------------------

    Another post:

    I made a file and the backup of the folder C:\Windows folder
    on my system that is pre-existing (OEM XP Home Sp3). I also did a
    separate the backup the State of the 'system' on my pre-existing system.
    These are added my full image backup of her pre-existing
    system a month ago.

    I did a backup image of my system (minimum fees OEM XP Home
    SP3 with all the original installed drivers over a network configured
    connection and a firewall configured). This system will upgrade
    XP Pro with XP Pro SP3 slipstreamed CD successfully.

    Experiment 1:

    I've restored my minimum system. I then restored the C:/Windows folder
    and the State of the pre-existing system backup system. A startup
    has managed (with a minor irritant). I had to activate Windows.
    Then, I tried upgrading the slipstreamed XP Pro processor. He stopped
    at the same place during the upgrade and gave the same error as before:

    Setup cannot set the required configuration information Windows XP.
    This indicates an internal Setup error.

    Experiment 2:

    I've restored my minimum system. I then restored the system state only
    the backup of the pre-existing system. After startup I was asked to
    activate Windows, but answer Yes to the question would be to disconnect me
    the system. I couldn't get connected to try the XP Pro upgrade.

    Experience 3:

    I've restored my minimum system. I then restored only the C:/Windows
    the backup of the pre-existing system folder. Once again, as in experiment 1,
    the upgrade failed at the same place with the same error message.

    ----------------------------------------------------------------

    Before the experiment 3, I hoped that 3 experience would succeed so I
    could conclude that I had a registry problem. I'm not sure now.
    I don't know what to try next. Take the minimum system and reinstalling
    my files of the user is not an option that my hard drive has over 200 GB of
    programs! If I restore all files and folders of my pre-existing
    I would still have backup to restore a system state the reliable (read the registry).
    ---------------------------------------------------------------------

    Sorry for the length! If anyone has any ideas I would appreciate your responses.

    Thank you

    Hello

    This problem can occur if a piece of hardware that is installed on your computer is not compatible with Windows XP.

    For more information, see this link:

    Error message: Setup cannot set the required Windows XP Configuration information

    Hope the helps of information.

  • MAXL: Error when you use the runtimesubvar variable in the function 'run the calculation '.

    Hello everyone,

    I am trying to use a variable ($MyScenario) as a runtimesubvar for a calculation script.

    This excerpt from my script works perfectly (without variables):

    run the calculation "MyApp". "MyPlantype'. '" MyCalcscript' with runtimesubvars ' MyRTSV = 'Budget '. ' ;

    The following with variable does not work:

    The value MyScenario = "Budget";

    echo $MyScenario;

    run the calculationn 'MyApp'.' MyPlantype'. 'MyCalcscript' with runtimesubvars ' MyRTSV = $MyScenario; ' ;


    It is the output:

    Budget (<-$MyScenario echo works!)

    MAXL > run the calculation 'MyApp'.' MyPlantype'. 'MyCalcscript' with runtimesubvars 'MyRTSV = $MyScenario;';

    ERROR - 1012150 - environment variable [MyScenario] does not exist...

    I also tried putting $MyScenario between quotation marks simple '$MyScenario', which seems to work better but leading to a different error:

    Budget

    MAXL > run the calculation 'MyApp'.' MyPlantype'. 'MyCalcscript' with runtimesubvars ' MyRTSV = 'Budget';

    ERROR - syntax error 1242021-1 ['Budget'].

    What Miss me?

    Thanks in advance,

    Fadel

    Have you tried to use double quotes around the entire string of RTSV? Apostrophes are cutting the expansion of variables in MaxL. I think the idea is at the exit of the second snippet - $MyScenario is passed through the intact calculation and then script (MIS-) interpreted as an environment variable.

  • Paths grouped inside the screw of traces transparent script

    I am running into a problem of script with Illustrator CS6 - one that has been plaguing me for some time now: groups within the compound paths.

    I have a script set in place to extract all the colors used in an Illustrator file, as well as information halftone, CMYK, etc..  It basically loops on each path in the file and leans on its fill (if any) color, the color (if any) race, gradient points (if any), etc.  If the element that is watching is a group, it just plunges in the group, which resembles all its components by calling the function even recursively.  Ditto for transparent traces.  He also put in place to manage most of raster images, whether it is a colorized bitmap or a CMYK image, etc..

    When the script fails, however, is when it runs in a compound path that contains a group.  Now, normally, would not even possible in Illustrator.  If you try to create a group of two paths, then composed them, Illustrator simply removes the grouping.  However, there are some programs that use of some people who, when exporting to a file EPS from them, some of the paths end up being groups inside transparent traces.  Not to mention that all my people here to search these paths of training problem, can I do with the script?  Here is the script I currently have:

    /**
     * The main part of the script that will run in Illustrator, getting the text of the object we're looking for.
     *
     * @param {File} theFile The file object that will be opened in Illustrator and checked.
     */
    function findInfo(theFile)
    {
              var document = app.open(theFile);
              var prodInfo = new Array;
    
    
              // This first section of the Illustrator script will just get the template name of the current product.
              var templateName = new String;
    
    
              var templateLayer = document.layers[2];
              $.writeln(templateLayer.name);
              for (var i = templateLayer.pageItems.length - 1; i >= 0; i--)
              {
                        var pName = templateLayer.pageItems[i].name;
                        if (pName != "")
                        {
                                  templateName = templateLayer.pageItems[i].name;
                        }
              }
    
    
              $.writeln("templateName (inside Illustrator Script) is " + templateName);
    
    
              // This second section of the Illustrator script will gather all of the used colors and store them in an array.
              var colorsArray = [];
              var bHalftones = false;
              var bFourCP = false;
              var bReg = false;
              colorsInUse(document.layers[0]);
    
    
              function colorsInUse(currPageItem) {
                        for (var i = 0; i < currPageItem.pageItems.length; i++) {
                                  // Stepping through each item on the layer.
                                  var currentItem = currPageItem.pageItems[i];
                                  // $.writeln("current item is " + currentItem.typename);
                                  // $.writeln("Does it have a fill color? " + currentItem.fillColor);
                                  if (currentItem.typename === "GroupItem" && !currentItem.guides) {
                                            // If it's a group, dig into the group and start the function over.
                                            colorsInUse(currentItem);
                                  } else if (currentItem.typename == "TextFrame") {
                                            var charAttrib = currentItem.textRange.characterAttributes;
                                            getColors(charAttrib, colorsArray);
                                  } else if (currentItem.typename === "RasterItem") {
                                            if (currentItem.imageColorSpace === ImageColorSpace.CMYK) {
                                                      $.writeln("Four-color process image in artwork.");
                                            } else if (currentItem.channels > 1 || currentItem.imageColorSpace === ImageColorSpace.GrayScale) {
                                                      if (currentItem.colorants[0] === "Gray") {
                                                                if (colorsArray.toString().indexOf("Black") === -1) {
                                                                          colorsArray.push("Black");
                                                                }
                                                                alert("When this script is finished, please verify that the Ink/PMS table has the correct colors.");
                                                      } else {
                                                                if (colorsArray.toString().indexOf(currentItem.colorants[0]) === -1) {
                                                                          colorsArray.push(currentItem.colorants[0]);
                                                                }
                                                      }
                                            } else {
                                                      alert("The raster image in the art file must be a 1-channel bitmap and, thus, script cannot determine its color.");
                                            }
                                  } else if ((currentItem.fillColor || currentItem.strokeColor) && !currentItem.guides) {
                                            // If the current object has either a fill or a stroke, continue.
                                            if (currentItem.pathPoints.length > 2 || (currentItem.pathPoints == 2 && currentItem.stroked && currentItem..strokeWidth >= 0.1))
                                            {
                                                      // If the current object has 2 points and a good stroke, or more than two points, continue.
                                                      getColors(currentItem, colorsArray);
                                            }
                                  } else if (currentItem.typename === "CompoundPathItem") {
                                            for (var c = 0; c < currentItem.pathItems.length; c++) {
                                                      if (currentItem.pathItems[c].pathPoints.length > 2 || (currentItem.pathItems[c].pathPoints == 2 && currentItem.pathItems[c].stroked && currentItem.pathItems[c].strokeWidth >= 0.1))
                                                      {
                                                                // If the current object has 2 points and a good stroke, or more than two points, continue.
                                                                getColors(currentItem.pathItems[c], colorsArray);
                                                      }
                                            }
                                  }
                        }
                        return;
              }
    
    
              function getColors(currentItem, colorsArray)
              {
                        try
                        {
                                  var fillColorType = currentItem.fillColor.typename;
                                  var strokeColorType = currentItem.strokeColor.typename;
                                  $.writeln("fillColorType is " + fillColorType);
                                  switch (fillColorType) {
                                            case "CMYKColor":
                                                      if (currentItem.fillColor.cyan === 0 && currentItem.fillColor.magenta === 0 && currentItem.fillColor.yellow === 0) {
                                                                if (currentItem.fillColor.black > 0) {
                                                                          if (colorsArray.toString().indexOf("Black") === -1) {
                                                                                    colorsArray.push("Black");
                                                                          }
                                                                          if (currentItem.fillColor.black < 100) {bHalftones = true;}
                                                                }
                                                      } else {
                                                                // $.writeln("Four color process!");
                                                                bFourCP = true;
                                                                bHalftones = true;
                                                      }
                                                      break;
                                            case "GrayColor":
                                                      if (currentItem.fillColor.gray > 0) {
                                                                if (colorsArray.toString().indexOf("Black") === -1) {
                                                                          colorsArray.push("Black");
                                                                }
                                                                if (currentItem.fillColor.gray < 100) {bHalftones = true;}
                                                      }
                                                      break;
                                            case "SpotColor":
                                                      if (colorsArray.toString().indexOf(currentItem.fillColor.spot.name) === -1 && currentItem.fillColor.spot.name.toLowerCase().indexOf("white") === -1) {
                                                                colorsArray.push(currentItem.fillColor.spot.name);
                                                      }
                                                      if (currentItem.fillColor.tint < 100) {bHalftones = true;}
                                                      break;
                                            case "GradientColor":
                                                      bHalftones = true;
                                                      for (var j = 0; j < currentItem.fillColor.gradient.gradientStops.length; j++) {
                                                                var gStop = currentItem.fillColor.gradient.gradientStops[j].color;
                                                                switch (gStop.typename) {
                                                                          case "GrayColor":
                                                                                    if (colorsArray.toString().indexOf("Black") === -1) {
                                                                                              colorsArray.push("Black");
                                                                                    }
                                                                                    break;
                                                                          case "SpotColor":
                                                                                    if (colorsArray.toString().indexOf(gStop.spot.name) === -1) {
                                                                                              colorsArray.push(gStop.spot.name);
                                                                                    }
                                                                                    break;
                                                                          case "CMYKColor":
                                                                                    if (gStop.cyan === 0 && gStop.magenta === 0 && gStop.yellow === 0 && gStop.black > 0) {
                                                                                              if (colorsArray.toString().indexOf("Black") === -1) {
                                                                                                        colorsArray.push("Black");
                                                                                              }
                                                                                              if (gStop.black < 100) {bHalftones = true;}
                                                                                    } else if (gStop.cyan === 0 && gStop.magenta === 0 && gStop.yellow === 0 && gStop.black === 0) {
                                                                                              break;
                                                                                    } else {
                                                                                              // $.writeln("Four color process.");
                                                                                              bFourCP = true;
                                                                                              bHalftones = true;
                                                                                    }
                                                                                    break;
                                                                          default:
                                                                                    // $.writeln("Four color process?");
                                                                                    bFourCP = true;
                                                                                    bHalftones = true;
                                                                }
                                                      }
                                                      break;
                                            case "NoColor":
                                                      break;
                                            default:
                                                      // $.writeln("The fill color on object number " + i + " is of type " + fillColorType);
                                  }
    
    
                                  switch (strokeColorType) {
                                            case "CMYKColor":
                                                      if (currentItem.strokeColor.cyan === 0 && currentItem.strokeColor.magenta === 0 && currentItem.strokeColor.yellow === 0) {
                                                                if (currentItem.strokeColor.black > 0) {
                                                                          if (colorsArray.toString().indexOf("Black") === -1) {
                                                                                    colorsArray.push("Black");
                                                                          }
                                                                          if (currentItem.strokeColor.black < 100) {bHalftones = true;}
                                                                }
                                                      } else {
                                                                // $.writeln("Four color process!");
                                                                bFourCP = true;
                                                                bHalftones = true;
                                                      }
                                                      break;
                                            case "GrayColor":
                                                      if (currentItem.strokeColor.gray > 0) {
                                                                if (colorsArray.toString().indexOf("Black") === -1) {
                                                                          colorsArray.push("Black");
                                                                }
                                                                if (currentItem.strokeColor.gray < 100) {bHalftones = true;}
                                                      }
                                                      break;
                                            case "SpotColor":
                                                      if (colorsArray.toString().indexOf(currentItem.strokeColor.spot.name) === -1) {
                                                                colorsArray.push(currentItem.strokeColor.spot.name);
                                                      }
                                                      if (currentItem.strokeColor.tint < 100) {bHalftones = true;}
                                                      break;
                                            case "GradientColor":
                                                      bHalftones = true;
                                                      for (var j = 0; j < currentItem.strokeColor.gradient.gradientStops.length; j++) {
                                                                var gStop = currentItem.strokeColor.gradient.gradientStops[j].color;
                                                                switch (gStop.typename) {
                                                                          case "GrayColor":
                                                                                    if (colorsArray.toString().indexOf("Black") === -1) {
                                                                                              colorsArray.push("Black");
                                                                                    }
                                                                                    break;
                                                                          case "SpotColor":
                                                                                    if (colorsArray.toString().indexOf(gStop.spot.name) === -1) {
                                                                                              colorsArray.push(gStop.spot.name);
                                                                                    }
                                                                                    break;
                                                                          case "CMYKColor":
                                                                                    if (gStop.cyan === 0 && gStop.magenta === 0 && gStop.yellow === 0 && gStop.black > 0) {
                                                                                              if (colorsArray.toString().indexOf("Black") === -1) {
                                                                                                        colorsArray.push("Black");
                                                                                              }
                                                                                              if (gStop.black < 100) {bHalftones = true;}
                                                                                    } else if (gStop.cyan === 0 && gStop.magenta === 0 && gStop.yellow === 0 && gStop.black === 0) {
                                                                                              break;
                                                                                    } else {
                                                                                              // $.writeln("Four color process.");
                                                                                              bFourCP = true;
                                                                                              bHalftones = true;
                                                                                    }
                                                                                    break;
                                                                          default:
                                                                                    // $.writeln("Four color process?");
                                                                                    bFourCP = true;
                                                                                    bHalftones = true;
                                                                }
                                                      }
                                                      break;
                                            case "NoColor":
                                                      break;
                                            default:
                                                      // $.writeln("The stroke color on object number " + i + " is of type " + strokeColorType);
                                  }
                        }
                        catch (e) {/* If an error was found with the fill color and/or stroke color, then just skip this particular path item. */};
                        return;
              }
    
    
              document.close(SaveOptions.DONOTSAVECHANGES);
    
    
              // Now we combine the gathered items into a single array and return it.
              if ((colorsArray.length > 1 && !/HI/.test(templateName.substring(0, 2))) || bFourCP) {bReg = true;}
              prodInfo.push(templateName, colorsArray, bHalftones, bFourCP, bReg);
    
    
              return prodInfo.toSource();
    };
    

    I know it's a bit messy right now, with lots of ' $.writeln purposes, of which some are even commented out because they caused debugging errors.  In any case, I would be very grateful for any help on this matter.

    the only thing I can think of, is to go through all the elements to the Document level, instead of at the layer level, this way the script will see all paths

    change this

    colorsInUse(document.layers[0]);

    for this

    colorsInUse(document);

  • How to activate something inside the function outside the service? -class

    Hey,.

    I need to activate a few lines of code inside a function, because that's where the name of the object is filed.

    A Boolean value would work well? If so how exactly would implement it? I've tried Boolean but had no success because I'm not experienced with them...

    Heres a code:

    public var myboolean:Boolean = new Boolean();

    public void Function_One()

    {

    }

    public void Function_Two()

    {

    var myObject:DisplayObject = new ObjectClass();

    I want the name of object ' myObject which will be used for the Function_One() but I can not so what is a good method to solve this problem?

    }

    I was thinking about a Boolean might be useful, so it could "set off" my lines of code with an if statement to a boolean type. But no luck...

    Or is there a better way to do this?

    Thank you.

    Try with method 1:

    If (getChildByName ("enemy_mc")! = null) removeChild (getChildByName ("enemy_mc"));

    Try with method 2:

    for (i = this.numChildren - 1; i > = 0; i--) {}

    trace (BG.getChildAt (i). (Name)  Make sure that the name that you specified on stage

    If (this.getChildAt (i) .name == "enemy_mc") bg.removeChildAt (i);

    }

    Place a trace statement and identify first if he recover the movieclip 'enemy_mc '.

  • using a variable outside the function that defines

    Why can't I not use the variable "numOfItems" outside of the function in the code I have attached below? I need to have a variable that retrieves its value in the number of nodes in an xml document and used later to the timeline root, outside the service the xml onLoad, once it has been loaded.



    You are still facing the same problem.

    Track at the bottom of your code tries to trace before your xml file has finished loading. Therefore, you have to wait as well.

    Inside your onLoad

    traceResult();

    And where you have your current track down.

    function traceResult() {}
    trace (numOfItems);
    }

    That should do it.

Maybe you are looking for