Dynamically load content in NavigatorContent inside Viewstack

Thanks for help.

Question:

How do I dynamically load components or inside a NavigatorContent buttons when the user clicks on the

Label NavigatorContent appropriate within the viewstack located inside the TabBar component?

Code example...

< s:Scroller id = "scrollerHome" includeIn = "Home" x = "3" y = "8" width = "933" height = "584" >

< s:VGroup width = '100 percent"height ="100% ">

< s:TabBar dataProvider = "{viewstackHome}" / >

< mx:ViewStack id = "viewstackHome" width = '936' height = '553' >

< s:NavigatorContent width = '100 percent"height ="100% "label ="Tab 1">

.

.

.

< / s:NAvigatorContent >

< s:NavigatorContent width = '100 percent"height ="100% "label ="Tab 2">

< / s:NavigatorContent >

.

.

.

< / mx:ViewStack >

< / s:TabBar >

< / s:VGroup >

< / s:Scroller >

When the user click on Tab1 or Tab2 depending on the time of day I want to

display a different set of components which vary in number.

Is there something that I need to manage, if so how. I could not find in these objects.

Other suggestions are also welcome.

Thank you

Jumroo

Since it's content browser, all components are created automatically the responsibility of the application that they do not obey the creationpolicy.

1st way: I could intercept the events of "hide" / "show" on the content of navigator to listen to the event and dynamically add child elements.

2nd way: Instead of Viewstack I'll go with the States of the spark.

and on creationComplete of these components you can manage it that display and what not to do.

Tags: Flex

Similar Questions

  • Get the dynamically loaded movieclip content

    Hey,.

    After trying without success to get the totalframes to a .swf dynamically loaded in AS3, I regressed to AS2.

    Now, I can add the clip and get the totalframes of content, no problem.

    The problem is that I can't resize the content at all.
    I have no idea how to target the loaded content.

    Here is the code I use:

    var myXML:XML = new XML();
    var path:String;
    var mcl:MovieClipLoader = new MovieClipLoader();
    var mclm:MovieClipLoader = new MovieClipLoader();
    var mclL:Object = new Object();
    var frames:Number;
    var i:Number = 0;
    var mc:MovieClip = new MovieClip
    myXML.ignoreWhite=true;
    myXML.load("content.xml");
    
    holder_mc._alpha = 0;
    
    myXML.onLoad = function(xmlLoaded){
    menu();
    load();
    }
    
    
    
    mclL.onLoadComplete = function() {
              frames = (MovieClip(holder_mc)._totalframes);
              if (frames == 1) {
                   image();
              }
              else if (frames > 1) {
                   clip();
              }
         }
    
    load = function(){
         clearInterval(timer);
         path = myXML.firstChild.childNodes[i].childNodes[1].childNodes[0].nodeValue;
         mcl.loadClip(path, holder_mc);
         var tFiles:Number = myXML.firstChild.childNodes.length;
         if (i < tFiles){
              i++;
         }
         else if (i == (tFiles)){
              i=0;
              load();
         }
         mcl.addListener(mclL);     
    }
    
    image = function() {     
         seconds=1000;
         holder_mc._alpha = 100;
         timer = setInterval(load, seconds);
    }
    
    clip = function() {     
         holder_mc._alpha = 100;
         ftimer = setInterval(checkFrames, 100);
    }
    
    checkFrames = function() {
              frame = (MovieClip(holder_mc)._currentframe);
              if (frame==(frames-1)){
                   clearInterval(ftimer);
                   load();
              }
         }
         
    menu = function(){
         
         var tFiles:Number = myXML.firstChild.childNodes.length;
         for (me=0; me < tFiles; me++){
         path = myXML.firstChild.childNodes[i].childNodes[1].childNodes[0].nodeValue;
         i++;
         _root.attachMovie("circle", "circle"+me, me, {_x:(me*30), _y:330});
         mclm.loadClip(path, ("circle"+me));     
         }
         
    }
    

    I need to resize the content as well for the main holder_mc, as well as for menu items.

    Use onLoadInit():

    mclL.onLoadInit = function(target:MovieClip) {          frames = target._totalframes;          if (frames == 1) {               image();          }          else if (frames > 1) {               clip();          }// size target here     }
    
    
    
  • App Builder with dynamically loaded VI - please help

    Hello

    Please take a look in the ZIP file attached with the sample project. The appellant load sub dynamically. This works well in the development environment (LV 2011) but when I build the EXE, it stops working. Please take a look; Ideally, repost fixed project in this thread, others to take advantage of the way to solve this problem...

    Thank you!

    JorgeinSD

    Hi Jorge,.

    This is the problem of the ususal: in the executable path to your dynamically loaded VI Exchange.

    You have defined to be included in the executable. If the path passes to Appdir\DynLoad.exe\LoadMeDynamically.vi, but you try to open the path AppDir\LoadMeDynamically.vi...

    Options:

    -check the execution (by the property node) environment to decide which way to use

    -change the location of the VI to "support the directory", this will be a folder named 'data' next to your executable file. Call the VI of this folder. You can do the same thing inside your project to have the same calling conventions in the development and runtime environment...

  • Dynamic loading videos - how to integrate data from json files in video placeholder at the stage

    Hello!


    Working on a site where I want to display a variety of videos. Found a tutorial with a good script for loading dynamically the contents of a json file.

    $.getJSON ("data / press.json", function (data))

    {

    for (var i = 0; i < data.length; i ++)

    {

    var s = sym.createChildSymbol ("slide", "Stage");

    s.$("photo"). CSS({"background-image":"URL('"+Data[i].image+"')"});)

    s.$("title").html (Data [i] .title);

    s.$("headtext").html (Data [i] .headtext);

    s.getSymbolElement () .css ({"location": "absolute",})

    "the left": "50px",

    ({'top': I * 200 + 50 + 'px'});

    }


    The json file content looks like this,


    [

    {

    'image': "images/poster_.jpg,"

    "title": "my test."

    "date': 'my date."

    "headtext": "my text",

    'video': "http://www...".

    },

    ]


    Unfortunately, there is nothing of video in the above script.

    Anyone know how I can,


    1 / choose my "video" variable data in my json file (guess the script needs a line like: s.$("video").html (data [i] .video);)     or something)

    2 / dynamically put in my video placeholder where my video script of the show is.

    -----

    YouTube var = $("< iFrame/>");

    var url = " " https://www.YouTube.com...; "


    SYM.$("video"). Append (YouTube);

    YouTube.attr ('type', ' text/html');

    YouTube.attr('width','640');

    YouTube.attr('height','360');

    YouTube.attr ('src', URL);

    -------

    Most grateful for any advice

    Best regards

    Bengt, informel.se

    Looking at the code of the success of your JSON Manager, it seems that you want to create a list of these items on stage with several video clips too. You can create the iframes required in success of the JSON Manager and set the src attribute according to the video attribute of the incoming JSON data. An approach could be as follows:

    $.getJSON ("data / press.json", function (data))

    {

    for (var i = 0; i)

    {

    var s = sym.createChildSymbol ("slide", "Stage");

    s.$("photo"). CSS({"background-image":"URL('"+Data[i].image+"')"});)

    s.$("title").html (Data [i] .title);

    s.$("headtext").html (Data [i] .headtext);

    s.getSymbolElement () .css ({"location": "absolute",})

    "the left": "50px",

    ({'top': I * 200 + 50 + 'px'});

    Assuming that you have a video called placeholder in the slide of symbol

    var YouTube is $("").attr('width','640').attr('height','360');.

    YouTube.attr ('src', Data [i]. Video);

    s.$("video").html (YouTube);

    }

    }

  • Dynamically loaded Bitmapdatas zip are not approved locally and therefore cannot be changed

    It is a very strange problem.

    I use external resources to a game that I do. One of the resources is a zip file containing 100 images (thumbnails). The goal of this zip is simply that he would load these resources much easier, simpler and as I am storing these resources on Amazon S3, significantly cheaper.

    He worked without a hitch, until I moved and ran the swf in a location not approved.

    Now, when I try to load the first thumbnail I get this:

    Charger/get content())

    SecurityError: Error #2148: SWF file file:///C|/Users/Tom/Desktop/Jigsaw.swf cannot access the resource local file:///C|/Users/Tom/Desktop/Jigsaw.swf/[[DYNAMIC]]/1. Only SWF files local local - with system files and trust can access local resources.

    This happens when I try and access Loader.content, I need to do what some bitmapdatas will have to be changed after loading.

    I ran into a similar error when you try to originally load external resources and convert them into bitmapDatas. This has been fixed by using a policy file.

    I thought the policy file was the problem, but then I tried to integrate the .zip in the swf file rather than load it externally, like this:

    [Embed (source = "... / res/images/thumbnails.zip", mimeType = "application/octet-stream" "")]

    But even that threw up the same error.

    What is happening is that a byteArray is skillfully transposed in a BitmapData, but in the process, it becomes not approved by Flash.

    I can't find any way to convert this byte.

    I tried using several different class zip as3 packages, but they all fall into the same obstacle.

    Here's the key code:

    zip: FZip var = new FZip();

    zip.loadBytes (zipData);

    var file:FZipFile = zip.getFileByName ("image1.jpg");

    var loader: Loader = new Loader();

    loader.loadBytes (file.content);

    root.addChild (loader);

    loader.addEventListener ("click", Function {}

    var bd:BitmapData = e.target.content.bitmapData;

    bd.applyFilter (bd, bd.rect, new focus(), new BlurFilter (20, 20, 1));

    } );

    This is the part that is really weird... When I test it, it works fine, when I download online, very well. The only time I get the error is when the SWF file is run locally, but in an untrusted location.

    Obviously, these security measures are a bit blurry if it works without a hitch in line, but does not on-site, expect that it is the other way around.

    As far as I know there's nothing potentially dangerous with my code. It is from a trusted location (the policy file works).

    I found another unfortunate person who encountered the same problem, but never got a response:

    http://www.ActionScript.org/forums/showthread.php3?t=261853

    I've tried EVERYTHING. bitmapdatas loaded dynamically zippers are unmodifiable without apparent reason... unless the swf is opened in a trusted location or anywhere online.

    If you want your trusted local files, it adds trust files setting: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.htm l

  • How can I dynamically load swc files using as3? (without relying on the Flash IDE).

    How can I dynamically load swc files using as3? (without relying on the Flash IDE).

    The SWF file can be used in the same way as the CFC, which means that you don't need to "visually show" anything when it is loaded. Your code can use the classes and assets incorporated into the SWF, just as a SWC file. So if someone just to load the SWF file to see what was in it that they see nothing. They could however access programmatically to what anyone on the inside just like you, if they went to that level. But it is not as easy as just racing as SWF to see what is inside.

    I hope that all packaging several separate sovereigns will allow you to load and unload only what you need to keep the RAM usage as low as possible with a minimum load SWF.

    If you are ready, please mark all useful/correct so we can filter without response. You're welcome and good luck!

  • play nested MC in dynamically loaded MC

    Hello

    I have a dynamically loaded movieclip. Inside of this, I have a movieclip (with a menu in it) that I want to play when the user clicks a button. I can't make it work. Help?

    check the option 'Allow debugging' in your publishing settings, so that we can see the error line number.

  • Content of NavigatorContent

    Hi all!

    Now, it's strange to me, but I can't access a real content of the ViewStack component. Here is the code:

    < mx:ViewStack id = "myViewStack" >
    < s:NavigatorContent id = "businessNavigator" >

    < business: BusinessOperator id = "businessOperator" / >

    < / s:NavigatorContent >

    < / mx:ViewStack >

    How can I access the element called businessOperator?

    I tried to add event listener to a viewStack:

    < mx:ViewStack id = "myViewStack" change = "myViewStack_changeHandler (event)" >... "

    And then:

    protected function myViewStack_changeHandler(event:IndexChangedEvent):void
    {

    var currentOperator = event.relatedObject;

    }

    But this brings me only to the businessNavigator, he's not happy.

    Tried to access businessNavigator.getChildAt (0), but it's only the instance of skin...

    Try getElementAt (0) instead of getChildAt (0)

  • totalFrames of dynamically loaded swf

    I tried for 2 days now to find the total number of images to a .swf dynamically loaded.

    Here is a code example:

    var loader:Loader = new Loader;
    loader.load(new URLRequest("mop.swf"))
    master_mc.addChild(loader);
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, xmlLoadedF);
    function xmlLoadedF(event:Event):void
    {
        trace(loader.content.totalFrames);
    }
    

    I am really puzzled.

    Any help would be greatly appreciated.

    I know it's old, but I found via google and thought I would correct the error.

    You can reference properties avm1 (and methods) swf using localconnection to communicate between SWFs avm1 and avm2, SWF SWF communication when two SWF files uses actionscript 3.0

  • What about dynamically loading cursor/radios within the grid

    I have a DataGrid and I use ItemRenderers to dynamically load components such as images and buttons it contains. Now, I wanted to know if its possible to load a cursor or even a radiogroup based on values that the datagrid receives dynamically. If a cursor is used it must be calibrated with data it receives from the dataProvider on the grid. Similarly, if a group of radio buttons is used, I should be able to make number of radios based on data provided to datagrid.

    I essentially build an application for image search, where I want to give a slider or radios (within each row of the datagrid control) with different sizes in which the same image is available. The user must be able to choose a size, and then continue with the procedure continues.

    Let me know if this is possible. Thank you.

    Very well. Then you will probably need to specify e4x for the HTTPService resultFormat property and then use the e4x syntax to get these channels.

    http://livedocs.Adobe.com/Flex/3/HTML/Help.HTML?content=13_Working_with_XML_03.html

    If this post has answered your question or helped, please mark it as such.

  • Jpg smooth dynamically loaded in AS2

    Simple problem, but the answer baffles me. I spent half a day looking for solutions to this issue, but nothing works for me.

    Here's the problem:

    I'll put up an online photo gallery. I'm trying to make it easy for the customer insert specific images, loaded dynamically, ask them to appear at 63 percent. If the user clicks on one, she grows to 100 percent. Problem is when the image is at 63%, it is not smooth and looks terrible,

    All posted online BitmapData class solutions work for individual images. But I can't understand how to automate the process in a loop for. At this point, I'm not even concerned about enlargement. I want just the images to load at 63 percent and smooth look.

    Here is the code for both images. Later, I'll expand this to 25.

    On the stage are two rectangle of color video clips: toon1 and toon2. I want the dynamically loaded jpegs to load inside of them. The customer will be manually change the last lines, whenever she feels like it, to choose what are the images to load.

    What I need is an elegant AS2 solution where everything dynamically loaded jpeg will be smoothed.

    ------------------------------------

    for (i = 1; i < = 2; i ++) {}
    This ["Toon" + i] .createEmptyMovieClip ("Cartoon", this.getNextHighestDepth ());
    This ["toon" + i].cartoon._xscale = this ["toon" + i].cartoon._yscale = 63;
    This ["toon" + i].cartoon._x = 8;
    This ["toon" + i].cartoon._y = 9;
    }

    toon1. Cartoon.loadMovie ("0025.jpg");
    toon2. Cartoon.loadMovie ("0054.jpg");

    ------------------------------------

    Please do not suggest xml or AS3 solutions. Those that are incomprehensible to me. If anyone has an elegant solution to AS2, I'll be most grateful.

    var OL: Object = new Object();
    lo.onLoadInit = function(target:MovieClip) {}
    target.forceSmoothing = true;
    }
    var mcl:MovieClipLoader = new MovieClipLoader();
    mcl.addListener (lo);

    ------------------------------------

    for (i = 1; i<=2; i++)="">
    This ["Toon" + i] .createEmptyMovieClip ("Cartoon", this.getNextHighestDepth ());
    This ["toon" + i].cartoon._xscale = this ["toon" + i].cartoon._yscale = 63;
    This ["toon" + i].cartoon._x = 8;
    This ["toon" + i].cartoon._y = 9;
    }

    mcl.loadClip ("0025.jpg", toon1);

    mcl.loadClip ("0054.jpg", toon2);

    toon1. Cartoon.loadMovie ("0025.jpg");
    toon2. Cartoon.loadMovie ("0054.jpg");

    ------------------------------------

  • Dynamic html content in a film?

    Hello
    Can someone tell me if it is possible to dynamically load an HTML file into a flash movie without opening the content
    in a separate browser window? that is to load the HTML code in a container in the window of the film itself. The name of file real HTML itself could be hardcoded in the film if that helps...

    I am totally new to Flash and Action Script, but am a developer, so go figure if you can point even just me to an API.

    Thanks in advance.
    Brian

    Thanks for the quick reply by the way.

  • How to query a Subvi dynamically loaded to its input terminals names?

    Hello

    I have an application where I use dynamically load the Subvi and I need a way to query the Subvi for its names of input terminals.  I'll use several different Subvi now and in the future and will not experience the terminals.

    Any help would be greatly appreciated.

    Thank you in advance!

  • Impossible to find dynamically loaded VI

    I am updating a code of LV6.1 to LV2011. The application works well before you build it and install it on another machine. When I install and run it on the other machine, it tries to open a file of reference, but it can not find a VI named DSA8300.vi. I get the following error message.

    Reference VI opened in InitScope.vi-> PATAR.vi->

    Path of the VI: c:\PATAR3.0.2\Range_RC3\Plugins\Scopes\DSA8300.vi<\b>

    Built Application or shared library (DLL): ensure that all loaded screws dynamically were correctly included in the specification for the application or a shared library build.

    But I checked the properties of my generation, and the file has been correctly included in the specifications of construction as a dynamic VI. What else can I check?

    Thank you very much.

    This thread can be useful.

    http://forums.NI.com/T5/LabVIEW/can-t-find-my-dynamically-loaded-VI-path/m-p/1124341/highlight/true#...

    Have you tried searching the forum for you the question?  There are others.

  • Return of dynamic loading vi loses focus

    Following the example of NI Loader.vi dynamic, my vi charge, runs and returns properly.  Howerver, when you use the same code to call from my main program, vi of the same load and runs, but in return, emphasis is not on the original vi.  A click of the mouse on the screen is necessary for the development of restoration.  Given that my program is heavilly keyboard based, it is a nuisance, and users may think that the program froze.

    Looking at the appearance of the window, showed that, in the Example.vi of dynamic load display front panel and narrow Panel have been verified.  These were not checked in my program.  When activated, this seemed to solve the problem.

    It seems that the first vi needs both to take focus on return of a vi loaded dynamically.

    Thanks for the tips.

Maybe you are looking for