Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm trying to add a new element to the HUD, it's supposed to be a compass that should function like a minimap.

I've added this code to the main hud.swf:

var DcompassContainer:MovieClip = this.createEmptyMovieClip("DcompassContainer", this.getNextHighestDepth());
DcompassContainer._x = 280;
DcompassContainer._y = 8;
DcompassContainer.loadMovie("udk_compass.swf");

So far all is good, this is the information on the main MovieClip in Flash:

name directional
instence name directional
identifier directional
class com.scaleform.directional

In the class file:

import flash.external.ExternalInterface;
import gfx.core.UIComponent;

class com.scaleform.directional extends UIComponent {
    // The entities, layers and controls of the minimap
    public var directionshow:MovieClip;

    public function directional() {
        //
    }   

    public function configUI():Void {   
        // Register compass values with the app
        //
        // Params: 
        //          compass movieclip (this),
        //
        ExternalInterface.call("registerDcompassView", this);
    }   
}

In the GFxMinimapHud.uc I've added this code:

function registerDcompassView(GFxDcompass dc)
{
    GetPC().ClientMessage("DCopmass Registered");
    Dcompass = dc;
    Dcompass.Init(self);
    Dcompass.SetVisible(false);
    Dcompass.SetFloat("_xscale", 85);
    Dcompass.SetFloat("_yscale", 85);
}

After adding all SWFs to the content browser and running the game the SWF does appear on the screen, but the code is not working, I'm not getting the ClientMessage.

share|improve this question

1 Answer

Check this post on the epicgames forums

share|improve this answer
2  
That's not even a link and if it were it wouldn't make this an answer. – bummzack Jan 5 '12 at 23:15
What do you mean ?! It works ( just now !! ) – EmAdpres Jan 10 '12 at 17:51
2  
What I mean is that it's not a link that can be clicked and a link alone doesn't qualify as an answer. You should summarize what's it about or at least add the relevant keywords so that somebody can find more information if that link goes down. Currently your answers quality is even below the quality of a comment... – bummzack Jan 10 '12 at 17:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.