Announcement
Collapse
No announcement yet.
WidgetInitialized in Scaleform 4 (AS3)
Collapse
This is a sticky topic.
X
X
-
Matt Doyle repliedI can't support Vectorian unfortunately, and I don't believe you can use CLIK with Vectorian.
Leave a comment:
-
NoxRequiem repliedHi guys, thanks for this update it clears up my current brick wall but I've only been able to make a crack in it.
I'm pretty sure my issue deals with the fact that I'm using the Flash Develop/Vectorian Giotto mix and AS2.
-I'm not sure if AS3 works with Vectorian Giotto (reason for my AS2 use, I started working on this yesterday so I'm still learning XD)
Anyways I got the ExternalInterface call to work within my AS2 code for my SWF but when I logged the Widgetname back in UnrealScript it's getting none as it's input, I'm not sure how that is happening since I'm passing the buttonName in the ExternalCall. So here are small clips of the mentioned code XD:
FlashDevelop AS2 externalcall:
ExternalInterface.call("WidgetInit", "TestButton", "this.TestButton", _root.TestButton);
UnrealScript default properties:
WidgetBindings.Add((WidgetName = "TestButton", WidgetClass = class'GFxCLIKWidget'))
UnrealScript WidgetInit:
// Callback automatically called for each object in the movie with enableInitCallback enabled
function WidgetInit(string WidgetName, string WidgetPath, GFxObject Widget)
{
`log("WidgetName: ");
`log(Widgetname);
//Determine which widget is being initialized and handleit accordingly
switch(Widgetname)
{
case ("TestButton"):
`log("BBQ");
`Log("!!!!!!!! Widget = "$Widget);
`Log("!!!!!!!! GFxCLIKWidget(Widget) = "$GFxCLIKWidget(Widget));
//save reference to the button
// the Widget is a cast to a GFxCLICKWidget to allow for event listeners - see WidgetBindings and ****!!!
TestButton = GFxCLIKWidget(Widget);
// Add a delegate for when this button is clicked
TestButton.AddEventListener('CLIK_press', CloseMovie);
break;
default:
break;
}
}
Update:
So the script log is returning:
!!!!!!!! Widget = GFxObject_0
!!!!!!!! GFxCLIKWidget(Widget) = None
I'll keep trying but I'm not sure if it's something I'm doing or just the tools im using
Leave a comment:
-
AAWsome repliedOriginally posted by Matt Doyle View PostUPDATE: As of January 2012 UDK, WidgetInitialized & Event Listeners are back!
We were using the December version and wondered where the enableInitCallback tickbox inside the components were... But with the latest build we could happily extend the components there and (re)created out component libraryAll callbacks work now in AS3.
Leave a comment:
-
Matt Doyle repliedAs of January 2012 UDK, WidgetInitialized & Event Listeners are back!
Leave a comment:
-
Bob_Gneu repliedThat file does not exist any longer. You will find that the ActionScript version is now added into the pathing.
You may be able to play with the event labels, it has been renamed to buttonPress in AS3.0 land. 2.0 is still standard.
scaleform.clik.events.ButtonEvent
Code:public static const PRESS:String = "buttonPress"; public static const CLICK:String = "buttonClick"; public static const DRAG_OVER:String = "dragOver"; public static const DRAG_OUT:String = "dragOut"; public static const RELEASE_OUTSIDE:String = "releaseOutside";
Leave a comment:
-
Omar007 repliedDidn't the event names change in the December UDK? I believe I read something like that in another topic...
I can't check it myself atm but all the event names (types) should be found here: [PATHTOUDKFOLDER]/Development/Flash/CLIK/gfx/events/EventTypes.as
Leave a comment:
-
Bob_Gneu repliedIt doesn't work, but you can go the other route for now, Hook in the event listener on the actionscript side and when it gets executed use the externalinterface.call route to get back to unreal script.
Leave a comment:
-
mrjingles75 repliedPlease can we get an update on this issue? AddEventListener is not working on AS3 GFxWidgets in the UDK December 2011 beta.
Leave a comment:
-
Hades_ repliedI get WidgetInitialized called.
But then when I add an event listener for buttonPress on my button, the event doesnt happen when I click the button :/
Leave a comment:
-
Meardon repliedHi, I have an issue here.
Code:function WidgetInit(string WidgetName, string WidgetPath, GFxObject Widget) { switch(WidgetName) { case ("program"): `Log("!!!!!!!! Widget = "$Widget); `Log("!!!!!!!! GFxMyClass(Widget) = "$GFxMyClass(Widget)); } } defaultproperties { WidgetBindings.Add((WidgetName="program",WidgetClass=class'GFxMyClass')) ... }
Leave a comment:
-
WidgetInitialized in Scaleform 4 (AS3)
UPDATE: As of January 2012 UDK, WidgetInitialized & Event Listeners are back!
WidgetInitialzied() is not currently working in the Nov 2011 UDK integration of Scaleform 4. It should be in the next release of UDK however, as the fix has been completed but not included in the current release.
Until then, you can use potential workarounds such as ExternalInterface.call() or FSCommands to notify Unreal that a CLIK widget is on the stage. For example:
In ActionScript 3:
Code://parameter 1 = button instance name //parameter 2 = button path //parameter 3 = button instance name (without quotes) ExternalInterface.call("WidgetInit", "myAS3Button", "this.myAS3Button", myAS3Button);
Then in UnrealScript:
Code:var GFxObject MyAS3Button; function WidgetInit(string WidgetName, string WidgetPath, GFxObject Widget) { switch(WidgetName) { case ("myAS3Button"): MyAS3Button = Widget; SetWidgetPathBinding(MyAS3Button, name(WidgetPath)); break; default: break; } } defaultproperties { WidgetBindings(0)={(WidgetName="myAS3Button",WidgetClass=class'GFxClikWidget')} }
Tags: None
- Stuck
Leave a comment: