Difference between revisions of "User:Scrivener07/Menus"

523 bytes added ,  13:31, 11 November 2018
Mentioned `onF4SEObjCreated`
imported>Qazaaq
(object type is an array)
imported>Qazaaq
(Mentioned `onF4SEObjCreated`)
Line 1: Line 1:
These are my notes and findings about Actionscript 3 & Scaleform in Fallout 4.
These are my notes and findings about Actionscript 3 & Scaleform in Fallout 4.


== F4SE ==
== F4SE ==
[[:Category:F4SE|F4SE]] will install a code object to the root of any registered menu.
[[:Category:F4SE|F4SE]] will install a code object to the root of any registered menu.
To acquire the F4SE code object in AS3, use <code>(stage.getChildAt(0) as MovieClip).f4se</code>.
To acquire the F4SE code object in AS3, use <code>(stage.getChildAt(0) as MovieClip).f4se</code>.
It is a good idea to wrap calls to the F4SE code object in a Try/Catch block.
 
 
There are some cases when the installed F4SE code object on a menu root may be unreachable from your display object class.
With [[:Category:F4SE|F4SE]] v0.6.8 and greater the code object may be received by implementing the <code>onF4SEObjCreated</code> function on your display object class.
This function is called on the menu root document as well as first-level children.
 
<source lang="actionscript">
package Shared.F4SE
{
public interface ICodeObject
{
function onF4SEObjCreated(codeObject:*):void;
}
}
</source>


==== Code Object ====
==== Code Object ====
It is a good idea to wrap calls to the F4SE code object in a Try/Catch block.
* <code>AllowTextInput : Function(allow:Boolean):void</code>
* <code>AllowTextInput : Function(allow:Boolean):void</code>
* <code>GetMembers : Function():void</code>
* <code>GetMembers : Function():void</code>
Anonymous user