Place the items in the table next to each other on stage

Hey guys,.

I know I have to do something wrong that is easy and simple to fix, but I can't fix.

I have a table called a frame of a movieclip and I want to place each image as a 'menu' on the stage.

The problem I have is that I want to put each item in menu next to each other, but the only code I could find work is the 3D carousel.

So I try to adapt this code to my needs.

Where I'm going wrong? Any help would be great.

Code below:

package classes

{

import flash.display.MovieClip;

com.greensock.*;//for interpolation ability to import

import com.greensock.TweenLite;

com.greensock.easing import. *;

import flash.filters.BlurFilter;

import flash.events.Event;

import flash.utils.Timer;

import flash.events.TimerEvent;

import flash.display. *;

import flash.events. *;

import flash.sampler.StackFrame;

SerializableAttribute public class extends MovieClip MenuSystem

{

private var blur: BlurFilter = new BlurFilter (0,0,1);

private var holderMc:MovieClip = new MovieClip();

private var radiusX:uint = 1200; / / width of the carousel

private var rayonY: uint = 400; / / height of the carousel

private var centerX:Number = 100; / / x position of the center of the carousel

private var centerY: Number = 350; / / the position there from the center of the carousel

private var speed: Number = 0.01; / / initial rotation of the carousel speed

private var itemArray:Array = new Array(); / / store the items to sort them according to their 'depth' - see the sortBySize() function.

public var navigationPopupInfo:NavigationPopupInfo = new NavigationPopupInfo();

public void MenuSystem()

{

the constructor code

We do support for the menu system serve

addChild (holderMc);

holderMc.y = - 200;

Also add a listener to control the rotation of the speed menu

/ * addEventListener (MouseEvent.MOUSE_MOVE, OnMouseMoveHandler);

*/                    }

public function initNavigationPop (): void

{

TweenMax.to (navigationPopupInfo, 0, {alpha: 0, 40-y:, blurFilter: {blurX:3, blurY:10}});}})

holderMc.addChild (navigationPopupInfo);

navigationPopupInfo.x = (-navigationPopupInfo.width / 2);

TweenMax.to (navigationPopupInfo, 2, {delay: 1, alpha: 1, y: 10, ease:Elastic.easeOut});})

TweenMax.to (navigationPopupInfo, 1, {delay: 1, blurFilter: {blurX:0, blurY:0}});}})

}

Place the vital elements on stage

public void initRange(numOfMenuItems:Number):void

{

for (var i: uint = 0; i < numOfMenuItems; i ++)

{

var arrayBoxItem:String = ('model' + (i + 1) + '_');

var itemMc:ItemMc = new ItemMc();

public var angl:Number; belongs to the class of the element.

Item class extends ItemInner in the library FLA.

itemMc.angl = i * (400 / numOfHomeRangeItems);

itemMc.alpha = 0.8;

itemMc.name = (arrayBoxItem);

trace (itemMc.Name);

holderMc.addChild (itemMc);

itemArray.push (itemMc);

itemMc.itemHitter.buttonMode = true;

itemMc.addEventListener (Event.ENTER_FRAME, enterFrameHandler);

Listen MouseEvents only on the icons, not on reflection;

itemMc.itemHitter.addEventListener (MouseEvent.CLICK, clickHandler);

itemMc.itemHitter.addEventListener (MouseEvent.ROLL_OVER, rollOverHandler);

itemMc.itemHitter.addEventListener (MouseEvent.ROLL_OUT, rollOutHandler);

itemMc.iconMc.gotoAndStop (arrayBoxItem);

}

}

public void clickHandler(event:MouseEvent):void

{

clean your audience before doing anything else to release

the user CPU resources

for (var i: uint = 0; i < itemArray.length; i ++)

{

var itemMc:ItemMc = itemArray [i];

itemMc.removeEventListener (Event.ENTER_FRAME, enterFrameHandler);

itemMc.itemHitter.removeEventListener (MouseEvent.CLICK, clickHandler);

itemMc.itemHitter.removeEventListener (MouseEvent.ROLL_OVER, rollOverHandler);

itemMc.itemHitter.removeEventListener (MouseEvent.ROLL_OUT, rollOutHandler);

Optional:;

TweenLite.to (itemMc, 1, {scaleX:0, scaleY: 0, alpha: 0.1, ease:Elastic.easeInOut});})

TweenMax.to (itemMc, 1, {blurFilter: {blurX:5, blurY:5}});}})

to replace the carousel again see function reInit()

FIND A WAY TO REMOVE ITEMS

this.removeChild (itemMc);

}

Tabula Rasa, to prepare variables

var variantName:String = event.target.parent.name;

itemArray.splice ();

If (variantName == "backBtn") {MovieClip (root) .reinitMenuSystem () ;}

else {MovieClip (root) .addVariantPage (variantName) ;}

}

/////////////////////////////////////////////////////////////////////////////// /////////////////////// POSITION ITEMS IN CAROUSEL

position items in the Menu

public void enterFrameHandler(event:Event):void

{

Event.Target.x = centerX; / / position of the element x

Event.Target.y = centerY / / position point y of

Scale according to position point there to give the point of view

/ * var s:Number = event.target.y / (centerY + rayonY);

event.target.scaleX = event.target.scaleY = s;

Event.Target.angl += speed; / / speed is updated by OnMouseMoveHandler

ADD DOF

blur.blurX = - event.target.y / 10 + 21;

blur.blurY = - event.target.y / 10 + 21;

Event.Target.filters = [blur];

Finally set the size of the elements

sortBySize();

*/                    }

/////////////

Check the progress of ticks

/ / / TRI SIZE DETERMINE DEPTH OF ELEMENTS

set the display list index (depth) of the elements according to their

scaleX property so that the element, the index is high (depth)

/ * public function sortBySize (): void

{

It is not a property Array.ASCENDING DECLINING use and reverse()

itemArray.sortOn ("scaleX", Array.DESCENDING |) Array.NUMERIC);

itemArray.reverse ();

for (var i: uint = 0; i < itemArray.length; i ++)

{

var itemMc:ItemMc = itemArray [i];

holderMc.setChildIndex (itemMc, i);

}

}

*/

/////////////////////////////////////////////////////////////////////////////// /////////////////////// ITEMS WHEN ROLLOVER & OUT

public void rollOverHandler(event:MouseEvent):void

{

var currentModel:String = event.target.parent.iconMc.parent.name;

Event.Target.parent.alpha = 1;

TweenLite.to (event.target.parent.iconMc.tooltipMc, 1, {alpha: 1, y:-40, ease:Elastic.easeOut});})

event.target.parent.iconMc.tooltipMc.tipHeader.gotoAndStop (currentModel);

}

function rollOutHandler(event:MouseEvent):void

{

Event.Target.parent.alpha = 0.8;

TweenLite.to (event.target.parent.iconMc.tooltipMc,.5, {alpha: 0, y:-27});})

}

/ / / ITEMS IN THE CAROUSEL MOVEMENT ACCORDING TO THE POSITION OF THE MOUSE

/*

Update of the speed at which the carousel turns accoring to the distance of the mouse since the center of the stage. The variable speed is only updated when the mouse is over the point Sprites.

*/

/ * function mouseMoveHandler(event:MouseEvent):void public

{

Speed = (mouseX - centerX) / 20000;

}

*/          }

}

I have a table called a frame of a movieclip and I want to place each image as a 'menu' on the stage

This code will take a MovieClip in your library with the link ("Menuitem") that has 5 labeled keyframes "menuitem 1 «...» "" menuitem 5 ', it is adapted accordingly to your stagesize and distribute, and align the elements at the top from left to right:

I havemport flash.display.MovieClip;

var menu_Array:Array = new Array();

the var menu: MovieClip = new MovieClip();

var stageWidth:int = stage.stageWidth;

var menuWidth:int = 0;

for (var i: int = 0; i<5;>

{

var menuItem:Menuitem = new Menuitem();

menuWidth += menuItem.width;

menu_Array.push (MenuItem);

}

function distrbuteAndAlignItems(_menu:MovieClip,_array:Array):void

{

var scaleFactor:Number = stageWidth / menuWidth;

var xAdjustment:Number;

trace (scaleFactor);

for (var j: int = 0; j<_array.length;>

{

MovieClip(_array[j]).scaleX = MovieClip(_array[j]).scaleY = scaleFactor;

for (var k: int = 0; k

{

xAdjustment += MovieClip(_array[j]).width;

}

_ARRAY [j] .x = xAdjustment;

_ARRAY [j].gotoAndStop(j+1);

xAdjustment = 0;

_Menu. AddChild (_ARRAY [j]);

}

addChild (_menu);

}

distrbuteAndAlignItems (menu, menu_Array);


If that's what you're looking for...

Tags: Adobe Animate

Similar Questions

  • moving the regions next to each other

    Hi all

    db11gxe, apex 4.0, firefox 24,

    I have areas on the page, but there is one under the other, I want them next to each other, how?

    after resizing the width of their

    For the layout of the area, please see figure 5-70.

  • Need help, trying to arrange all 3 fields next to each other... in a region.

    I have 3 areas and I am trying to organize all near each other...
    But I can not
    The space is like
    Empno... Fieldnename... * empname *... fieldempname samplefield sampleno
    I'm trying to understand why there at - it too much space between empname label and field empname

    Note field empname is a list item.

    I currently used field. = no and reduces the difference in space
    Start new line field

    Can someone find out more about what is a indicate Yes or no field element page.
    What is the real purpose of the field in the page element as colspan and rowspan

    Also best method to rearrange the columns next to each other in a shape of apex
    Apex 4.1 11gxe

    Published by: user12233760 on October 2, 2012 02:39

    Have you tried the "Drag and Drop" tool in the area of point? It gives you a good overview of how your objects are organized.
    If you set field = no to all the consecutive elements, they should be in a cell, on the side of all the side. Then enter a space before the text of the label for a little distance for readability.

  • Is it possible to place the table and the text online?

    Hi all

    I have a table need to align with the numbered list. Is it possible in line of the table and text on a single line. EX: 6.12 and top of the 'text' must align horizontally.

    See the screenshot of the problem.

    Currently what I do, it is to place the table in separate frame and place it online using the option of the anchor.

    Screen Shot 2016-08-30 at 1.20.22 PM.png

    Thanks in advance.

    Kasi

    We could use the options for text blocks to position the first line.
    Fixed value set to 0.

    And a table style that would govern the distance before and after a table.
    If you wish, set both values to 0 .

    We could also do a minimum in the lead with the paragraph formatting to separate paragraph following with the next table.

    Best,
    Uwe

  • How to select and move more than one bookmark at a time? Shift + click selects multiple items that are next to each other in a list, because the element

    How to select and move more than one bookmark at a time?
    Shift + click selects multiple items that are next to each other in a list, because the items open in firefox before that happens.

    Glad it worked for you. Thanks for posting back.

  • CSS attributes to the Center content in 2 columns next to each other in a container

    Hi all


    I have a line/container Bootstrap with 2 columns.  I would like to place Center the text in the left column and an image in the right column, and I want to be located next to each other in the center of the container.  (See the diagram).  Anyone know how?

    I could do it quite easily with margins, but I fear that this would produce a bad alignment/display on small devices.  I would like the text and image to stack and to focus on small devices.

    Here is my HTML code:

    < div class = "container" >

    < section class = "row" id = "content of the header" >

    < div class = "col-md-6" >

    < h1 > wallpapers you will love! < / h1 >

    < p > now you can express yourself every day with high quality wallpapers and enjoy and share funds. They are free! < /p >

    < button type = "button" class = 'btn, btn-primary' > button < / COMING SOON >

    < p > available on most Android devices. < /p >

    < / div >

    < div class = "col-md-6" > < img src = images/wallpapers_on_phone_2.png"" width = "284" height = "468" alt = "Christ - honoring Wallpapers to build your faith" > < / div >

    < / section >

    < / div >

    CSSdesired-result.jpg

    Also, can someone tell me how to find beyond channels/discussions in this Forum I participated in?


    Thank you!

    I put a 'height' on the .block-wrapper for the example, you must remove that:

    . Block-wrapper {}

    Display: table;

    Width: 80%;

    margin: 0 auto;

    background-color: #FFC;

    height: 500px;

    }

  • How to display multiple windows next to each other on top of the other in the bottom task bar

    When I open a new Firefox window, he stacked it on top of all others in the taskbar at the bottom. I wish they were next to each other. He used to do this. Now, I have to hover over the element ONLY Firefox in the bottom task bar and read the list to find the one I want to go to. It is a waste of time and tedious.

    How can I change this?

    I think that this is governed by your general taskbar setting. Please see the screenshot joint. To get this dialog box, right-click an empty area of the taskbar, and then choose Properties.

  • Songs disappearing; error message: "unable to listen to a number of files queued. To get information about the problem, click on the icon next to each file in the list pane. »

    I get this error message: "unable to listen to a number of files queued. To get information about the problem, click on the icon next to each file in the list pane. "The thing is that he played the songs darned two days ago, what has happened since then!

    Never mind. I totally forgot that I had renamed a folder that hosts my music. Duh.

  • What is a substitute for the migration assistant? I tried in vain for three hours to migrate files from a macbook pro to each other so that even if connected with the ethernet cable the computers never see each other.

    What is a substitute for the migration assistant? I tried in vain for three hours to migrate files from a macbook pro to each other so that even if connected with the ethernet cable the computers never see each other.

    You can connect otherwise?  USB or FireWire or love at first sight?  You can connect both machines and start the one you want to transfer to target disk mode.  If your other machine is up and running with an account on it and you just want to move files, you can simply drag and drop the FRO the machine mounted TDM, or you can use the migration wizard.

    Or, if the other machine still starts and runs, you can start both computers and connect to the same wifi network and share the hard drive like machines on the network.  Access them in the finder on the new machine files and drag-and - drop, or use the wizard migration, on wifi.

  • How can I display two PDF files next to each other?

    How can I display two PDF files next to each other?  In the older version of Acrobat Reader, I was able to open each PDF in a separate window and used all the time.

    Hi julians7844423,

    Open Acrobat Reader DC, navigate to the Edit-> Preferences-> General-> uncheck "Open Documents in the new tab in the same window.

    Restart your system & now try to open PDF files.

    Let me know if it solves your problem.

    Kind regards
    Nicos

  • Pen - new tool line next to each other

    Hello

    How the tool pen would not pursue the other line when I try to draw two lines almost the same point? I try to draw hair for example, next to each other, when I click to start the new line with a pen tool it want to keep same old line is close.

    You can press Cmd/Ctrl + 2 to lock the first shot, then shoot the next move, Cmd/Ctrl + 2 and so on. Then Cmd / Ctrl + Alt + 2 to unlock.

  • Print one check next to each other

    Hello


    I use database 10g and oracle apex 4.1. My requirement is to print records one next to the other, here is the code I use to print the records but its getting a printed below, please suggest me how to print records next to each other.

    / * Name of the employee and manager name * /.
    C1 in)
    SELECT
    FIRST_NAME. '' || LAST_NAME EMPLOYEE_NAME,
    MANAGER_NAME (MANAGER_ID) MANAGER_NAME
    FROM HR_EMPLOYEES WHERE ID =: P3_ID
    ) loop

    sys. HTP.p (')
    < div style = "text-align: center;" background-color: white, width: 180px; height: 30px; border: 1px solid #000 "> ' | C1. MANAGER_NAME | (/ div > ');

    end loop;
    Thank you
    Sudhir

    Sudhir_Meru wrote:
    Hello

    I use database 10g and oracle apex 4.1. My requirement is to print records one next to the other, here is the code I use to print the records but its getting a printed below, please suggest me how to print records next to each other.

    Employee Name and Manager Name
    
    
    for c1 in (
    SELECT
    FIRST_NAME || '' || LAST_NAME EMPLOYEE_NAME,
    MANAGER_NAME(MANAGER_ID) MANAGER_NAME
    FROM HR_EMPLOYEES WHERE ID = :P3_ID
    ) loop

    sys.htp.p('

    ' || c1.MANAGER_NAME || '
    ');

    end loop;

    Thanks
    Sudhir

    sys.htp.p('
    ' || c1.MANAGER_NAME || '
    '); //try giving a class to the div and control the look and feel using the css rather than specifying inline styles sys.htp.p('
    ' || c1.MANAGER_NAME || '
    '); //CSS
  • Expand the Table next to a static chart

    I have a graph on the left I want to remain static and a repeating table next to him. I tried several methods to keep it in place, but if the table extends beyond a certain point it drage graphics with it. Is it possible to lock this graph aside in place?

    Think I solved the problem. Re-slices it to stay locked in place. He lined up at the top. Additional table and it remained... appreciate the help.

  • Drag a break is not the button "next".  All other slides work well, what don't get me?

    Hello

    I created training modules that require the learner to click next to advance to the next slide.  In a slide, there could be transitions within this topic, but I want the learner to have to click to the next major topic (slide).  It works fine for all other blades, except for the following...

    I am betting that the solution to this will be obvious to at least one of you.  I hope that my screen will show what I'm not doing correctly.

    For all other slides, I Action drag 'Continue' enter (to move the script) and 'Pause' to the output, to make the button NEXT to do the work.  Others seem to work well, but this one gives me problems.  Any thoughts?

    Adobe Screenshot Slide Advance.jpg

    What version do you use? None of the buttons on this slide is a break this slide. Add action break leaving CP7 (and 6) is not the way to go: this action is executed when the playback head has left the last image, so pause will occur on the first frame of the next slide. I'm puzzled that you say that it works on some slides? Sure that you do not have a break on the next button, which is the normal way to pause a slide. Also, there is no reason to do this slide as long. You can interrupt this button for 1 sec, and reduce the duration of the slide at 7secs, throw all the useless frames only increase the size of the file.

    Lilybiri

  • I can turn the tables in CSS or other formats?

    Hello.
    I have a large site that has been created in GoLive. Pages made a wide use arrays because of the way GoLive worked its wysiwyg page layouts.

    I'm not a programmer, but I didn't know how to create decent pages looking for that way. Now, I have DW and want to make changes to pages. Now these pages all look at them as tables and I cannot drag and drop to move things.

    Is there some way in DW to change all these tables in a form where I can the easily manipulated? I'm learning just about CSS. Is this the way forward?

    Of course all the new pages I create with CSS, but I still need to work with a lot of these older pages.

    Thank you.

    It is (or was) built in the tables to convert to the Apdivs function, but better to stay away from that, which seems to just invite a world of pain.

    Gary

Maybe you are looking for