Announcement

Collapse
No announcement yet.

access variables from an external SWF (Issues Probably Quite Simple)

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

  • replied
    i guess UDK assumed 100 as an integer rather than a float in RootMC.SetFloat("SoundSliderSoundFx", 100); have you tried 100.0 instead?

    Leave a comment:


  • replied
    has nobody have an idea?

    Leave a comment:


  • access variables from an external SWF (Issues Probably Quite Simple)

    Its quite simple even though i clearly defined it as a Number I.E a float in flash it prints out this error. :*(. Im trying to make a volume slider and connect it to a config float

    Tutorial gotten from http://udn.epicgames.com/Three/GFxVariableAccess.html

    Part of my Flash File

    Code:
    _global.gfxExtensions = true;
    import gfx.controls.ButtonGroup;
    import flash.external.ExternalInterface;
    import gfx.controls.Slider;
    import gfx.core.UIComponent;
    
    var SoundSliderSoundFx:Number = 0.5;
    
    startDrag("cursor_mc", true);
    // time to trace :D
    trace("init");
    
    // Slider 1
    soundslider.addEventListener("change", this, "soundslideronchange");
    function soundslideronchange(event:Object):Void 
    {
    	
    	SoundSliderSoundFx = soundslider.value;
    	lbl1.text = SoundSliderSoundFx;
    	ExternalInterface.call("UpdateSoundSoundFx");
    }
    
    //lbl1.text = slider1.value;

    Unrealscript Part

    Code:
    
    /** 
     *  Configuration method which stores references to _root and
     *  _root.manager for use in attaching views.
     */
    final function ConfigFrontEnd()
    { 
    	
    	
    	RootMC = GetVariableObject("_root");
    	soundSliderSoundFx = RootMC.GetFloat("SoundSliderSoundFx");
    	`log("##### soundSliderSoundFx:"@soundSliderSoundFx);
    	
    	
    	mainmenu_title =  GetVariableObject("_root.mainmenu_title");
    	
    	
    	`log("Testing Values"@btnNewGame_mc @mainmenu_title @RootMC );
    	
    	
    	bInitialized = TRUE;
    
    	RootMC.SetFloat("SoundSliderSoundFx", 100);
    	`log("##### MyString changed to: "@RootMC.GetFloat("soundSliderSoundFx"));
    	
    }
Working...
X