Display results of MySQL query from AMFPHP by ArrayCollection in AS3 (Flash CS4)

Hi, i am using Flash CS4 (AS3) + AMFPHP + MySQL to do own flash frontend for Wordpress CMS.  Everything is going fine but i`ve got one problem. Problem with properly display of result of query in AS3 by using ArrayCollection.
When i check my service in "amfphp/browser/" in web browser i`ve got this (with all needed data):
(mx.collections::ArrayCollection)#0
filterFunction = (null)
length = 2
list = (mx.collections::ArrayList)#1  
length = 2     source = (Array)#2
That is the reason that i suppose that service work fine.  Problem is when i try to display result in AS3. In actionscript i have got this:
function getNewsListHandler(result:Object):void{
trace(result);
This function displays: [object Object].
I know that "result" is an ArrayCollection type but i don`t know how to get rows and columns from this. I know that my data is there but i have no idea how to get it.
Clarify: I don`t know how to get to Arrays and simple data variables which are in ArrayCollection.
Could anyone help me with that problem. I would be gratefull
P.S. I tried also change query type in service.PHP for mysql_fetch_query but in that case i`ve got only one row (not all data).

Thanks for fast reply,
arr_coll:ArrayCollection = new ArrayCollection ({col1:"data1",col2:"data2"}, {col1:"data3",col2:"data4"});
you would get the data like
var resultstr:String = arr_coll[1][1].col2;
trace(resultstr);
//results in data4
could you explain me how it was happen (arr_coll[1][1].col2)? It`s not clear to me. I thought in this case rather something like this :
var resultstr:String = arr_coll[1]['col2'];
It should give me "data4". I know it wasn`t but i don`t understand ArrayCollection in level which is needed to use your advice in my case. Could you clarify "arr_coll[1][1].col2" a bit?
What would it look like when you would have something like this:
arr_coll:ArrayCollection = new ArrayCollection ({col1:"data1",col2:"data2"}, {col1:"data3",col2:"data4"},{col1:"data5",col2:"data6"},{col1:"data7",col2:"data8"});
and you would want know f.e. position in ArrayCollection of  "data6". How would you code this? arr_coll[1][2].col2?

Similar Messages

  • How to display result of database query in JFrame?

    How to display result of oracle database query in JFrame?
    This is part of my code:
    String username, password;
              DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
              OracleConnection conn = DriverManager.getConnection(String url, String username, String password);
    Statement s= conn.createStatement();
    ResultSet q= s.executeQuery("SELECT A, B, C FROM TABLE X");
    Forget what url, username & password are. Is there any problem with my code?
    What should be next if I want to display result of the query in a table in JFrame?Thx !

    How to create JTable with unknown no. of rows? How to get no. of rows of a query?
    I saw the demo of creating JTable on java.sun.com but the the table has a certain no. of rows which is not applicable to my case.
    Suppose the result of query is a table with 3 attributes so there are 3 columns in the table.
    R contains the result of the query.
    Should it be something like this if I want to create JTable of the query?
    How to make n rows of {R.getString(1),R.getString(2),R.getString(3)};?
    public SimpleTableDemo() {
    super(new GridLayout(1,0));
    String[] columnNames = {"A",
    "B",
    "C",
    while (R.next())
    // content of a row
    Object[][] data = {R.getString(1),R.getString(2),R.getString(3)};
    I can't run it because I still can't debug my code which is said before.
    Thx!

  • Unable to display results of multiple query in grid in Oracle SQL Developer

    Hi, I am a newbie to this forum and couldn't find the Oracle SQL Developer forum so posting it here.
    My question: How to display multiple query results in grid in Oracle SQL Developer.
    Example:
    select * from Employee;
    select * from Department;
    - when I select both the queries and hit F5 in Oracle sql developer. By default it displays in output window.
    - How to display result of both the queries in Grid.
    Any thoughts on this would be really helpful.
    Thanks in advance.
    Harsh

    Hi Harsh,
    I'd say that the Results grid is designed to only show the results of 1 query at a time. I don't know/can't see how it would display multiple queries at a time.
    I would suggest either joining your tables to create a single query or opening another SQL Worksheet for one of the queries so that you can display the results side-by-side.
    Maybe you could explain what you're trying to do. Why are you trying to display multiple results in the same query grid?

  • How to display result of a query in browser?

    I have to write a simple application where I use EJB to access a database and then use Servlet/JSP to display the data to a browser. can anyone help me out please?

    in my ejb i am taking the input as claim number and using a select query i am getting the row for the particular claim number from the database. Through a servlet i need to invoke the ejb and get the data(result of the query) displayed in a browser. I want to know a way to display the query result in the browser.

  • Displaying results of a query

    Hi there
    I want to display the results of a query.
    OK I do kow how to do that. I do have one long text field
    (MySQL) and in some cases the colomn I iwsh to display has a page
    of information. I just want to display say the first 300
    characters. I was initionally thinking rtrim or trim but tralise
    that doesnt do it.
    I cant find what the correct term is.
    Thanks in advance

    Actually, I believe the Right() function returns the last
    part of the text, you will want to use the Left() function to
    return the first part. . . .
    http://livedocs.macromedia.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/js/html/wwhelp.htm?hre f=00000617.htm
    -Mike

  • How to get result of select query from  oracle  in VC

    Dear All ,
    I have a application in oracle which insert the data in the oracle database table.
    Now i want to show all the data that has been inserted into the database table in my VC application but i don't know how to handle select query in VC.
    Regards
    Krishan

    Hi Goivndu
    Thanks for your reply .
    I know all those things.
    I have created the system & alias  for my backend oracle system.
    I can also see all the stored procedure that are there in my oracle system.
    I just want to know how to write a select query in a stored procedure .
    you can insert data , Update data through oracle procedure but i don't think there is any way to get the result of select query in stored procedure .
    If you know any way to do that please do let me know .
    Regards
    Krishan

  • How to pass runtime parameters to MySQL Query from xMII server

    Please can anybody help in How to pass runtime parameters to Orcle Query from xMII server

    The answer is the same as for your other thread.  The mechanism is the same regardless of the end database.  The SQL  syntax will be different for each database vendor depending upon which functions you are invoking.  The main areas of difference between SQL Server, Oracle, DB2, etc. deal with dates (times also) and strings, but there are others as well.
    Regards,
    Mike

  • How can I check if a function is or is not called from the event listener? in Flash CS4 (AS3)

    Hi,
    I came across a little problem.
    I put an event listener inside a for loop and the for loop inside a function.
    I want the for loop to end as soon as the event listener inside the for loop calls its function.
    Here is the general code for a better picture.
    Code:
    this.addEventListener(Event.ENTER_FRAME, function#1);
    function function#1(event:Event):void{
              if(something is true){
                        for(var i = 0; i < numOfmy_mcs; i++){
                                  this["my_mc_"+String(i)].addEventListener(MouseEvent.CLICK, function#2);
    function function#2(e:Event):void{
    //do something cool here
    Thank you for any help!

    kglad wrote:
    that for-loop (if it executes), defines listeners for interactive objects.  that will complete long before any object is clicked.
    Well yes but it does it again and again (frames per second times seconds = number of times it goes through the code if i'm not mistaken), because it is inside a function, and through testing i found out that it works like this:
    Example:
    there are 5 my_mc's in my project: (my_mc_0, my_mc_1, my_mc_2, my_mc_3, my_mc_4)
    if i click my_mc_0 function#2 is called and executed. BUT only after the loop finishes (i know this from tons of testing)...which is unnecessary since you cannot click two places at once. This might not be a problem in this example because i am only using 5 my_mc's buy if i use 500000000 my_mc's it would make a lot of difference.
    is there a way to stop the loop if the function is called?
    ...maybe there is a better way to write it, the only alternative i know that works is if i manually write every single listener and this also is logical in this example but as i said next to impossible if the numbers get bigger.
    -Note
    I didn't specify this earlier but function#2 makes the if statement false so it wont jump back into it.
    Thank you for the help I really appreciate it!
    3rd edit...don't know what's wrong with me

  • As3 (Flash CS4) Actionscript array/mc display order

    Hi there,
    Im trying to amend this actionsscript so the rollover part appears above the image gallery. Ive tried everything i can think of and the rollover appears below the images.
    If anyone can help I would be eternally grateful!
    Here is the actionscript...
    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    var filename_list = new Array();
    var url_list = new Array();
    var url_target_list:Array = new Array();
    var title_list = new Array();
    var description_list = new Array();
    var i:Number;
    var tn:Number = 0;
    var no_of_column:Number = 8;
    var no_of_row:Number = 4;    // number of rows showing at a time
    var no_of_extra_row:Number;
    var scale_factor:Number = 0.8;
    var tween_duration:Number = 0.6;
    var new_row:Number = 0;
    var total:Number;
    var flashmo_xml:XML = new XML();
    var folder:String = "thumbnails/";
    var xml_loader:URLLoader = new URLLoader();
    xml_loader.load(new URLRequest("azwebgallery.xml"));
    xml_loader.addEventListener(Event.COMPLETE, create_thumbnail);
    var thumbnail_group:MovieClip = new MovieClip();
    stage.addChild(thumbnail_group);
    thumbnail_group.x = tn_group.x + 20;
    var default_y:Number = thumbnail_group.y = tn_group.y + 60;
    thumbnail_group.mask = tn_group_mask;
    tn_group.visible = false;
    fm_previous.visible = false;
    fm_next.visible = false;
    tn_title.text = "";
    tn_desc.text = "";
    tn_url.text = "";
    function create_thumbnail(e:Event):void
        flashmo_xml = XML(e.target.data);
        total = flashmo_xml.thumbnail.length();
        no_of_extra_row = Math.floor(total / no_of_column) - no_of_row;
        for( i = 0; i < total; i++ )
            filename_list.push( flashmo_xml.thumbnail[i][email protected]() );
            url_list.push( flashmo_xml.thumbnail[i][email protected]() );
            url_target_list.push( flashmo_xml.thumbnail[i][email protected]() );
            title_list.push( flashmo_xml.thumbnail[i][email protected]() );
            description_list.push( flashmo_xml.thumbnail[i][email protected]() );
        load_tn();
    function load_tn():void
        var pic_request:URLRequest = new URLRequest( folder + filename_list[tn] );
        var pic_loader:Loader = new Loader();
        pic_loader.load(pic_request);
        pic_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, on_loaded);
        tn++;
    function on_loaded(e:Event):void
        if( tn < total )
            load_tn();
        else
            fm_previous.visible = true;
            fm_next.visible = true;
            fm_previous.addEventListener( MouseEvent.CLICK, to_previous );
            fm_next.addEventListener( MouseEvent.CLICK, to_next );
            stage.addEventListener(MouseEvent.MOUSE_WHEEL, on_wheel );
        var flashmo_bm:Bitmap = new Bitmap();
        var flashmo_mc:MovieClip = new MovieClip();
        flashmo_bm = Bitmap(e.target.content);
        flashmo_bm.x = - flashmo_bm.width * 0.5;
        flashmo_bm.y = - flashmo_bm.height * 0.5;
        flashmo_bm.smoothing = true;
        var bg_width = flashmo_bm.width + 10;
        var bg_height = flashmo_bm.height + 10;
        flashmo_mc.addChild(flashmo_bm);
        flashmo_mc.graphics.beginFill(0xFFFFFF);
        flashmo_mc.graphics.drawRect( - bg_width * 0.5, - bg_height * 0.5, bg_width, bg_height );
        flashmo_mc.graphics.endFill();
        flashmo_mc.name = "flashmo_" + thumbnail_group.numChildren;
        flashmo_mc.buttonMode = true;
        flashmo_mc.addEventListener( MouseEvent.MOUSE_OVER, tn_over );
        flashmo_mc.addEventListener( MouseEvent.MOUSE_OUT, tn_out );
        flashmo_mc.addEventListener( MouseEvent.CLICK, tn_click );
        flashmo_mc.scaleX = flashmo_mc.scaleY = scale_factor;
        flashmo_mc.x = thumbnail_group.numChildren % no_of_column
                            * ( bg_width + 2 ) * scale_factor;
        flashmo_mc.y = Math.floor( thumbnail_group.numChildren / no_of_column )
                            * ( bg_height + 2 ) * scale_factor;
        thumbnail_group.addChild(flashmo_mc);
    function tn_over(e:MouseEvent):void
        var mc:MovieClip = MovieClip(e.target);
        var s_no:Number = parseInt(mc.name.slice(8,10));
        thumbnail_group.addChild(mc);
        new Tween(mc, "scaleX", Elastic.easeOut, mc.scaleX, 1, tween_duration, true);
        new Tween(mc, "scaleY", Elastic.easeOut, mc.scaleY, 1, tween_duration, true);
        tn_title.text = title_list[s_no];
        tn_desc.text = description_list[s_no];
        tn_url.text = url_list[s_no];
    function tn_out(e:MouseEvent):void
        var mc:MovieClip = MovieClip(e.target);
        new Tween(mc, "scaleX", Strong.easeOut, mc.scaleX, scale_factor, tween_duration, true);
        new Tween(mc, "scaleY", Strong.easeOut, mc.scaleY, scale_factor, tween_duration, true);
        tn_title.text = "";
        tn_desc.text = "";
        tn_url.text = "";
    function tn_click(e:MouseEvent):void
        var mc:MovieClip = MovieClip(e.target);
        var s_no:Number = parseInt(mc.name.slice(8,10));
        navigateToURL(new URLRequest(url_list[s_no]), url_target_list[s_no]);
    function to_previous(e:MouseEvent):void
        if( new_row < 0 )
            new_row++;
            new Tween( thumbnail_group, "y", Strong.easeOut, thumbnail_group.y, default_y + new_row * 100, tween_duration, true );
    function to_next(e:MouseEvent):void
        if( Math.abs(new_row) < no_of_extra_row )
            new_row--;
            new Tween( thumbnail_group, "y", Strong.easeOut, thumbnail_group.y, default_y + new_row * 100, tween_duration, true );
    function on_wheel(e:MouseEvent):void
        if( e.delta > 0 )
            new_row++;
        else
            new_row--;
        if( new_row >= 0 )
            new_row = 0;
        else if( new_row < - no_of_extra_row )
            new_row = - no_of_extra_row;
        new Tween( thumbnail_group, "y", Strong.easeOut, thumbnail_group.y, default_y + new_row * 100, tween_duration, true );

    Anyone got any odeas on how I can get this to work?
    Looking at the code this part is the part which i need to appear on top of everything else.
    function tn_over(e:MouseEvent):void
        var mc:MovieClip =  MovieClip(e.target);
        var s_no:Number =  parseInt(mc.name.slice(8,10));
         thumbnail_group.addChild(mc);
        new Tween(mc, "scaleX", Elastic.easeOut,  mc.scaleX, 1, tween_duration, true);
        new Tween(mc, "scaleY",  Elastic.easeOut, mc.scaleY, 1, tween_duration, true);
         tn_title.text = title_list[s_no];
        tn_desc.text =  description_list[s_no];
        tn_url.text = url_list[s_no];

  • How do I fix a font compatibilty issue from Mac to Windows, using Adobe Flash CS4?

    Hi,
    I need to edit a Flash movie that somebody else developed in Adobe Flash CS3 on a Mac. I'm using Adobe Flash CS4 on Windows (Vista). However, the font that shows up on my computer is much bigger than on the .SWF that he produced.
    He used a custom font, which I had to add to my system Fonts folder. Because Adobe Flash detected the right fonts on my computer, it didn't map them to substitute fonts. I verified that Flash is indeed using the same font files that he used.
    I believe the fonts are being rendered differently because I'm using Windows.
    How do I fix this?

    hi all - I have a similar problem with flash - basically the plugin crashes pretty much every time I am not looking at it directly (playing online games in tabs for example)
    I have tried disabling the "memory-safe-away-time-out thingee" in config:about - to no avail. I have also tried disabling all other plugins (not that I actually have many - Java, VLC, quicktime, some windows stuff), have set themes to default, have made sure all plugins are latest version.
    currently running the 4.0.b2 Firefox version cause of the plug in crashes in the 3.6.8 version - same problem though.
    and where it gets really strange is that a friendly help person on the adobe site suggested I upgrade my firefox to version 3.8 (while I was on the 3.6.8 version) and that would fix it. which I thought was.. interesting as 3.6.8 is the latest version as Firefox upgrade check insisted.
    by now i have invested at least 4 days trying to fix this issue and I gotta say... I am tempted to actually try other browsers, though firefox is my default browser since years.

  • How to pass runtime parameters to Oracle Query from xMII server

    Please can anybody  help me that how to pass runtime parameter to Orcle Query  from xMII server.

    It works the same way as I described in this thread [How to pass runtime parameters to MySQL Query from xMII server].  It does not matter the datasource MII will work the same for all queries, at least for passing in parameters.  How to write those queries and their datatypes will be the differences.

  • How to configure search results web part to display results only after a query is generated from user?

    Hi All,
    I am crawling documents from a file server. I created a new content source and crawled the documents. All documents are crawled successfully.
    Then I went to my enterprise search center site collection and created a new result source. I have added the query to use above content source.
    After that, on a page I am trying to configure the search results web part to display documents using this result source. Now the problem is:
    It displays all the documents that are crawled without searching for anything. I mean first it should not display any results. If a user searches for something , then according to that search it should display results.
    Any idea how to do this in the web part? I am using SharePoint 2013 on premise enterprise edition. No code. Totally OOTB.

    Hi Mohan,
    What did you use for the Query text in the result source?
    I could reproduce this issue when I used Query text like: {searchTerms} Path:”http://sps2k13sp/sites/First/Shared%20Documents”
    Then I changed the Query to
    {?{searchTerms}
    Path:"http://sps2k13sp/sites/First/Shared%20Documents"}
    , then Search result web part didn’t return results without searching.
    So , check your result source, and use the Query like the above(adding "{?...}").
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • How to export result set from mysql query browser to .sql in oracle

    Hi folks:
    I was trying to export result set from MySql query browser to Oracle. I could able to do
    File->Export Result Set-> Excel format...
    What I am trying to get is .sql file so that I can run it as a script in my oracle db. Is there any way we can get .sql file with inserts and delimeters ....?
    Did you guys get my question.?
    Please throw some light on this....
    Could be very appreciable ....
    Thanks
    Sudhir Naidu

    Hi
    Create a sql statement which generates the insert statements.
    Something like this:
    select 'insert into table1 (column1, column2, column3) values (' ||
    column1 || ', ' || column2 || ', ' || column3 || ');' from table 1;
    The || sign is the string concatenation sign in Oracle, replace it the appropriate sign in MySql. Export the result set of this query into a file, and you can run it in a SqlPlus.
    Ott Karesz
    http://www.trendo-kft.hu

  • How to display MySql query results in multiple columns?

    Hi, I know how to display PHP/MySq
    l query results in a single column, but I am really stuck at displa
    ying the results in multiple columns in DW CS4.
    Can anyone help me with a code example?. I am new to php/mysql. Thanks

    Are you asking how to pivot the results of the query? Do a search for horizontal looping. If that's not what you are asking, please provide more details.

  • Getting number of results from mysql query.

    Hi,
    Is there an easy way to get the number of rows (results) returned by a mysql query without looping through each result and incrementing using the rs.next()?
    Statement statement = connection.createStatement();
                   ResultSet rs = statement.executeQuery("SELECT * FROM sometable WHERE name=\"John\"");
                   

    Have you looked at the mysql documentation at all ?
    What about "SELECT count(*) FROM sometable WHERE name=\"John\"");
    And if this value is going to be dynamic at all consider using a preparedStatement.
    Note Haven't worked with MySql so this isn't guarenteed to work, but you get the idea. This is more of a sql question than a java question

Maybe you are looking for

  • Using partition in prepared statement

    Hello, I am connecting to an oracle 9i database and write a prepared statement like String query = "SELECT * FROM ADM.TABLE1 PARTITION (TABLE1_?)"; PreparedStatement pstmt = dbConnection.prepareStatement(query); pstmt.setString(1, "20" + callDate); /

  • Af:column af:inputComboboxListOfValues Not Rendering as LOV

    I have an updateable af:table UI Component based on a View Object (which is a child of another VO). Both VOs are based on Entities. There are 3 attributes in the ViewObject the table is based on, that have LOVs defined - with the hint set to Combo Bo

  • At&T App

    I used my AT&T app to pay my bill this week and my credit card got hacked and someone charged over $700 on an Apple store.I need help on this! Anyone has had the same problem with that App for the Iphone 4? I am deleting it in the meantime.Called ATT

  • Application Content behavior

    Which scenario would be the most efficient disk space wise specifically on the content being distributed, but I welcome any further thoughts as well. Scenario 1: One application with 7 deployment types, each deployment type points to the same content

  • Ipad2 Airport

    I state that I am Italian and the translation made ​​by Google ... I wanted to know, ipad2 who has tried to connect to a network created by MBP? because to me the symbol for the wifi! it is not connected to my mac, because if I try to hear the songs