No announcement yet.

initializing widgets

  • Filter
  • Time
  • Show
Clear All
new posts

    initializing widgets

    OK, please remember, I'm a total flash n00b.

    I need a whole bunch of widgets that are on different .. timelines? i think they are called.. to initialize all at the same time. I also need one of them inparticular to initialize before another specific one. (or I need to be able to access it in UnrealScript while the other one is initializing, specifically)

    how can I go about managing something like that?

    It would also work if I could reference specific widgets via UnrealScript before I get to their Init in flash .. not sure if that's possible, either

    If you want the Widgets on a different time line you will need to create scenes, off the top of my head there is a show>scenemanager or something like that i cant remember its early in the morning. That shows your scenes, then on the bottom left there is a create scene button this will give you a fresh timeline.

    In action script to get to the scene you time in for a buttton

      gotoAndStop("SceneName", FrameNumber);
    You have to call the ExternalFunction call include thing for each scene. and Sub scene.

    this is off the top of my head. Hope this helped

    Correction : its Window>OtherPanels>Scene or Shift+ F2

    At the top of the actions layer in the actions panel
    _global.gfxExtensions = true ;
    import flash.external.ExternalInterface;
    i forgot the actionscript for calling widgets


      Honestly, I'm not sure what you're answering, but I don't think it's the question I asked?


        Well tahts how you would get them on different timelines, since thats what you said. unless you meant differnt frames?

        class MyGFxMoviePlayer extends GFxMoviePlayer;
        var localized string           MyTitleString;
        var transient GFxObject                lbl_Title;
        event bool WidgetInitialized(name WidgetName, name WidgetPath, GFxObject Widget)
             if( WidgetName == 'TitleLabel' )
                  lbl_Title = Widget;
                  lbl_Title.SetText( MyTitleString );
                  return TRUE;
             return FALSE;
        this is how you initialize it. in unreal script

        i guess you can call it in unrealscript before you call it in flash. etc This is what i understand what you want to do.


          Right, except I need a whole bunch of them that are in different parts of the flash, to all be initalized at the same time .. say there's 4 tabs of stuff, i need to access something that's on one tab, while a different tab is in view.


            You should be able to access them by just calling its function for the different tabs, i don't know about tabs though, i did what you wanted to do with different layers and scenes etc.


              when the movie is loaded so is the scripts and functions from the whole movie unless what you are looking for will not be given a value until that section is played.

              For the item you will need to access just add the path to that variable as in 'root.tab4.thisitemMC'
              And you can give it a value by setting all variables in an action frame placed in the beginning of the movie using the same path.


                Just to chime in.... the thing is set up where each tab button is associated with a symbol. The symbol is a collection of different CLIKWidgets. The screen that contains the tabs is on the timeline of the main movie and accessed with 'gotoandplay'. So everything is inside of one movie.


                  The problem is, if a component, movieclip, or whatever does not exist on the current frame, you cannot do anything with it or to it. For all intents and purposes, it simply does not exist.

                  If you need to access these components, you will have to think of a different way to do this. Perhaps a layered approach, where all components exist at the same time, but clicking the various tab buttons toggles their visibility and toggles them enabled or disabled.


                    Is that a good and efficient way to do it Matt? I mean it will most likely work, and do what is desired visually, but is it a good way to go about it?


                      My philosophy has always been that the best way to do something is the way that works for you, and doesn't cause performance problems.

                      I don't understand though why you need to initialize components that don't currently exist on the screen.


                        theres a tab example fla to look at.

                        in the scaleform player take note of the log it spits out gfxobjects. get the root one.. like for the scene and from there you can ask the root to get sub gfxobjects for you.

                                case ('menu'):  
                                    if (ListMC == none)
                                        ListMC = GFxClikWidget(Widget.GetObject("list", class'GFxClikWidget'));   
                        this example gets an object scene called menu and i ask specifically to get a gfxobject called list (a subscene of menu with its own object) then i init what i need.

                        im guessing you need something similar.


                          Basically, you open the page, and it places an object on screen. As you choose options on the various tabs, it needs to do different things to that object. That all works great. The problem is, trying to reload it from saved state data, rather than from user input -- the user has to click through all the tabs, to get each tab's state to reload.

                          Rather than have a seperate function to load in the saved data, and set things up as needed, I figured it would be easiest to replay the selection clicks, considering that it needs to do that anyway, to have them all set in the UI (so that all the saved options are selected when you re-open the page, rather than having the selections all be default). Figured there was some way that I could gain access to these somehow, but I guess in addition to having it replay the selections on each tab when the tab is opened, i'll have to also have a seperate function for having the saved data take effect in the view window too.


                            im sure epics code does this but it uses views. id assume your tabs would also be views.

                            look at epics udkfrontend_view and udkfrontend_screen .uc files. they have a centralised flash file that loads other flash files into and off a stack, but the same principle should work for tabbed views if you have tab1 as a gfxobject (export for activescript and in frame1 and name it tab1, then next tab2 etc)

                            using the same principle you should also in theory be able to dynamically build tabs and tab pages prepopulated with controls.


                              Another potential simple way to handle it is to create an object in Flash:

                              if (!options) {
                              	var options:Object = {};
                              This object would live on a separate layer (named vars). This layer would have a single keyframe at the start of the _root timeline, and the options object would thus be alive for the entire timeline, no matter what frame you were on. It would hold all the values for each tab or screen.

                              You can then set it for example with:

                              options.bloom = bloomBtn.selected;
                              options.aa = aaBtn.selected;
                              And get from it with:

                              bloomBtn.selected = options.bloom;
                              aaBtn.selected = options.aa;
                              This is all done in Flash/AS. It is a simple method to be able to access the last known settings of a tab/view. See the tutorial file:

                              C:\UDK\UDK-2010-08\Development\Flash\CLIK\tutorial\CLIK_tutorial_s kinned.fla for more details.

                              I'm sure you could easily set this up so that the options object is set via UnrealScript too.