Permutation of position of list view for dynamic video clips

Hi all

I have a question that is difficult to explain. I have a class file that loads an external XML file, analyzes the main nodes in an array, and then creates a movie clip instance for each of the nodes, the text inside the movie clip based instance fields on the child nodes in the XML file.

Each added movie clip instance dynamically has a built in clip that acts as a tab. I have update the dynamic text of this integrated clip, based on the name of each main XML node.

Now, where I'm stuck, it's that I have attached an event listener to each clip tab which is created dynamically within the video clip. I want to do is when the user clicks on this tab have this movie clip will move to the top of the list of display on all other dynamically created movie clips. My problem is that I don't know how to get correct references.

When I create movie clips dynamically I store objects in a table. The problem seems to be that the event is triggered for a clip inside the dynamic clip so I don't know how to reference the clip parent. Maybe it's something else, but I don't know how to refer to the main movie clips that I want to switch.

I hope that makes sense. My main question is how can I use the swapChildren or setChild functions when you click the clip is in the clip I want to change in the display list as well as the fact that this clip is created dynamically.

Any help or advice would be appreciated!

Here is my code:

{classes package

flash.xml import. *;
import flash.display. *;
import flash.events. *;
flash.net import. *;
import flash.utils. *;
import flash.text. *;

public class estimatesheet extends Sprite {}

public var allEstimateSheets:Array = new Array();
public var allEstimateSheetsMC:Array = new Array();
public var textFields:Array = new Array();
public var startX:int = 5;
public var startY: int = 5;
public var field_increment:int = 15;
public var bg_increment:int = 50;
public var selected_tab:int = 0;

public void estimatesheet (file:String) {}

xmlLoader (file);

}

public void xmlLoader (file:String) {}
var loader: URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.TEXT;
loader.addEventListener (Event.COMPLETE, handleComplete);
Loader.Load (new URLRequest (file));
}

public void handleComplete(event:Event) {}
try {}
var allXml = new XML (event.target.data);

addChild (container);

Store each node parent to estimate leaf in the table
for (var i = 0; i < allXml.children () .length (); i ++) {}
allEstimateSheets.push (allXml.children ([i]));
createSheet (allEstimateSheets [i], i);
}

} catch {(e:TypeError)}
trace ("cannot parse for XML");
trace (e.message);
}
}

Create a timesheet for each node in the XML file
public void createSheet (data: XML, sheet: int) {}

Duplicate the clip estimateSheet for each node in the XML file
var estimateSheetBg:EstimateSheet = new EstimateSheet();
estimateSheetBg.x = 0;
estimateSheetBg.y = 0;
addChild (estimateSheetBg);
allEstimateSheetsMC.push (estimateSheetBg);
trace ("the sheet name:" + data.@name);
allEstimateSheetsMC [plug].bg.tab.tab_name.text = data.@name;
allEstimateSheetsMC (factsheet).bg.tab.addEventListener (MouseEvent.CLICK, tabClick);


For each sheet in the first estimate sheets move the tab down
if(Sheet>0) {}
allEstimateSheetsMC (factsheet).bg.tab.y += 25;
}

Analyze the XML child nodes
for (var i = 0; i < data.children () .length (); i ++) {}

Create dynamic text fields
var textFormat:TextFormat = new TextFormat ("Verdana", 11);
var textField:TextField = new TextField();
textField.setTextFormat (textFormat);
textField.text = data.child (i) .@label;
textField.border = false;

textField.x = startX;
textField.y = startY + field_increment;

startY = startY + field_increment;

allEstimateSheetsMC [sheet] .addChild (textField);

textFields.push (textField);

}

}

public void tabClick(event:MouseEvent):void {}

This function to share footage, essentially taking the selected_tab and exchange it with the one that was clicked
trace ("what is it?" + this.parent.name);

container.swapChildren (allEstimateSheetsMC [selected_tab], this.parent);


}

}

}

"this" trace and see what it gives you...

The "event.currentTarget" will identify the object with the event listener are entrusted to him.

Try tracing...

trace (this, event.currentTarget);

and see if they look like the same object.

Tags: Adobe Animate

Similar Questions

  • How can I list the instances of video clips if the clip that I am referencing is nested?

    Hello world

    It's me again and I am running into a problem. So I have this clip which is nested in several video clips. I mean Flash to perform an action when this clip from movie hits another video clip in the main timeline. It's just a collision for a game detection using the hitTestObject code. I was thinking of using MovieClip (root), but that won't work because it is so nested. Can someone help me? I would like to know if I need to explain more. Thank you!

    -DJ

    I didn't ' think I can help you without having to upload your file to see what you're doing and I don't download and fix the files unless I'm hired.

    Maybe someone else you download your fla and you help.

  • List view for the Finder El Capitan (10.11.39)

    Hi all

    The gap (if he is) is the following:

    The small triangle on the left of a folder that is used to open the corresponding folder is not available in some windows and is available in other windows. Please look at the screenshots. In this example "PDF Documents" is at the root of a volume, and "Disk Warrior" is a subfolder of "PDF".

    Thank you for your help.

    If you have a defined in this window arrangement, triangles do not appear. Use the menu command button on toolbar, or view options to define the available votes to zero.

  • issue dynamic video clips

    The following number of plots X code points on an image for me.

    All the data is already loaded and the points to draw correctly. The problem that occurs is that the last works of reversal. All the others do not work.

    Can someone please tell me what I'm doing wrong?

    Thank you.

    You are right. you have the name of the various bodies.

    for 2, you can use:

  • View and play video clips at random.

    Hi followers!

    I am trying to put 6 video clips in a table and to access randomly so that when you press a button on a movieclip appears and plays randomly.

    All MCs are in a setting with this code:

    Stop();
    BLK1._visible = false;
    blk2._visible = false;
    blk3._visible = false;
    ppk1._visible = false;
    ppk2._visible = false;
    ppk3._visible = false;

    storeCartons = new Array();
    storeCartons = (blk1, blk2, blk3, ppk1, ppk2, ppk3);

    startButton.onMouseUp = function() {}
    trace (MyNumber);

    myNumber = Math.floor (Math.random () * 7) + 0;
    activeCarton = storeCartons (myNumber);
    activeCarton._visible = true;

    }
    How can I get it work?

    Here is the updated code.

    Stop();
    BLK1._visible = false;
    blk2._visible = false;
    blk3._visible = false;
    ppk1._visible = false;
    ppk2._visible = false;
    ppk3._visible = false;

    storeCartons = new Array();
    storeCartons = [blk1, blk2, blk3, ppk1, ppk2, ppk3];

    startButton.onRelease = function() {}
    myNumber = Math.floor (Math.random () * storeCartons.length);
    trace ("myNumber" + myNumber);
    activeCarton = storeCartons [myNumber];
    activeCarton._visible = true;

    };

  • The maximum size of the text entered in the field "Search" the list view

    I created an APEX 5.0 application using theme 51. I have a simple list view for which the function 'Enable search' is checked.

    I want to limit the length of the "search string" in the field "search". How can I do this?

    There seems to be no limit on the size of the string in the search field. Enter a very large string in this field and submitting research causes APEX return an "Internal Server" error

    CITY

    Hi Michael,

    the amount of data entering your users? Because the limit should be 32 KB.

    Unfortunately, the search field is generated by the jQuery Mobile framework so we do not really have control of a limit, but you can specify the static 'ID' attribute in your area in order to "myListView" and then add the following code to your page "Run when the page loads" level attribute

    $( "#myListView input[data-type=search]" ).attr( "maxlength", 255 );
    

    But I doubt that this is necessary. Can you please post a screenshot of your error message "internal server".

    Concerning

    Patrick

  • display list view

    Hi all

    I use apex 4.2 on oracle 10g on windows using internet explore.

    I have a vision on 3 tables.

    I want to create a page with the list only, I mean without form.

    now, I have two problems.

    1. the list view cannot be created without form.

    2. when I create list with the form view, he asks to provide either the row id to use as the primary key, or a primary key column. I select the rowid. When I run the form, it generates the following error message

    so I want to know if there is anyway I could create the formless list view and on the other, how to fix the above error?

    Thank you.

    Maahjoor wrote:

    I use apex 4.2 on oracle 10g on windows using internet explore.

    USER INTERFACE? Theme?

    I have a vision on 3 tables.

    I want to create a page with the list only, I mean without form.

    now, I have two problems.

    1. the list view cannot be created without form.

    2. when I create list with the form view, he asks to provide either the row id to use as the primary key, or a primary key column. I select the rowid. When I run the form, it generates the following error message

    so I want to know if there is anyway I could create the formless list view and on the other, how to fix the above error?

    Do you mean a jQuery Mobile Listview or use non-standard terminology to refer to another component?

    If it is a list view for a mobile application, it looks like you create it using the Page create [jQuery Mobile Smartphone] > form > form on a Table with the list view option in the wizard, which, unsurprisingly, will result in the creation of a form. Use the to create a Page [jQuery Mobile Smartphone] > report > List View Wizard option instead.

    If you don't want a jQuery Mobile Listview, then clearly explain what components you are actually referring to, the exact steps that you use to create and refrain from using this confusing terminology in the future.

  • Social media for list views Blog buttons

    I would like to put on my blog social media buttons, so that users can share the position in the list view. When I actually adds these buttons they share in fact any page where the list is located, rather than the part of this post. Anyone have this problem? All solutions?

    Use the url for the blog tags, you must define the social links to those URLs and not run by default where it will be the page as your conclusion.

  • PLSQL call for list view

    Hello

    Apex 4.2 - Mobile application

    I want to call a procedure in a list view lspq.

    This is a list of objects and then for the user final should be able to mark an item as a favorite.

    I thought about the following approach:

    the target of the link allows you to call a piece of javascript:

    the target of the link: javascript:AddFavo();

    "' link resulting: <a href="javascript:AddFavo();" Class= "interface user-link-inherit' > '.

    at the page level:

    JavaScript-> function and global variables declaration

    function AddFavo() {}

    Alert ("add to Favorites");

    $.event.trigger ("AddFavoEvent");

    }

    Dynamic action

    Event: Custom

    Custom event: AddFavoEvent

    Selection type: DOM object

    DOM object: document

    Condition:-no Condition

    Action: run the plsql code

    Unfortunately, this does not work.

    Javascript does not occur and therefore the dynamic action is not

    Does anyone have an idea how to solve this problem?

    Thanks in advance

    Sincere friendships Erik

    Hi Erik,

    The alert will? It all looks correct, it should be.

    Check your console if there are errors. If a JavaScript elsewhere on the page gives an error none of the javascript code will not work.

    If this is not the case, make an example on apex.oracle.com and I'll take a look.

    Kind regards

    Joni

  • With the help of QProperty for a label inside the list view

    Hello

    I wanted to assign the value of a label in the list view to a string QPROPERTY. I did it using Qt.myname = _app. QPropertyName. And Qt.myname attributed to label.

    It updates correctly during installation. But if I change the value, it is not updated within the display list, but working in another label that is outside the view of the list.

    It works for me

            ListView {
                property string myCppProperty: app.cppProperty
                listItemComponents: [
                    ListItemComponent {
                        Container {
                            id: listItemContainer
                            Label {
                                text: listItemContainer.ListItem.view.myCppProperty
                            }
                        }
                    }
                ]
            }
    
  • How to get the list view in iTunes 12.4.3 for Windows

    Guys, I'm LOSING MY MIND. I had to re - download iTunes (which I refused to update in eternity because I know of updated versions are generally never good), and this new Interface is making me remove my hair and cry. Not only is it completely intuitive, but it makes it incredibly difficult to navigate.

    I'm seeing all my music in classic list view, which I know he can do. When I first loaded it upward, she appeared in list view, but the time that I started clicking around, it became this heavy nightmare of the image. Every article I've read has a UI that I don't HAVE, where there is a drop-down list of some sort. Does anyone know how? I have attached a screenshot. BTW, that blue icon that you THINK would be seen list said just what is the next song. Complete waste of space. Jesus, just put it in a status bar, or scroll across the top.

    FYI: the only changes that I made in the preferences has been disable anything itunes store or apple related radio because literally ALL itunes became ads.

    How can I view my mode music list in iTunes 12.4?

    In the drop-down list, select music. Once in the music, in the sidebar, select the songs and you should be intraditional list view.

  • Why isn't list view &gt; arrange by &gt; date modified, accurate?

    am new on el capitan and I noticed that the list view > arrange by > update is not correct.

    I modified just a folder on my hard drive by adding new things, but it's showing a date of last modified August 6, No 11.

    what constitutes 'Edit' a folder? I'm doing something wrong?

    Thank you for advice or suggestions.

    Abstractman23 wrote:

    I just modified a folder on my hard drive with new things...

    What does it mean exactly 'stuff' above means?

    This means that you have added new files directly under the folder (and not a subfolder level)?  That would be a change.

  • Cannot modify 'Recently added' to the title of the library to the list view.

    I am now using iTunes v12.4.0.119

    I chose the "recently added" to the title of the library and it seems stuck on the display of the album, I can't switch to the display of the list no matter what I do. I appreciate looking at album art, but I just can't stand the inefficiency of having all that unused space. I largely prefer a list view. I can not change anything on this playlist, less first how it is displayed.

    If I can't get it to display the list, I'll have to remove it. It is so shocking when all other points of view are set to list view and big boom-* dead space and visual clutter to album art page.

    Don't let me use a feature of good full advantage? No problem, I don't use it at all.

    Good day Starry001

    I hope this helps. Select 'Recently added' playlist on your sidebar, now in the menu bar go to "Display" and click on "View As"-> "Songs." Your playlist should now be displayed as a list of items. You can always switch between different views for each of your playlists.

  • How to set a default view for 'Open' and ' Save as '.

    I am running Windows XP, Service Pack 3.  I want to set a default view for the windows 'OPEN' and 'SAVE AS' sort by 'Name' of A--> Z.  How can I do?

    Hello

    I suggest you to follow these steps and check if that helps:

    a. right-click in the folder.

    b. click the name to sort by alphabetical order.

    You can also click on the name of the list view to sort the files alphabetically.

  • BlackBerry Q10 how do I change BBM Contacts list view to "list"?

    My friend used BB Q10, she can't find any option to change BBM Contacts list view to 'list '. Can anyone help? Thank you.

    When you are in the list of BBM contacts, further down from the top, you can see "Settings" in the upper right. Touch it and then scroll down to "Contact Layout".

    Here you can choose between 'Grid' or 'list '. Choose 'list '.

    If please post if it works for you or not. Thank you.

Maybe you are looking for