Announcement

Collapse
No announcement yet.

Getting variable information from external swf

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    Well, to be honest I don't know. It all depends on what exactly you are trying to do. If you can tell me what you're trying to do, then I can tell you what the best approach would be.

    Leave a comment:


  • replied
    It's a Flash button symbol. Didn't knew I can't do this with it ;] How should I do it then?

    Leave a comment:


  • replied
    Well, according to your code, the var "index" is inside Button1.

    ButtonIndex = GetVariableObject("_root.container.Button1");
    index = ButtonIndex.GetFloat("index");

    But, if its a standard Flash button, you can't even do this.

    Is it a CLIK widget or a Flash button symbol? What I need to know is...

    where is this line of code physically at?

    var index:Number = 0;

    It doesn't matter what layer it's on. I need to know what symbol it is inside.

    Leave a comment:


  • replied
    On container layer, with container movie_clip
    import flash.external.ExternalInterface;
    Button1.onRollOver = function()
    {
    ExternalInterface.call("ShowItemNameDesc1");
    }
    And there is a button, no matter where I put it, is it container movie clip, or layer, or another layer in _root.
    var index:Number = 0;

    Leave a comment:


  • replied
    Can you post your AS function?

    Leave a comment:


  • replied
    But GFx Object, from which I take this variable, is local too, in the same function. And I've tried to make it a global variable, and it still got me nothing.
    Mind you, I've got 2 gfxobjects where I set (instead of getting) a string Text value in the same function, and they work just fine.

    Leave a comment:


  • replied
    That could be it. Being a local variable means index is accessible only by that function. Nothing else can see it.

    Leave a comment:


  • replied
    Yup, ButtonIndex is a local float inside a function, that is running on mouseover event, called from AS. And index is a :Number variable. I tried to put it in several places and failed miserably every time. Even though I 'hacked it', and just made several functions instead of dynamic one, I'd still like to know the answer.

    Leave a comment:


  • replied
    You code looks correct. Are you sure there is an AS Number type variable called 'index' that lives inside Button1's timeline, which is inside the instance container, which is on the _root?

    And I assume you've declared ButtonIndex as a float?

    Leave a comment:


  • replied
    I've found somewhere that those bugs are generally connected to typos in variable names. I've rechecked it few times and everything seems correct. Anyone got some advice?

    Leave a comment:


  • replied
    And if I have variables nested? Like, I've got a Number variable inside a button, inside a movieclip. How can I take this value? When I try to do something like that:
    Code:
             ButtonIndex = GetVariableObject("_root.container.Button1");
             index = ButtonIndex.GetFloat("index");
             `log(" My index: "@index);
    My UDK crashes ;P
    Error is:
    Code:
    Critical: appError called: Assertion failed: gresult.GetType() == GFxValue:UT_Number [File:c:\depot\UnrealEngine3\Development\Src\GFxUI\Src\GFxUIMoe.cpp] [Line: 1183]
    I've tried putting button inside _root, instead of nesting it, and I've got the same problem still. Anyone had a similiar problem?

    Leave a comment:


  • replied
    why thank YOU! : D

    Leave a comment:


  • replied
    The ActionScript Variables

    Code:
    var MyString:String = "Something cool";
    var MyNumber:Number = 37;
    var MyBoolean:Boolean = true;
    The UnrealScript

    Code:
    var bool myBoolean;
    var string myString;
    var float myNumber;
    
    var GFxObject RootMC
    
    RootMC = GetVariableObject("_root");
    
    /* Get AS Vars */
    myBoolean = RootMC.GetBool("MyBoolean");
    myString = RootMC.GetString("MyString");
    myNumber = RootMC.GetFloat("MyNumber");
    	
    `log("##### MyBoolean: "@myBoolean);
    `log("##### MyString: "@myString);
    `log("##### MyNumber: "@myNumber);
    
    /* Set AS Vars */
    RootMC.SetBool("MyBoolean", false);
    RootMC.SetString("MyString", "Something AWESOME!");
    RootMC.SetFloat("MyNumber", 100);
    
    `log("##### MyString changed to: "@RootMC.GetString("MyString"));

    Leave a comment:


  • started a topic Getting variable information from external swf

    Getting variable information from external swf

    So in my buy menu i want to get a variable information from an external swf file, and im not sure how to go about that.

    If anyone has any suggestions thanks a bunch!
Working...
X