Actionscript 2  question

I have about ten days of actionscript experience. I'm taking
a break from the book and trying a few things on my own.
Anyway, I'm trying to set a boolean variable to true from
inside a movie so that it effects the actionscript on the _root
frame1.
Specifically, when the movie comes to it's last frame, I want
the variable "frame12" to be true and "pass(?)" this information
back to the main timeline and use it to start another movie.
Right now I've declared my variable on the _root like this:
var frame12:Boolean=false;
In the last frame of the movie I've put this:
frame12=true;
I'm going to put all the code I've written thus far. Any
suggestions or comments are appreciated. Like I said, it's not a
"project", just some experimenting so any comments are appreciated.

Thanks, that's helped. Now the variable frame12 is true, but
for some reason it becomes true before it gets to the last frame
where the code is: _root.frame12=true;
Here's some more detail: I have two instances of the same
movie. When the user releases myMovie1_mc.button1 of myMovie1_mc it
makes myMovie2_mc visible and plays the movie starting at frame-1
to frame-12 where it stops. When the user releases
myMovie2_mc.button1 of myMovie2_mc I would like it -- myMovie2_mc
-- to play to the last frame where _root.frame12=true would tell
myMovie1_mc to THEN play from frame-12 to the finish. The effect
would be, myMovie2_mc would be come invisible and THEN myMovie2_mc
would be come invisible.
But this doesn't happen.
Instead, when I release myMovie2_mc.button1 of myMovie2_mc,
both movies start playing from frame-12 before the variable frame12
has been turned to true.
Here's the code that applies:
myMovie1_mc.button1_mc.onRelease = function() {
myMovie2_mc.button1_mc.buttonText_txt = "parent";
myMovie2_mc.gotoAndPlay(1);
myMovie2_mc._visible = true;
myMovie2_mc.button1_mc.onRelease = function() {
myMovie2_mc.gotoAndPlay(12);
//a test to make sure the button works
_root.gotoAndPlay("parent");
//should make myMovie1_mc play and does just not when I
expected
if (frame12=true){
myMovie1_mc.gotoAndPlay(12);
}...

Similar Messages

  • ActionScript version question?

    Hi, I need to make a flash game using action script and i have read some tutorials about it, most of them are using actionscript 2.0.
    My question is, what do you think can happen if I use actionscript 2.0 instead of 3.0.
    I mean, would it work correctly in the current browsers? sorry for asking this, maybe is a silly question, but flash and AS is not my everyday working tool.
    I know that since actionscript3.0 is newer have some advantages, but since I dont have much time to do it, i´ll prefer to make it in AS 2.0 since i understand it better than AS 3.0.
    If you have any comment, please let me know i will really appreciate it!
    Thanks!

    The Flash Player supports all versions of actionscript so if you are able to use AS2 to complete the design you should not have any problem.

  • Flash/ActionScript Interview Questions

    We are currently hiring for a Flash position. I am trying to
    come up with
    some good ActionScript questions for the interviews. I have
    looked all over
    the net and can't seem to find anything like what I am
    looking for.
    I don't want general programming questions like "when would
    you use an
    interface class?" So far I have the following... feel free to
    critique
    these questions.
    1. What are a few ways to cause an event to occur on a timed
    basis?
    2. How do you add a listener to another object? What are some
    of the
    built-in broadcasters?
    3. How would you create and use a custom broadcaster for the
    event
    "onNextItem" broadcasting to the MovieClip "itemSheet"?
    4. What are some of the primitive data types in Flash? What
    would be a
    foreseeable use of each?
    5. What are some of the complex data types in Flash? What
    could they be
    used for?
    6. Can you mix data types in an Array, what about an
    associative Array
    (Object)?
    7. What are the two ways to create a new, empty object ready
    for use?
    8. What are the two ways to access a property of an object?
    9. What are some methods for getting data from a web server
    via the http
    protocol?
    10. Which built-in classes do you use the most?
    11. Which third party classes/libraries do you use?
    Please let me know if you can think of any others.
    Thanks

    Whic are good for Interview and Adobe Flash Developer Cirtification.

  • Animated .gif actionscript 3 question

    I hqve some small swfs that I need to convert to animated .gifs for
    a client. I assumed this this was a painless task but I was oh so wrong as the bigger the swf the worse
    the animated gif looks. But I have some small.swfs I need to convert and I did and they do not look bad but my problem is the swf had clikTag info in it for googleadwords. When I converted to animated .gif the file does not have any actions inside, which leads me to ask how do I pass actionscript to an animated .gif done in Flash?
    anybody??
    rdee

    HTML links are likely your only recourse.  If you need help with that, visit the Dreamweaver or web design forums.  They might have some alternative approaches to offer as well, possibly using javascript or something along those lines.

  • Hello, Actionscript 3 question. please help!

    Hello, I'm new to Actionscript 3 and still getting the hang of all the changes and such. However, one problem is sorely annoying me, and I need some outside opinions on what could be wrong. The code is basically a rewritten version of some code I found someplace else, and my main goal is to find out the error with the code. The code looks like:
    package
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    public class Main extends MovieClip
    var sceneOne:SceneOne;
    var sceneTwo:SceneTwo;
    var sceneThree:SceneThree;
    public function Main()
    sceneOne = new SceneOne(); trace("Working");
    sceneTwo = new SceneTwo(); trace("Working");
    sceneThree = new SceneThree(); trace("Working");
    addChild(sceneOne); trace("Working");
    //Add event listeners
    this.sceneTwo.OutsideButton.addEventListener(MouseEvent.CLICK, onHillButtonClick); trace("Working");
    this.sceneTwo.bathroomButton.addEventListener(MouseEvent.CLICK, onPondButtonClick); trace("Working");
    this.sceneOne.livingRoomButton.addEventListener(MouseEvent.CLICK, onBackButtonClick_Hill); trace("Working");
    this.sceneThree.livingRoomButton.addEventListener(MouseEvent.CLICK, onBackButtonClick_Pond); trace("Working");
    //Event handlers
    function onHillButtonClick(event:MouseEvent):void
    addChild(sceneOne);
    removeChild(sceneTwo);
    function onPondButtonClick(event:MouseEvent):void
    addChild(sceneThree);
    removeChild(sceneTwo);
    function onBackButtonClick_Hill(event:MouseEvent):void
    addChild(sceneTwo);
    removeChild(sceneOne);
    function onBackButtonClick_Pond(event:MouseEvent):void
    addChild(sceneTwo);
    removeChild(sceneThree);
    The error is occuring @ line 22, saying:
    TypeError: Error #1010: A term is undefined and has no properties.
    at Main()[/Users/Mike/Documents/Main.as:22]
    I'm unsure as to what the problem is, as I give it properties. Please help, thank you.

    I think you should rethink the way you're constructing this...
    I could be wrong but it has some flaws... example:
    [email protected] wrote:
    function onBackButtonClick_Hill(event:MouseEvent):void{
    addChild(sceneTwo);
    removeChild(sceneOne);
    looking to this function, I imagine a situation when you click a button to run this function...
    it will add "sceneTwo" to the stage and remove sceneOne... Ok!, but what if we were on sceneThree and not on sceneOne?
    It will try to remove a scene that doesn't exist.
    If that's the problem, you could solve it by using if statements for example.
    Another way is to create a var called something like "currentScene" and at the end of every function/method you first remove the currentScene, then add the new child and set it as your "new" currentScene.
    Well, it's just a guess anyway
    I'm going to sleep now
    Hope you solve your problem.

  • Beginner Actionscript Resource Question

    Are there any good resources that explain how to set up a .as file to run a flash app?  I've purchased two books and they both utterly suck at this.  This should be easy material, but I can't find anything.  I don't want to code in the timeline.  I don't want to buy another book for this.
    Thanks for any help.

    if you want to use a .as file without code, you are basically screwed. .as files are code, and the file does not have any way to know you want to use it without you explicity telling it to use it. if the file is in the same work directory of the rest of your project, you dont have to do that much, you can use it as you would any code written in the same movie, if you are using a class declaration (but the filename of the .as should be the same name as the class declared inside). if you are keeping this file in some other directory, you must use 'packgage' and import declarations according to your file tree structure
    filename example.as
    package {
    public class example { // extends Sprite {
    public static function example_func():void {
    trace("called from a movie");
    } //example_func
    }//class
    }package
    _________in a movie inside the same directory:
    example.example_func();

  • ActionScript 3 question

    Can I do this in AS3?
    (1) add the caurina folder to the folder
    (2) add Thumbnail.as to the folder
    (3) add
    import fl.containers.UILoader;
    import caurina.transitions.*;
    (4) add
    var arrayURL:Array = new Array();
    var holderArray:Array = new Array();
    var sprite:Sprite = new Sprite();
    addChild(sprite);
    var thumb:Thumbnail;
    //-------- the thumbnails container-------
    var thumbsHolder:Sprite = new Sprite();
    sprite.addChild(thumbsHolder);
    (5) add
    function onClick(event:MouseEvent):void {
    photoLoader.source = event.currentTarget.name;
    Tweener.addTween(thumbsHolder, {x:-650, time:1,
    transition:"easeInElastic"});
    Tweener.addTween(loaderHolder, {x:10, time:1,
    transition:"easeInElastic"});
    Tweener.addTween(thumbsHolder, {alpha:0, time:1,
    transition:"linear"});
    Tweener.addTween(loaderHolder, {alpha:1, time:1,
    transition:"linear"});
    ****Please look at the zip at
    http://www.montreal2losangeles.com/pleasehelpscale.html

    UPDATE!!!!!!Please ingnore this thread, I am currently on the
    scaleX & scaleY thread.

  • Can Actionscript do user forms and image generation ?

    Hi all,
      I need to build a web application in flash, the gist is the application takes users inputs and generates a network diagram based on that inputs.
    I actually coded the entire application in JS DOM and PHP GD, and client comes back suddenly saying they cant support PHP (IT restrictions). So now am back to square one, wondering, how to draw network images dynamically. JS cant do it. So I stumbled upon Actionscript.
    So if i were to code an application entirely in actionscript,
    My questions,
    1. Does actionscript provide me a way to create input fields (select, text, textarea...etc)
    2. Would i be able to use these user inputs from Question 1 to generate a network diagram ?
    3. Can actionscript do Question's 1 and 2 without needing support from a server side
         scripting language like PHP ?
    If somebody can help me understand, that would be very helpful. Thanks.
    Rgds,
    Kris

    Thanks for the response.
    However it still doesnt answer my question.
    I cannot have a side side language(PHP, .NET ..etc) involved at all.
    All i want to do it, design a form in FLEX and then without sending the form to the server side, i just want to read the fields (on an event) from the client side and do my processing on the client side and show the results again on the client side.
    For example (HTML/JS)
    Field A: <input type='text' id='one' name = 'one' /> <BR> <input type ='button' id='button' value='Generate' onclick = 'submitForm()' />
    <script>
         function submitForm(){
              document.write(document.getElementById('one').value);
              return;
    </script>
    With the above example, i dont need server side support at all. Can i do the same thing with FLEX.
    My only reason for trying FLEX is , i need to dynamically generate an image based the input values chosen by the user.
    So keeping the above example in perspective, can i just read that particular text field and generate an image and label/embed the value in that image appropriately ?
    any help would be very helpful. Thanks.

  • Can't get there frome here... (CSS button not working)

    Hi All,
    can someone look here and let me know why my 'Service' button only works once? When you drill down to, say... "Project Management," the service button from all subpages will not work. You have to goto another banner/header option (ex: about us) and click "Service" again to get to the main service page once more.
    FYI: Novice with CSS - this is a store bought template
    Thank You,
    Luna

    This is really a ActionScript (Flash) question since your Primary Navigation is Flash. The AS (ActionScript) is coded to disable after clicking to it's parent page.
    Since the child pages are under the parent the nav is still disabled. You would have to recode the AS (Flash Nav) to enable when navigationing to it's child page.
    Shane

  • Newbie questions on fms and actionscript 3

    Ok, like I said I'm a newbie, but I do understand the differance between ssas and as3. Not all, but all most everything I see written in SSAS can be writen into a external AS3 file. This leads me to quite a few questions I'm hoping you kind people can shed some light on for me.
    1)  What is the advantage of writing a SSAS file over an external AS3 file?
    2) Can I write an .asc file in AS3 or do I have to use AS1? Please understand I'm using tuts from fmsguru.com and the books "Learning Flash Media Server" (pdf) and "Programming Flash Communication Server". I'm not a javascript programmer so nothing I do in AS1 seems to make any sence while everything I do in AS3 does. It may not seem like it to you people that are programmers, but to those of us that aren't, AS1 and AS3 are miles apart.
    3) kind of off topic, but a security question. I'm not a "hacker" and don't like the jerks that are. My question is on external AS / SSAS files and swf files. When my fla is compiled into a swf does my external AS files remain external? I assume they do, but then what is the threat of the swf being decompiled? In most projects I would do I could care less if somebody had access to my fla as long as they don't have my actionscript files.
    I don't know. Maybe on questions one and two I'm getting confused becasue I'm using out dated material. Again I assume that even though fms was built off of the javascript engine it should be able to read and execute my AS3 file. Other wise what was the point of the evolution of actionscript into a fully functional programming language?
    Thanks for any help you might have...

    1) I did not get this question correcly - for that matter SSAS can only be in AS1 - so i dont see reason comparing them
    2) It has to be AS1
    3) if you doing "include" stuff - i think code would go into compiled swf and proper decompiler would give you the code.
    Last para - Server-side engine understands only AS1 so it wont be able to read and understand your AS3 file.

  • Actionscript 3.0 question

    Hi, all
    I absolutely do not know Actionscript 3.0 syntax and need to fix this FAST (of course).
    I named my instance, and used this code snippet. It works:
    thirtyYearFixed.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage_3);
    function fl_ClickToGoToWebPage_3(event:MouseEvent):void
        navigateToURL(new URLRequest("http://www.adobe.com"), "_blank");
    this is the previous code, actionscript 2.0 which is pulling dynamic data from the xml:
    on(release) {
        getURL(clickTAG + "?*", "_blank");
    THE QUESTION:
    how do I get it to link to the clickTAG, dynamic data (instead of http://www.adobe.com)
    tia,
    jarnot

    Yup. Thanks! It works. This is what it looks like:
    thirtyYearFixed.addEventListener (MouseEvent.CLICK, onClick);
    fifteenYearFixed.addEventListener (MouseEvent.CLICK, onClick);
    fiveOneArm.addEventListener (MouseEvent.CLICK, onClick);
    seeMoreRates.addEventListener (MouseEvent.CLICK, onClick);
    buttonMovie.addEventListener (MouseEvent.CLICK, onClick);
    AL.addEventListener (MouseEvent.CLICK, onClick);
    AK.addEventListener (MouseEvent.CLICK, onClick);
    AZ.addEventListener (MouseEvent.CLICK, onClick);
    AR.addEventListener (MouseEvent.CLICK, onClick);
    CA.addEventListener (MouseEvent.CLICK, onClick);
    CO.addEventListener (MouseEvent.CLICK, onClick);
    CT.addEventListener (MouseEvent.CLICK, onClick);
    DE.addEventListener (MouseEvent.CLICK, onClick);
    FL.addEventListener (MouseEvent.CLICK, onClick);
    GA.addEventListener (MouseEvent.CLICK, onClick);
    HI.addEventListener (MouseEvent.CLICK, onClick);
    ID.addEventListener (MouseEvent.CLICK, onClick);
    IL.addEventListener (MouseEvent.CLICK, onClick);
    IN.addEventListener (MouseEvent.CLICK, onClick);
    IA.addEventListener (MouseEvent.CLICK, onClick);
    KS.addEventListener (MouseEvent.CLICK, onClick);
    KY.addEventListener (MouseEvent.CLICK, onClick);
    LA.addEventListener (MouseEvent.CLICK, onClick);
    ME.addEventListener (MouseEvent.CLICK, onClick);
    MD.addEventListener (MouseEvent.CLICK, onClick);
    MA.addEventListener (MouseEvent.CLICK, onClick);
    MI.addEventListener (MouseEvent.CLICK, onClick);
    MN.addEventListener (MouseEvent.CLICK, onClick);
    MS.addEventListener (MouseEvent.CLICK, onClick);
    MO.addEventListener (MouseEvent.CLICK, onClick);
    MT.addEventListener (MouseEvent.CLICK, onClick);
    NE.addEventListener (MouseEvent.CLICK, onClick);
    NV.addEventListener (MouseEvent.CLICK, onClick);
    NH.addEventListener (MouseEvent.CLICK, onClick);
    NJ.addEventListener (MouseEvent.CLICK, onClick);
    NM.addEventListener (MouseEvent.CLICK, onClick);
    NY.addEventListener (MouseEvent.CLICK, onClick);
    NC.addEventListener (MouseEvent.CLICK, onClick);
    ND.addEventListener (MouseEvent.CLICK, onClick);
    OH.addEventListener (MouseEvent.CLICK, onClick);
    OK.addEventListener (MouseEvent.CLICK, onClick);
    OR.addEventListener (MouseEvent.CLICK, onClick);
    PA.addEventListener (MouseEvent.CLICK, onClick);
    RI.addEventListener (MouseEvent.CLICK, onClick);
    SC.addEventListener (MouseEvent.CLICK, onClick);
    SD.addEventListener (MouseEvent.CLICK, onClick);
    TN.addEventListener (MouseEvent.CLICK, onClick);
    TX.addEventListener (MouseEvent.CLICK, onClick);
    UT.addEventListener (MouseEvent.CLICK, onClick);
    VT.addEventListener (MouseEvent.CLICK, onClick);
    VA.addEventListener (MouseEvent.CLICK, onClick);
    WA.addEventListener (MouseEvent.CLICK, onClick);
    WV.addEventListener (MouseEvent.CLICK, onClick);
    WI.addEventListener (MouseEvent.CLICK, onClick);
    WY.addEventListener (MouseEvent.CLICK, onClick);
    function onClick (evt:MouseEvent):void {
    var clickTAG:String = loaderInfo.parameters.clickTAG;
         // Check for malicious code injections, only use URLs if they begin with http: or https:
         if ((clickTAG.substr(0, 5) == "http:") || (clickTAG.substr(0, 6) == "https:"))
                  { navigateToURL(new URLRequest(clickTAG + "?" + evt.currentTarget.name), "_blank");

  • Some question about fade in // fade out by hideEffect and showEffect in Actionscript

    Some question about fade in // fade out by hideEffect and
    showEffect in Actionscript
    Please kindly take a look at the following page:
    http://camusmiu.no-ip.com/HounganQuestion/PictureHolderTest.html
    (can view source)
    I tried to make an image preloaded and scale the image to
    it's preferred size.
    When I came to consolidate the stuff into a component, I
    found the application goes weird as I implementation the show/hide
    effect.
    The third trial which just hide and show the images directly,
    instead of using viewstack, fail to bring the second image onto
    screen.
    It just used fadeOut instead of fadeIn(you see there is a
    flash of the second image)
    After some study of showEffect and hideEffect behaviour,
    seems the mechanism of hide/show a component works in this way:
    this._fadeIn:Fade = new Fade();
    this._fadeIn.alphaFrom = 0;
    this._fadeIn.alphaTo = 1;
    this._fadeIn.duration = 1000;
    this._fadeOut:Fade = new Fade();
    this._fadeOut.alphaFrom = 1;
    this._fadeOut.alphaTo = 0;
    this._fadeOut.duration = 1000;
    Component_A.visible = true;
    Component_A.setStyle("showEffect", this._fadeIn);
    Component_A.setStyle("hideEffect", this._fadeOut);
    then when I set Component_A.visible = false, the sequence
    works like following:
    Component_A.visible = true
    Component_A.visible = true, alpha = 100;
    Component_A.visible = true, alpha = 50;
    Component_A.visible = true, alpha = 0;
    Component_A.visible = false;
    The above sequence works visa versa as:
    Component_A.visible = false;
    Component_A.visible = true, alpha = 0;
    Component_A.visible = true, alpha = 50;
    Component_A.visible = true, alpha = 100;
    Component_A.visible = true;
    (Correct me if i am wrong)
    ========================================================================================== ====
    From what I observe from the application, I have two
    question.
    1) When more than one component using the this._fadeIn,
    this_fadeOut as the hide/show effects, the component in instance of
    this._fadeIn? will it mess out if more than one component using the
    fadeIn instance in the same time?
    2) from the third component, i.e. PictureHolder3, when I load
    other the picture , it fade out the new image instead of fading
    in... Seems there is problem if I hide show too frequent. I think
    when I hide then show right the way, the component only do the hide
    part...
    Can someone pls look into it and tell me what I did wrong?
    Cuz in normal practice I don't think appropriate to use ViewStack
    in Actionscript...

    Hello Jack,
    Currently, you can only import an swf file or you can embed videos from youtube, vimeo etc. into Muse / add HTML5 Video to Your Website.
    Take a look at these simple videos that explain the currently available processes for adding videos in Muse, in a step by step method:
    1. http://tv.adobe.com/watch/learn-adobe-muse-cc/inserting-a-youtube-flic kr-or-hulu-video/
    2. http://www.youtube.com/watch?v=5in4swnIFsw
    3. http://www.youtube.com/watch?v=KnBFLQheOk4
    Hope this helps.
    Cheers
    Parikshit

  • Basic question about Actionscript and symbols

    I like the object oriented features of actionscript (2.0).
    One thing confuses me tho, namely the combination of symbol classes
    and constructors. Since symbols can't be instanciated by new
    SomeMovie(...), but rather has to be created with attachMovie(), it
    seems to me that there is no use of constructors for symbols.
    Instead you have to send an init object in the attachMovie() call.
    This seems to me to be lacking in logic. It would be much more
    logical if you could do:
    var m = new MyMovie(constructor arguments...);
    destinationClip.attachMovie(m);
    Am I correct that this way of doing it is not possible in
    current actionscript?
    And second, don't you agree this would be a more consistent
    use of the actionscript language?

    First, I just wanna thank u for replying. I still have some
    follow up questions that I think are of interest:
    About the first issue of constructors u say they
    automatically gets called. But isn't it true that only a
    constructor that takes no arguments can be automatically called?
    Because, how could a constructor call with arguments MyMovie(x, y,
    size, etc), be automatically called? My point is, that it would be
    more neat to send the parameters thru the constructor, than thru an
    init object. Also, I wonder why u think constructors are error
    prone. Maybe they are error prone exactly because
    Flash/actionscript invites to an inconsistent way of initializing
    MovieClips and other object instances?
    Second, u say that attaching a class to a MovieClip should be
    avoided unless all or most of the functionality of the MovieClip
    Class is needed. I usually attach a class a MovieClip that needs
    some code to describe its behaviour. In practice, I think the only
    essential method that I need from MovieClip is the onEnterFrame().
    Are you suggesting that it would be better to skip onEnterFrame in
    individual objects, and rather loop over some array to make all
    objects get their command to do their thing? I thought the good
    thing about onEnterFrame was that I could avoid having to traverse
    arrays of objects, and instead let Flash itself call all objects
    that need to be updated each frame.
    Third, I would like to repeat the benefit of not having to
    create variable names as attachMovie requires. For instance, assume
    alot of clips are being attached to the same containing clip. Now u
    have to make sure that all attached clips get different variable
    names, or strange things will happen. But if attachMovie just took
    a reference to a clip as parameter u would avoid that problem.
    If u know some document that discusses these issues, i would
    be happy if anyone had a link to it. My suggestion to the Flash
    developers is to make MovieClip objects consistent with ordinary
    objects.

  • How to set an actionscript class runnable + some question?

    Dear all,
      i am new to actionscript (Flex 3).
      i am from java camp and i want to achive some java-style functionality in actionscript,and hope you can help me:
      1. how to set an actionscript class runnable??
          in java, i just add a "public static void main(String[] args)" method which will be the program entry point. (IDE, right click the class and click run)
          i can't set a plain, ordinary actionscript runnable in flex builder.
          To test the class, i have to create an mxml (which in turn invoke the testing class) and it be runnable in the flex builder 3.
          any other way to ease the testing?
       2. it there any good 3rd party library for datatype conversion ? (e.g. string <> date, the build-in DateFormatter don't accept milliseconds)...
           it seems actionscript come with limited such kind of utility function
       3. in a custom mxml component, which contains several controls (say testboxes, comboboxes)...etc,
           for information hiding/prevent others to change the child controls in the custom component, how can i hide the child control, not allow
           other code to access the child by  "Component.textbox1"....any scope modifier, e.g. protected, private...etc in mxml?
       thank you.
    ppk luk

    Hi Alex,
      for question 3:
      i just wondering if it is ok or not for better code/validation.....(and it follow the good
    information hiding principle?)
      if i write the component in actionscript only, i can set the child control with scope modifier
    'private' or 'protected'..so that the component user can't just use the dot syntax to gain
    access to the child control,
    e.g. MyComponent.childControlTextInputBox.value = "A";...
    i want to force user to use MyComponent.setInputBoxValue("A")...
    (e.g. in this method, i can do some checking/validate before passing to the textbox)
      this can enforce the data consistency in my custom UI component...
      there is no way to achieve the same effect in MXML?
    (e..g <mx:TextInput id="privateChildControl" accessScope="private" .../>)
      thank you..

  • Question about get web service result in actionscript and convert data format

    Hi, All
    I have question about how to get dataset from web services
    and put it in tree structure. I have 2 questions about this:
    1, How can I get data correctly in actionscript?
    I have no problem to get data by
    <mx:ArrayCollection id="acFolder"
    source="{mx.utils.ArrayUtil.toArray(MyGServices.getFolder.lastResult)}"
    />
    And display in datagrid.
    But when I try to use
    public function
    handleFolderContents(event:mx.rpc.events.ResultEvent):void{
    arData=mx.utils.ArrayUtil.toArray(event.result);
    acData=new ArrayCollection(arData);
    input.text=acData.getItemAt(0).id;
    Seems I can’t get data, it always say:
    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    2, how to convert data format
    I get data from web service and want to convert it to tree
    structure, as mention below:
    I get:
    <Array>
    <id>111</id>
    <Name>Production1</Name>
    </Array>
    <Array>
    <id>222</id>
    <Name>Production2</Name>
    </Array>
    Convert to:
    <mx:XMLList id="treeData">
    <node>
    <node label="Production1" data="111">
    <node label="Production2" data="222"/>
    </node>
    </node>
    </mx:XMLList>
    Please help me.
    Thanks.

    First, don't specify the package path in the argument
    declaration. Instead import the event object:
    import mx.rpc.events.ResultEvent;
    The docs state this emphatically.
    Second, try "lastResult", in place of "result":
    arData=mx.utils.ArrayUtil.toArray(event.lastResult); // I am
    not positive about this. I maybe recall reading that result was ok
    for the event object, but maybe not.
    Finally, why do you want to convert the xml? You certainly
    could, but it would be a manual process, recursively reading the
    existing xml nodes and building the new structure, but again, why?
    Just use a labelFunction if necessary to display the nodes as
    you wish.
    Tracy

Maybe you are looking for

  • Moviebox DV no longer works with 10.6.7

    I last transferred videos from my VCR to my iMac using my Pinnacle MovieBox DV about 18 months ago. The MovieBox DV was connected to a 400 Mbit FireWire port. Back then I had Mac OS X 10.5 on the iMac. The iMac now runs Mac OS X 10.6.7, but the hardw

  • Acrobat XI Pro not launching in win7x64

    I've installed Acrobat XI Pro via the Creative Cloud App Installer, it has a green check and says Up to date. When i try to run the program, an error dialouge pops up immediately: [Window Title] E:\Program Files\adobe\Acrobat 11.0\Acrobat\Acrobat.exe

  • FI,Post Customer Down Payment

    can any one give me the BAPI for POST CUSTOMER DOWN PAYMENT : HEADER DATA transaction F-29 and BDC program for poasting the same?

  • Best dual monitor setup (or should I say best value)

    Hello All, As I've shared before, I run a non-profit, but have a background in film. I purchased all of the necessary equipment to shoot and edit our own mini documentaries on our work. I've been doing it for about 6 months now. The results are extre

  • My pc is infected and i want to download firefox and cant do it

    my pc is infected and cant download anything,it also locks up constantly and i lost 20% of my speed.