Creating a dynamic grid using actionscript

Hello all:
I am working on a Flash project which requires that the user
input 2 values. These two values will be used as height and width
to generate a dynamic grid. I am new to actionscript and am
struggling with how to create the 2 input fields and pass the
values to actionscript by an event such as the user pressing
return. The code below will create the grid correctly based upon
the hardcoded variable values hightlighted, but I need the user to
enter the values and press return to generate the grid.
Can anyone suggest the actionscript required to capture the 2
values, send them to actionscript with an event such as pressing
return and then have AS generate the grid width and height based
upon the user input. The i (10) and j (10) values in line 4 and 5
are the values that I need to have the user input to generate the
grid.
Any help will be most appreciated!
initX = 0;
initY = 0;
counter = 0;
for (var i = 1; i<=10; i++) {
for (var j = 1; j<=10; j++) {
counter++;
grid_container.attachMovie("cellMC", "cell"+counter,
counter);
grid_container["cell"+counter]._x = initX;
grid_container["cell"+counter]._y = initY;
grid_container["cell"+counter].onRelease = function() {
cellName.text = this._name;
initX += 30;
initY += 30;
initX = 0;

Thanks for the quick reponse kglad. I will give it a
go.

Similar Messages

  • How to create a dynamic newsflash using dreamweaver and PHP

    Hi there,
       I would like to create a dynamic newsflash using dreamweaver and PHP in that the newsflash will be pulling information from a MySQL database. The newsflash should also have a link to view more information about the piece of news a user wants to know more about. Which tools do I need to use in dreamweaver and how's the procedure to go about that. Any advice is highly appreciated. Thanx in advance!

    I think you´ll need at least a MySQL table with the following columns:
    - id (primary key, int, auto_increment etc)
    - news_headline (varchar)
    - news_teaser (text)
    - news_content (text)
    What I´d personally add are columns such as:
    - news_date (date or datetime)
    - news_external_link (varchar), if a "read more..." link is supposed to navigate to an external URL rather than displaying the contens of the "news_contents" column.
    Based on such a MySQL table it should be easy to use Dreamweavers standard Server Behaviors to create the usual datalist.php, insert.php, update.php and delete.php documents, and there are numerous tutorials out there which will teach you how to do that.
    Am I right when assuming that you´ll also need to know how to automatically pull, say, the 5 most recent news records from the database ?

  • I need to know how I will create a dynamic website using php and mysql

    I need to know how will I create a dynamic website using php and mysql that people could have the abilities of registering in the website, and modify their profile where they can add their pictures and everything. apart from that, they should have the ability to search about other member. hope to here more from you.

    If you are a right-brained creative, and have no previous experience or propensity to be able to understand coding and database "stuff", and/or if your time can be better spent on other skills, I recommend you save your sanity and hire a developer... or at least the first time around. I have been attempting to grasp this for years... and have a library of marked up books to prove my efforts, all while trying to keep up with an ongoing client base that is always cramped. It's a wonder I still have my sanity... then again, I might not be the best person to determine that. Others might question it.
    That said, I still plan to master php... one of these days.

  • Creating a dynamic jtree using datas retrieved by dom in xml parsing

    help me with code to create a dynamic jtree using data retrieved as nodes by xml parsing using dom

    Ok, so you want to make a tree. To determine the data that appears in a tree, you have to make a custom tree model. The API for this is at :
    http://java.sun.com/j2se/1.4.2/docs/api/
    A tutorial for using trees is at :
    http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html
    I assume you are going to be using Nodes, since you are using XML. For this I might start with something like
    class NodeTreeModel implements TreeModelI would then implement the 'getChildCount()' as the number of subnodes a node has, and the value of a tree node to the nodes value.
    Hope that starts you off.

  • Using DW to create a dynamic, grid-based website

    I am a novice to this whole web design thing but I have big dreams of accomplishing a big goal and designing my own website.
    I am aiming to create a site similar in concept and design to this one: http://dynamit.us
    I am looking to replicate the multi-sized "content boxes" using a grid (which I know can be easily done in DW), and I am looking to have my website automatically "pull" content when the scroll bar reaches the bottom of the page (Facebook is another example of a website that uses this feature).
    I am NOT concerned with replicating the animation(s) on the dynamIt website, as can be seen on the photos that have the magnifying glass in the top right corner.
    I am thinking about biting the bullet and upgrading my trial version of DW to the full package, but I want to make sure that I am purchasing the correct software to achieve the result I'm aiming to achieve.
    Can I create a somewhat simplified version of this website (dynamit.us) using just Dreamweaver (and maybe PS for photo editing)? How do I build a site that pulls "past" or "old" content from a library and "updates" on the page every time the scroll bar reaches the bottom of the page (Infinite Scrolling)?
    THANK YOU!

    Dreamweaver is a great tool.  It will aid you in achieving your goals.  But it won't make you an instant success at professional web development any more than purchasing a fancy, expensive camera makes you an instant success at photography. 
    How much  experience do you have with with web design theory,   HTML, CSS, client-side (JavaScript), Server-side (PHP) and databases (MySql)?  
    Ultimately, a working knowledge of your craft is primary.   The tools you use are secondary.
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/

  • Help Creating a Dynamic Grid?

    I have some experience in flash and actionscript, but not much beyond the classroom in a book tutorials, etc.
    I am working on an idea and just need a little help figuring out where to begin.
    I would like to create a simple 2D interactive grid.  The user should be able to increase and decrease the number of axis (both X and Y simultaneously) that compose the grid, and also the scale of the grid itself (Zoom in and Out).
    If this goes well enough, I would like to be able to plot graphical content on the grid that visually changes as the grid itself changes.  They should, in some way, be linked to one another and correspondingly affected by the same two parameters.  This, however, would be a second step.  I am more concerned with the base grid model at this point.
    ANY help would be very much appreciated!

    It is not clear from your post what exactly you need to do. Perhaps some visual (simple image) will help us understand your vision and use cases.
    Meanwhile, I have a post on my blog about how to compose dynamic grid:
    http://flashascript.wordpress.com/2010/12/25/arranging-objects-into-2d-dynamic-grid-with-a ctionscript-3/
    The same principals can be applied to drawing other grid related visuals.

  • Problem - Creating a Dynamic LOV using duplicate value in select statement

    I am trying to create a Dynamic LOV by attempting to follow a pattern similar to the following:
    select shop_name d, shop_id r
    from shops
    order by 1
    However, I want to use the shop_name twice as in the following because I do not have any other unique identifier available such as a shop_id to associate with the shop name:
    select shop_name d, shop_name r
    from shops
    order by 1
    But I get an error where I am not allowed to duplicate the shop_name in the select statement. I read somewhere on this forum where it can be done but I can't find exactly how.
    Can someone tell or show me how to accomplish this?
    Thanks in anticipation for your answer.
    Thanks,
    Ric

    Ric,
    I just tried to do this on APEX 3.0, and it worked just fine with this SQL:
    select ename d, ename r from emp order by 1Perhaps you could put an example on apex.oracle.com or specify the error message that you're getting.
    So as long as you have uniquely aliased both columns, this should not present a problem.
    Thanks,
    - Scott -

  • Creating a dynamic array in Actionscript

    I am wondering how I would create a dynamic array in Acionscript, i.e. one that utilizes fields for mapping data like this:
    public var SMITH:Array = [
               {date:"29-Aug-05", close:45.87, profit:52},
               {date:"23-Aug-05", close:45.74, profit:32},
               {date:"21-Aug-05", close:45.77, profit:22},
               {date:"25-Aug-05", close:46.06, profit:51},
    but where you would just be reading in data without knowing what your data looks like.  In other words, I'd like to take something like a database table with X number of columns and have Actionsctipt map each row to an item in my array.  Something like this:
    for each row in table
    add {col1:value, col2:value, col3:value, ... colX:value} to Array
    So I won't know "date" or "close" or whatever at runtime, I'll just have X number of items for each element in the array. How would this be done?
    The reason I need this mapping feature is because I then want to map the table-like array as the data provider to charts, datagrids, etc.
    Thanks.

    If this post answers your question or helps, please mark it as such.
    You can download the lib for JSON in Flex here:
    http://code.google.com/p/as3corelib/downloads/list
    These pages describe using JSON and Flex, and databases:
    http://www.switchonthecode.com/tutorials/flex-php-tutorial-transmitting-data-using-json
    http://www.switchonthecode.com/tutorials/using-flex-php-and-json-to-modify-a-mysql-databas e
    http://www.switchonthecode.com/tutorials/flex-php-json-mysql-advanced-updating
    http://www.mikechambers.com/blog/2006/03/28/tutorial-using-json-with-flex-2-and-actionscri pt-3/

  • Managed bean can not be created. - dynamic menubar using ADF

    hi All,
    had to post the thread again to make sure it dint go un noticed!
    scenario:
    making dynamic menu navigation using ADFFaces, all steps followed as mentioned in SRDemo Sample. but still i get this error:
    error encountered:
    SEVERE:Managedbean menuItem_General could not be created.
    javax.faces.FacesException:Can't get value from value binding expression: '#{resources['erms.menu.gen']}'.
    more details here on last thread posted:
    ADF- managedbean creation error while making dynamic menus.
    plz help!

    We found the solution how it works... But its a little bit strange.
    Before we had the following on the sending part:
    connectionFactory = (ConnectionFactory) ctx.lookup("jmsfactory/default/FactoryName");
    destination = (Queue) ctx.lookup("jmsqueues/default/QueueName");
    We could not use EJB injection here as the place were it was used is a POJO.
    Now in our Job-Bean we do the following:
         @Resource(name="FactoryName")
         private ConnectionFactory connectionFactory;
         @Resource(name="QueueName")
         private Queue destination;
    and then we transfer the connection factory and queue to our POJO... and it works... From our understanding both should be the same???
    Frank

  • Create frozen alv grid using salv* classes

    Hi Experts,
    I want to create a frozen alv grid i.e the row selections are defined in the code and should not be able to modify on the screen . Please let me know if it is possible ? I am using salv* class for alv.
    Thanks,
    Kiran A.

    Hi,
    You mean "preventing" the user to change the selection set or just not allowing him to change some rows content?
    If you speak about selection only, I don't think this is feasible... (or a silly idea: highlight the rows instead of selecting them
    Kr,
    Manu.

  • Creating an ALV grid using SAP Query

    Hi ,
    My requirement is to generate an ALV grid Display of an SAP Query.
    Please let me know the steps.
    Regards,
    Bhanu

    Hello,
    Please check the below steps :
    Crete Infoset using SQ02 ....
    Create Usregrous using SQ03 and hen create Query using SQ01 after this
    U can select the type of lit format like ALV list ALV gRID OR CLASSIVAL LIST ....
    Regards

  • Help: Creating a Dynamic TreeView Using JSP

    I'm involved in a research project developing a webclient for the subversion VCS. I was able to access the repository and get the content as a string using the JavaSVN Library. It is like follows
    A/
    A/1.txt
    A/B/2.txt
    A/B/3.txt
    C/
    C/4.txt
    The problem i'am having is that displaying this out put in a tree Type Structure. So any one can help me this any matter is greatly appriciated
    Regards,
    Samantha

    Javascript open source for Tree Menu
    http://www.softcomplex.com/products/tigra_tree_menu_pro/

  • DYNAMIC CREATION OF LINE SERIES USING ACTIONSCRIPT

    There's something wierd about flex or im doing something
    wrong?
    - when i create a line series manually using mxml and specify
    a id for the series, it works.
    - similarly when i try to dynamically create a line series
    using actionscript & define an "id" property, flex does not
    understand! what am i doing wrong?
    code for reference:
    private function addSeries(series:Array,
    yField:String,id:String) // addseries(series,"date","1000")
    var ls:LineSeries= new LineSeries();
    var stroke:Stroke = new Stroke()
    ls.yField = yField;
    ls.xField="ts"
    ls.dataProvider=dp
    ls.id=id // tried defining it dynamically, but flex does not
    find
    this.mychart.series.push(ls)
    THIS IS THE ERROR I GET : "TypeError: Error #1010: A term is
    undefined and has no properties."

    I see... I played around with the line chart ...
    Hopefully this helps... if not forgive me...
    I know why you are trying to use the id property which i
    agree doesn't work.
    since the series is an array in your lineChart use the index
    to set the visible property false/true.
    lineChart.series[0].visible = true/false;
    <mx:Lineseries id="a1" visible="true"
    dataProvider="{whatever}" />
    <mx:Lineseries id="a2" visible="false"
    dataProvider="{whatever}"/>
    create a function called init();
    public function init():void
    var lineS1:LineSeries = new LineSeries();
    lineS1.visible = true/false;
    lineChart.series.push(lineS1);
    var lineS2:LineSeries = new LineSeries();
    lineS2.visible = true/false;
    lineChart.series.push(lineS2);
    ... and the key is to call this init function on initialize
    event...NOT on createComplete event
    <mx:LineChart.... initialize="init()" .... />
    and to show both lines... call this function...
    public function showLines():void
    lineChart.series[0].visible = true;
    lineChart.series[1].visible = true;
    Hope this helps....

  • Using Actionscript to create complete scenes

    Ok let me paint a picture. I'm designing an online flash
    application that will dynamically display tutorials stored in a
    MySQL database. These tutorials will be added via a php control
    panel for tutors to add new tutorials to the database.
    So my flash will load, dynamically create a new scene, add in
    some static elements i.e. logo and some other images and then list
    the tutorials for the user to select.
    The user then selects a tutorial and a new scene is
    dynamically created to display the contents of this scene i.e. a
    scrollPane for the text, video component for the video elements and
    the title etc.
    I recently read this tutorial so getting the data from the
    database into Flash shouldn't be a major problem.
    http://www.webmonkey.com/webmonkey/03/40/index1a.html
    Here's what I think I need
    I'm about to start digging through my flash bible so I'll
    edit this and let you know what I've found out myself,
    1. How to create a new scene using Actionscript,
    2. How to add a few images (jpgs) from the library using
    Actionscript,
    3. how to add a scrollPane (all using actionscript),
    4. how to add some text fields,
    5. how to add a video player to access a video from a folder
    on the server and lastly
    6. some kind of back button..
    Majority of these components will be loading content from PHP
    which will access my MySQL server.
    Any help would be greatly appreciated.
    Thanks
    Steve

    A tall order for a single thread! There are many possible
    answers to each question. Plus there are not enough specifics to
    guide you to the correct alternative. The good news it you can do
    what you are planning.
    1. How to create a new scene using Actionscript,
    Do not be confused with the technical feature of a scene in
    Flash IDE. It is not something you use in Actionscript. However
    from a design view, you can create any page oriented content
    application you want. The usually dynamic element for creating a
    page is a MovieClip or the as you mentioned the component
    ScrollPane which is MovieClip.
    Beyond that there are many many ways to go.
    In general you would create one or more template layouts and
    load the content in selecting the template.
    A shell Flash movie would handle the loading of the templates
    and the data or content that would show.
    As well there could be swf that are custom pages that simply
    load and handle all the needed content separately.
    2. How to add a few images (jpgs) from the library using
    Actionscript,
    MovieClip.attachMovie
    You also can load externally using
    MovieClip.loadMovie
    or if you need to manipulate it after loading then
    MovieClipLoad.onLoadInit
    3. how to add a scrollPane (all using actionscript),
    Explained at
    ScrollPane.contentPath">MovieClipLoad.onLoadInit
    4. how to add some text fields,
    The question implies to create the TextField dynamically and
    a central method is:
    MovieClip.createTextField
    5. how to add a video player to access a video from a folder
    on the server and lastly
    Use the FLVPlayback component that is delivered with Flash 8
    Pro. You need to encode the video as FLV format using the video
    encoder that comes with Flash 8 (also possible with import except
    you elected to make it external) or a third party encoder.
    You put the flv files on the server with the swf containing
    the FLVPlayer and use the
    FLVPlayback.contentPath
    method.
    6. some kind of back button..
    Again many many ways to go: You can use the Flash component
    button or create your own. You can make a button from a MovieClip.
    You can do these dynamically or at design time and in either case
    change their functionality and respond to their interactions at
    runtime.

  • Is it possbile to create ALV Grid using Class &  without using SE51

    Is it possible to create a alv grid using Class, with out using the screen painter(SE51).

    Hi Preethi,
    It is possible to creat ALV grid using class, provided u have to create a custom control in the screen dialog.
    Try with the foll code. This is an example for flight detail.
    DATA: container TYPE REF TO cl_gui_custom_container,
          alv_con TYPE REF TO cl_gui_alv_grid.
    data : it_sflight like table of wa with header line,
           g_fieldcat type lvc_t_fcat.
    /* Paste the code the PBO
        CREATE OBJECT container
          EXPORTING
            container_name              = 'C_SPFLI'. "Specify the container name which u created in the dialog screen.
        CREATE OBJECT alv_con
          EXPORTING
            i_parent          = container.
    /* Use the foll. to dislay the report
    CALL METHOD cl_grid->set_table_for_first_display
            EXPORTING
             I_STRUCTURE_NAME              = 'SFLIGHT'
            CHANGING
              it_outtab                     = it_sflight[]
              IT_FIELDCATALOG               = g_fieldcat.
    First create the container and then place the ALV in the container and for dislaying pass the necessary table.
    Hope this will useful for u.
    Get back if u r unable to do it.
    Regards
    Router

Maybe you are looking for

  • How do I setup an external hard drive to mount at boot (without any login action) in Mavericks?

    First the Details: MacBook Pro, Retina, 15-inch, Late 2013 OS X Mavericks 10.9.5 USB 3.0 External Hard drive I am currently using an external drive for my user storage.  Right now I log in with a separate User account to mount the drive, log off, and

  • Why is "-2" appended to imported filenames?

    When I import picture files to LR 5.2 in OS X 10.8.5, almost always, "-2" is appended to file names. Sometimes I find files in my LR catalog twice, once with the original name, and once with "-2" appended. I've tried tracing it different importing wo

  • ORA-12528 after each reboot

    Howdy all. I have Oracle 10g database Standard Edition installed on a Win2K Server machine. Each time I reboot the machine, the database does not fully open on its own. After a reboot, when I try to connect to the database using SQL*Plus, I get the f

  • NativeProcess progressevent doesn't get dispatched

    Hi guys, I have a simple nativeprocess code in my app. I unzip password protected zip files using 7zip and want to capture every time a file is unzipped. Here's the code:                     var npInfo:* = new NativeProcessStartupInfo();             

  • Curve 8330 Stereo Headset Issue.

    Hello, I purchases a new Curve 8330 a few days ago and the headset which was included with it (the 3.5mm 4 Pole Stereo Headset) does not work when I play music from the Internet or from the Media. It also doesn't work with any calls. The volume alway