Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Looping Through Recordset....ARRGGGHHH



can't figure out why the dynamic text boxes in my dynamic clip arent picking up the variable when I loop through this recordset!

the trace (you'll see here right after I try two ways to assign the variable) traces the correct info back...

argghhh!!!

code (incomplete, rest of function works great though! - thanks to Smee's help!":

Code:
getSweetWater_Result = function(rs){

// Set the height of the menu to zero initially, since there are no items yet.
var ItemListHeight = 0;

recordSetLength = rs.getLength()
// Loop through the code that adds an item to the list.

for(var i=0; i<recordSetLength; i++){
//attach mc's
C = MenuHolder.attachMovie("dynClip", "dynClip_"+i, i);
C[i].boatName = rs.getItemAt(i).vp_model;
this["dynClip"+i].boatPrice = rs.getItemAt(i).vp_pkg_cost;
trace(rs.getItemAt(i).vp_model);



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 08-22-2005, 04:53 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

RecordSet() Prv & Next
is there property in working with a recordSet object returned from a cfc to flash to display a limited number of results on the page at a time? Then using a prv | nxt way of displaying the next set of records ?

I've been trying to use .setDeliveryMode() but it still just shows all the items anyway. From what i gather this method doesn't actually limit the display of items, but rather just the way they are loaded in ?

Any help appreciated!

RecordSet And Textfiles
Hey guys,

A client of mine wants a database for all there products ... but doesn't want to pay for the creation of a DB ... so I'm going to use a textfile as the database ...

But I'm a little confused ... I can't seem to figure out how it works ...

Can anyone point me to an example of one ...

thanks

Using An Asp Recordset In Flash
Hi,

I'm building a rotating news banner in flash that rotates through various articles that are stored on a database. I've been playing around with it and managed to get flash to display one article by using the following code:


PHP Code:




var contactInfo:LoadVars = new LoadVars();    // create LoadVars instance

contactInfo.load("flash_home.asp");              // load external data

contactInfo.onLoad = function (success:Boolean) { // monitor data download
    if (success) {                            // system passes status
    
        title_txt.text = this.fl_title;    //load variables into dynamic text boxes
        subhead_txt.text = this.fl_subhead;    
        timer_txt.text = this.fl_timer;    
        link_txt.html = true; //Create clickable link
        link_txt.htmlText = "<u>" + "<a href='" + this.fl_link + "'>"
                + this.fl_link + "</a>" + "</u>";
        
        empty_mc.loadMovie(this.fl_image);    // load JPEG into blank movie clip
            
    } else {
        trace("Failure");
    }
}







But what I want to do is put all the data in a recordset using asp and then flash to display each record for a set ammount of time before going on to the next record and so on. Problem is I'm not sure how to go about that in flash. (the asp bit I can do).

Could anyone give me an idea of what I need to do or point me in the right direction. Cheers

Also in that above code I'm trying to populate a blank movie clip with an image. On the stage I've got a blank movie clip with an instance name of empty_mc. And the url of the image is passed via the fl_image. But it isn't working. Can anyone see why?

Thanks

RecordSet.filter
Hi, I'm working on a CMS with amfphp and have a problem filtering/matching data from two recordSets. I have one photosReturn recordSet that holds data about photo gallery - title, description, id, etc.. The second recordSet, allfilesReturn, contains the image information for the galleries - filepath, caption, module id, etc..

The id field from photosReturn matches the moduleid from allFilesReturn so this is the common element to match the two.

This is what I currently have in my class, but it only returns one photo instead of all of the photos within a gallery:

ActionScript Code:
function buildPhotos()
{
for (var i = 0; i < this.photosReturn.length; i++)
{
var filtered_rs:RecordSet = this.calcRecords("allfilesReturn", this.photosReturn.getItemAt(i).id);

}
}


function calcRecords(record, id)
{
function sortID(aRecord, article_id)
{
return (aRecord.moduleid == article_id);
}
return this[record].filter(sortID, id);
}




This is the photosReturn recordSet:

ActionScript Code:
Result (object #2)
.....mRecordsAvailable: 2
.....serverInfo: (undefined)
.....uniqueID: 2
....._items (object #3)
..........[0] (object #4)
...............__ID__: 0
...............active: 1
...............category: "Show"
...............datecreated: "2006-11-22 23:20:21"
...............description: "This is the first one."
...............id: 9
...............section: ""
...............sectionid: 0
...............title: "Collection One"
..........[1] (object #5)
...............__ID__: 1
...............active: 1
...............category: "Press"
...............datecreated: "2006-11-22 23:20:52"
...............description: "This is the second one."
...............id: 10
...............section: ""
...............sectionid: 0
...............title: "Collection Two"
.....mTitles (object #6)
..........[0]: "id"
..........[1]: "section"
..........[2]: "sectionid"
..........[3]: "category"
..........[4]: "title"
..........[5]: "description"
..........[6]: "active"
..........[7]: "datecreated"




This is the allFilesReturn recordSet:

ActionScript Code:
Result (object #2)
.....mRecordsAvailable: 3
.....serverInfo: (undefined)
.....uniqueID: 3
....._items (object #3)
..........[0] (object #4)
...............__ID__: 0
...............caption: ""
...............cmspath: "userimages/9daily_tn.jpg"
...............datecreated: "2006-11-26 21:11:47"
...............filepath: "/cms/photos/userimages/9daily_tn.jpg"
...............id: 150
...............module: "photos"
...............moduleid: 9
...............section: ""
...............sectionid: 0
..........[1] (object #5)
...............__ID__: 1
...............caption: ""
...............cmspath: "userimages/10item_tn.jpg"
...............datecreated: "2006-11-26 21:11:31"
...............filepath: "/cms/photos/userimages/10item_tn.jpg"
...............id: 149
...............module: "photos"
...............moduleid: 10
...............section: ""
...............sectionid: 0
..........[2] (object #6)
...............__ID__: 2
...............caption: ""
...............cmspath: "userimages/9angeleno_tn.jpg"
...............datecreated: "2006-11-26 21:19:44"
...............filepath: "/cms/photos/userimages/9angeleno_tn.jpg"
...............id: 151
...............module: "photos"
...............moduleid: 9
...............section: ""
...............sectionid: 0
.....mTitles (object #7)
..........[0]: "id"
..........[1]: "caption"
..........[2]: "section"
..........[3]: "sectionid"
..........[4]: "module"
..........[5]: "moduleid"
..........[6]: "filepath"
..........[7]: "cmspath"
..........[8]: "datecreated"


Thanks for any help!

RecordSet.filter
Hi, I'm working on a CMS with amfphp and have a problem filtering/matching data from two recordSets. I have one photosReturn recordSet that holds data about photo gallery - title, description, id, etc.. The second recordSet, allfilesReturn, contains the image information for the galleries - filepath, caption, module id, etc..

The id field from photosReturn matches the moduleid from allFilesReturn so this is the common element to match the two.

This is what I currently have in my class, but it only returns one photo instead of all of the photos within a gallery:

Code:

function buildPhotos()
   {
      for (var i = 0; i < this.photosReturn.length; i++)
      {
         var filtered_rs:RecordSet = this.calcRecords("allfilesReturn", this.photosReturn.getItemAt(i).id);

      }
   }


function calcRecords(record, id)
   {      
      function sortID(aRecord, article_id)
      {
         return (aRecord.moduleid == article_id);
      }
      return this[record].filter(sortID, id);
   }


This is the photosReturn recordSet:

Code:

Result (object #2)
.....mRecordsAvailable: 2
.....serverInfo: (undefined)
.....uniqueID: 2
....._items (object #3)
..........[0] (object #4)
...............__ID__: 0
...............active: 1
...............category: "Show"
...............datecreated: "2006-11-22 23:20:21"
...............description: "This is the first one."
...............id: 9
...............section: ""
...............sectionid: 0
...............title: "Collection One"
..........[1] (object #5)
...............__ID__: 1
...............active: 1
...............category: "Press"
...............datecreated: "2006-11-22 23:20:52"
...............description: "This is the second one."
...............id: 10
...............section: ""
...............sectionid: 0
...............title: "Collection Two"
.....mTitles (object #6)
..........[0]: "id"
..........[1]: "section"
..........[2]: "sectionid"
..........[3]: "category"
..........[4]: "title"
..........[5]: "description"
..........[6]: "active"
..........[7]: "datecreated"


This is the allFilesReturn recordSet:

Code:

Result (object #2)
.....mRecordsAvailable: 3
.....serverInfo: (undefined)
.....uniqueID: 3
....._items (object #3)
..........[0] (object #4)
...............__ID__: 0
...............caption: ""
...............cmspath: "userimages/9daily_tn.jpg"
...............datecreated: "2006-11-26 21:11:47"
...............filepath: "/cms/photos/userimages/9daily_tn.jpg"
...............id: 150
...............module: "photos"
...............moduleid: 9
...............section: ""
...............sectionid: 0
..........[1] (object #5)
...............__ID__: 1
...............caption: ""
...............cmspath: "userimages/10item_tn.jpg"
...............datecreated: "2006-11-26 21:11:31"
...............filepath: "/cms/photos/userimages/10item_tn.jpg"
...............id: 149
...............module: "photos"
...............moduleid: 10
...............section: ""
...............sectionid: 0
..........[2] (object #6)
...............__ID__: 2
...............caption: ""
...............cmspath: "userimages/9angeleno_tn.jpg"
...............datecreated: "2006-11-26 21:19:44"
...............filepath: "/cms/photos/userimages/9angeleno_tn.jpg"
...............id: 151
...............module: "photos"
...............moduleid: 9
...............section: ""
...............sectionid: 0
.....mTitles (object #7)
..........[0]: "id"
..........[1]: "caption"
..........[2]: "section"
..........[3]: "sectionid"
..........[4]: "module"
..........[5]: "moduleid"
..........[6]: "filepath"
..........[7]: "cmspath"
..........[8]: "datecreated"

RecordSet Paging On DataGrid
hi Dudes,
two Questions.
1)
does anybody knows how to achive recordSet Paging using dataGrid-Component? is ther any tutorial on that topic?
2)
or at least how to know which "row" and "colomn" a clicked?
for example:
function dataGridChangeHandler () {
// this line gets the clicked row
var sItem=grid_dg.getSelectedItem();
//BUT HOW TO GET CLICKED COLMN OF THAT ROW
}

thanks nermin

Help: Flash & ASP (Paging Through Recordset)
Hello, I've got my flash movie pulling the variables from my asp page, which is pulling data off my database. I was wondering if anyone could help me setup my movie to list like 25 records at a time. I have an example of what I want to do on a asp version of this, that I created ( http://dj.silverskymedia.com/playlist.asp ). I would like to recreate something like that in flash, without the shopping cart for now. Any suggestions would be appreciated.

Here's what I've created so far: http://www.silverskymedia.com/beta/data.html

Loading Recordset Into Flash
Is there any way to load a recordset into Flash without using Coldfusion MX, or actually using ASP. It would seem that this would be an easy thing to do, but from what I have read I don't believe it is possible. Passing name=value pairs into Flash seems like such a pain in the butt.

Thanks

.fe.

Vertical Datagrid Of Recordset
The datagrid fills itself automatically with a recordset. I want the record's keys to be listed on the side, not on top.

Here's an example (component inspector):


Any ideas?

Sorting AMFPHP Recordset
Hello,

I am trying to use the sortItemsBy method for the recordset that is returned from AMFPHP. For whatever reason, it's not working. Is there something that I am missing? Here's the code:


Code:
function handleGetVideos(re:ResultEvent):Void
{
videoRS = re.result;
records += videoRS.getNumberAvailable();
total_records = videoRS.getLength();
videoRS.sortItemsBy("video_id");
populateGrid(videoRS);

if(records<total_records) {
btnNextPage.enabled = true;
btnNextPage._alpha = 100;
} else {
btnNextPage.enabled = false;
btnNextPage._alpha = 50;
}

if(records > per_page) {
btnPrevPage.enabled = true;
btnPrevPage._alpha = 100;
} else {
btnPrevPage.enabled = false;
btnPrevPage._alpha = 50;
}
}
TIA,
JP

Working With RecordSet Data
Hi ..my old login doesn't seem to have any permissions so i've created a new one .. anyway moving right along.

I have a remoting connection that pulls back a query, from a cfc. It's being handled in the following manner:


Code:
function getData() {
var pc:PendingCall = johnLuceProperties.getPropertyItems({wallSide:"left"});
pc.responder = new RelayResponder(this, "query_Result", "query_Fault");
}

getData();

function query_Result(re:ResultEvent):Void {
propertyDetails = re.result;
var i
for(i=0;i<5;i++) {
trace(propertyDetails.getItemAt(i).wallImage);
};

}
Now .. the trace statement will display 5 image file names .. image1.jpg etc, so i'm safely assuming my code is correct in accessing the recordset data.

Here is the problem. If i try to use it in contentPath for a loader component i get nothing.


Code:
function loadPropertyImage() {
property_mc.createClassObject(mx.controls.Loader, "propertyLoader", i);
property_mc.propertyLoader.autoLoad = true;
property_mc.propertyLoader.scaleContent = false;
property_mc.propertyLoader.move(5,5);
property_mc.propertyLoader.contentPath = propertyDetails.getItemAt(i).wallImage;
}
which is then called in a loop:


Code:
var i
for(i=0;i<10;i++) {
loadPropertyImage();
};
There are a few other functions being called etc in the loop also but i've taken them out to try and thin this down for everyone. :-)

When it's in loadPropertyImage() function it becomes undefined, but even if you put it inside the loop outside the function it still seems undefined ..

Any ideas guys ??

AMFPHP To RecordSet In Actionscript 3.0?
Can someone explain to me how to retrieve a RecordSet in an Actionscript 3.0 based file from AMFPHP.

The below example is taken from the homepage at http://www.amfphp.org/. It's showing how to retrieve a MySQL query directly from AMFPHP without first having to convert it to a string.

As you can see flash is instanciating a RecordSet to catch the returned MySQL query. Is there an equivalent to doing this in Actionscript 3.0 as RecordSet seems to be an Actionscript 2.0 class only.

Sorry if this is a stupid question.


Code:
<?php
class pizzaService {
var $ordertable = "amfphp_orders"; // the orders table
var $pizzatable = "amfphp_pizzas"; // the pizzas table
/* mysql_connect and mysql_select_db are in the constructor */
function getOrderList ()
{
$sql = "SELECT o.order_id as orderid, o.order_status as status, o.order_name as name, p.pizza_id as pizzaid, p.pizza_details as details, p.pizza_quantity as quantity FROM $this->ordertable o, $this->pizzatable p WHERE o.order_id = p.order_id AND o.order_status=1 ORDER BY o.order_time";
return mysql_query($sql);
}

/* Other methods below */}
?>

Code:
import mx.remoting.*;
import mx.rpc.*;

var gatewayUrl:String = "http://amfphp.org/amfphp/gateway.php";
service = new Service(gatewayUrl, null, "pizzaService");

var pc:PendingCall = service.getOrderList();
pc.responder = new RelayResponder(this, "handleGetOrderList", null);

function handleGetOrderList(re:ResultEvent)
{
var rs:RecordSet = RecordSet(re.result);
for(var i = 0; i < rs.length; i++) {
var item = rs.getItemAt(i);
//item is an object with keys orderid, status, etc.
}
}

Reading Recordset-XML Files
In AS3, I know how to load and read a simple XML file of the type:

Code:
<people>
<person id="1">Blah blah</person>
<person id="2">Blah blah</person>
</people>
For example, I could load this code into an xml variable and do:
ActionScript Code:
trace(xmlVar.person)

However, when I saved a SQL Server recordset to XML with some ASP code, I got the following XML format:


Code:
<xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
xmlns:rs='urn:schemas-microsoft-com:rowset'
xmlns:z='#RowsetSchema'>
<s:Schema id='RowsetSchema'>
<s:ElementType name='row' content='eltOnly' rs:CommandTimeout='30'>
<s:AttributeType name='ID' rs:number='1'>
<s:datatype dt:type='int' dt:maxLength='4' rs:precision='10' rs:fixedlength='true' rs:maybenull='false'/>
</s:AttributeType>
<s:AttributeType name='c1' rs:name='Status Code' rs:number='2' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='20' rs:fixedlength='true' rs:maybenull='false'/>
</s:AttributeType>
<s:extends type='rs:rowbase'/>
</s:ElementType>
</s:Schema>
<rs:data>
<z:row ID='1' c1='Add '/>
<z:row ID='2' c1='Drop '/>
<z:row ID='3' c1='Modify Date '/>
<z:row ID='4' c1='Complete '/>
<z:row ID='5' c1='Modify Parameters '/>
</rs:data>
</xml>
I was able to do these successfully: load the XML file with a URLLoader function
define an XML variable with the loaded file: var xml:XML = new XML(e.target.data)
view the entire loaded XML file: trace(xml)

What I have not been able to do is access the data items in the <z:row> elements. For example, I would like to show a trace of the c1 attribute where ID = '3'.

I found loads of AS3 tutorials for standard xml, but not the recordset-xml that is normal for saving ADO recordsets. (I could look into transforming the XML into a simpler XML with XSLT, but I don't want to go down that road yet.)

Does anyone know where I could learn how to use AS3 to read the kind of XML format that I quoted above?

Any help would be greatly appreciated.

Copying A Recordset To A Variable
I'm having trouble copying a RecordSet to a local variable so I can use it outside of the result function.

Here's the code I've tried, I've gone through lots of combinations but still can't get it right. I want to assign the Recordset returned to the local variable myResult and use it elsewhere in the ActionScript.


ActionScript Code:
NetServices.setDefaultGatewayUrl... etc
var gw = NetServices... etc
var server = gw.getService( "cfcs.navigation", new Result() );
server.getMainNavigation();

var myResult;

function Result() {
   
    this.onResult = function(result) {

        if ( result.isFullyPopulated() ) {
            trace("1: " + result.getItemAt(0)["DefaultURL"]); // This works
            myResult = result;
            trace("2: " + myResult.getItemAt(0)["DefaultURL"]); // This works
        }
       
        //trace("Data received from server : " + result);
        //trace(result.getItemAt(0)["URL"]);
    }

    this.onStatus = function(error)
    {
        trace("Error : " + error.description);
    }
}


trace("3: " + myResult.getItemAt(0)["DefaultURL"]); // This doesn't work

Can anyone point me in the right direction?

Thanks

RecordSet/DataGlue -amfphp
Wondering what I need to do to be able to use the DataGlue API, or if it even works with amfphp.

I've been able to get data back from php/mySql and populate a combobox but... I would like to figure out how to bind the data using DataGlue.

When I recieve the data back using amfphp is that considered a RecordSet or do I have to create a RecordSet in flash using

new RecordSet (colunmNames) or something

Possible To Make A *copy* Of A RecordSet
i have a SWF that remotes a fairly large RecordSet (~1800 records). It's a list of products and some info about them.

I'm writing some code to let a store administrator associate products with each other ( so the site says "These other Companion Prodcuts might interest you"). I therefore have to list one record set of 1800 products simultaneously in two different data grids. the first to list the products and load the 'Companion Products' list. the other to let the admin choose which products to associate.

Is it possible to COPY a dataset returned from a remoting call? I have my app working right now but each instance of the productListDataGrid that I have on my flash movie calls the list from the server independently. I was thinking it would be more efficient to call the list once and split it into two copies--one for each dataGrid. Can this be done?

ResultSet - RowSet - RecordSet
Hi there,
I'm a newbie to Flash Remoting. I'm having difficulty transferring a result set to flash using an intermittent rowset, can anyone help?
The result to flash is null with either of the implementations (commented & uncommented).


import java.sql.*;
import javax.sql.rowset.CachedRowSet;
import com.sun.rowset.CachedRowSetImpl;

public class JavaClassService {
public ResultSet getResultSet(){
Connection connection = null;
try{

Class.forName( "com.mysql.jdbc.Driver" );
connection = DriverManager.getConnection( "jdbc:mysql://localhost/test", "root", "space7107");
Statement stmt = connection.createStatement();
ResultSet resultset = stmt.executeQuery("SELECT * FROM testdata");
CachedRowSet crs = new CachedRowSetImpl();
//crs.setUsername("root");
//crs.setPassword("space7107");
//crs.setUrl("jdbc:mysql://localhost/test");
//crs.setCommand("SELECT * FROM testdata");
//crs.execute();
crs.populate(resultset);
resultset.close();
stmt.close();
connection.close();
return crs;
}catch(Exception e){

}finally{
try{
if(connection!= null && !connection.isClosed()) connection.close();
}catch(SQLException e){}

}
return null;

}
}

What Does This Mean: Import Mx.remoting.RecordSet
hello;

I am adopting AS2;

I get the import concept;

my problem is the "mx.remoting.RecordSet";

when I look in the Adobe Flash CS3 documentation ( "ActionScript 2.0 Language Reference/ActionScript classes" ), I do not see 'mx' OR "remoting" OR "RecordSet" listed;

so, in this example, is 'mx' a superclass? or what? and where do I find documentation on it as well as all other whatever they are??


thanks
dsdsdsdsd

MySQL-PHP-Flash: Recordset
Hi all.

I need to display a full recordset (say a table or a select from a table, returning many rows, not a single one) in a Flash doc, but I'm clueless.

BTW, I read in other messages about amfphp which seems to be a good choice, but I can't use it on the Web Server (got no choice here).

Thanks in advance
Bernardo

Recordset Problem..... Help Needed
Hi all,

I am using amfphp for sending a recordset to flash and showing the recordset in a data grid.

The code in flash is :


Code:
var test:RecordSet = RecordSet(re.result)
_root.md_dg.dataProvider = test
Where
Code:
_root.md_dg
is instance name of my datagrid

And its working fine.... the problem is that in the datagrid header its showing columnNames same as in the databse e.g. id, name, email

I want the columnNames to be Id, Name, Email.

Can anyone help me out.

Thanks

AMFPHP To RecordSet In Actionscript 3.0? Help?
Can someone explain to me how to retrieve a RecordSet in an Actionscript 3.0 based file from AMFPHP.

The example below is taken from the homepage at http://www.amfphp.org/. It's showing how to retrieve a MySQL query directly from AMFPHP without first having to convert it to a string.

As you can see flash is instanciating a RecordSet to catch the returned MySQL query. Is there an equivalent to doing this in Actionscript 3.0 as RecordSet seems to be an Actionscript 2.0 class only.

Sorry if this is a stupid question.


Code:
<?php
class pizzaService {
var $ordertable = "amfphp_orders"; // the orders table
var $pizzatable = "amfphp_pizzas"; // the pizzas table
/* mysql_connect and mysql_select_db are in the constructor */
function getOrderList ()
{
$sql = "SELECT o.order_id as orderid, o.order_status as status, o.order_name as name, p.pizza_id as pizzaid, p.pizza_details as details, p.pizza_quantity as quantity FROM $this->ordertable o, $this->pizzatable p WHERE o.order_id = p.order_id AND o.order_status=1 ORDER BY o.order_time";
return mysql_query($sql);
}

/* Other methods below */}
?>

Code:
import mx.remoting.*;
import mx.rpc.*;

var gatewayUrl:String = "http://amfphp.org/amfphp/gateway.php";
service = new Service(gatewayUrl, null, "pizzaService");

var pc:PendingCall = service.getOrderList();
pc.responder = new RelayResponder(this, "handleGetOrderList", null);

function handleGetOrderList(re:ResultEvent)
{
var rs:RecordSet = RecordSet(re.result);
for(var i = 0; i < rs.length; i++) {
var item = rs.getItemAt(i);
//item is an object with keys orderid, status, etc.
}
}

Recordset Output Best Practice
what is the best way to output resultsets in flash?  i am a coldfusion developer getting into flash development specifically with flash remoting and actionscript 2.0.  i am familiar with the list and datagrid components but they do not  seem to offer what I am trying to do, i want to output records as i would in CF by iterating over the object and displaying the records with whatever formatting/rollovers i specify, maybe underlined with a graphic on the left or something like that.  i've been googling for a few hours and am no closer.


=========================================
I have not failed. I've just found 10,000 ways that won't work.
Thomas A. Edison

Pass Recordset To Cfcomponent?
im making a flash based shopping cart, and i want the cart contents to persist in memory across page refreshes.  im trying to find an easy way to stick the cart contents (which are a recordset in flash) into a session variable using a cfcomponent.

i can do a query in CF, store that as a session variable, then pass to flash and its fine... but i cant pass the recordset out and store it.  i dont seem to be able to pass it out at all as an argument.  there seems to be an incompatibility, like it doesnt want to accept the recordset as a standard query type.  (it doesnt work as "any" either)

anybody ever do anything like this.  im willling to consider any methid to get the job done.  what the hell is a recordset?  it seems like a query going into flash becomes a recordset, but a recordset going out to coldfusion doesnt become a query?  what am i missing?

this is my test function, which gets passed a single recordset as an agrument.  it seems to work with arrays, numbers, etc. but blows up with a recordset.

<cffunction name="cartSave" access="remote" returntype="void">
     <cfargument name="cartSet" type="any" required="true" default="">
     <cfset session.cartSet = #arguments.cartSet#>
</cffunction>

.. thanks

Dynamically Adding A New Item To RecordSet
I know that one can add a new record to a RecordSet like this:
code:
var myRS = new RecordSet("post_id","post");
var newItem = {post_id: 1, post: "This is the first post."};
myRS.addItem(newItem);
I also know that one can fill in the values of the "newItem" like this:
code:
var myRS = new RecordSet("post_id","post");
var myItems[1,"This is the first post."];
var newItem = {post_id: myItems[0], post: myItems[1]};
myRS.addItem(newItem);
However, what if the field names need to be dynamic? How would I accomplish that? Here is the code:
code:
var myFieldList = ["post_id","post"]; // create an array with field names
var myRS = new RecordSet([myFieldList]); // this works
var myItems[1,"This is the first post."];
var newItem = {myFieldList[0]: myItems[0], myFieldList[1]: myItems[1]}; // this does not work
myRS.addItem(newItem);
As you can see, the only problem is referencing the field names dynamically. I've tried all sorts of things:
code:
var newItem = {this[myFieldList[0]]: myItems[0], etc...};
var newItem = {eval(myFieldList[0]): myItems[0], etc...};
var newItem = {eval(myFieldList[0] + ":" + myItems[0]), etc...};
and so on . . . I've even tried defining each field individually with "RecordSet.setField()", but nothing so far.

Anyone have any ideas?

retrotron

RecordSet Object & Duplicate Movie
Hi All,
I'm looking for an example on how to effectively use the duplicate movie and the Flash RecordSet object together.

My project involves duplicating some movie clips with values that are being populated by some coldfusion queries resulting in lists of values. We pass those to Flash, then loop the values into arrays and assign values to the movie clips based on position in the array.

piece-o-the-ColdFusion:

<CFSET STNNUM_LIST="">
<CFSET STNNUM_SUB_LIST="">
<CFSET STNID_LIST="">

<CFSET STNNUM_LIST=ListAppend(STNNUM_LIST,QE2.STNNUM,"|") >
<CFSET STNtype_LIST=ListAppend(STNtype_LIST,QE2.STNITMCOD ,"|")>
<CFSET LOCATION_LIST=ListAppend(LOCATION_LIST,QE2.STNLOCD SC,"|")>

piece-o-the-ActionScript:

// convert CF variables to Flash arrays
stnnum = stnnum.split("|");
stnnum_sub = stnnum_sub.split("|");
stnid = stnid.split("|");
slgstnid = slgstnid.split("|");

then later to assign the properties and dupe the clip:

for (k=0; k<(stnnum.length); k++) {
// this assures that coords are of a number value
xCoord[k] = Number(xCoord[k]);
yCoord[k] = Number(yCoord[k]);
// clone movie clip and name it
rClip = mcMaster.duplicateMovieClip("mc"+k, k);
// set position
rClip._y = initialy + (buttonheight * k);
rClip._x = initialx + (buttonheight * k);
rClip.tgtdsc = tgtdsc[k];
}
stop();


The big key for me has traditionally been, for example, that the 4th item in all of the arrays described the info for the 4th movieclip.

The method seems to be working well, but I'm a little unsettled about passing so many values through a string value...

I'm looking for a method to be able to extract usable variables from a recordset object to avoid having to use the loadVars approach. I get a great looking return from the NetConnection Debugger that confirms that I'm connected and returning propely. I get...

Result (object #2)
.....mRecordsAvailable: 3
.....serverinfo: (undefined)
.....uniqueID: 3
.....items (object #3)
..........[0] (object #4)
...............Activity: "Yes"
...............CUSNUM: 8699
...............PRYSID: 5
...............PTYID: 8333
...............RecentCount: 8
...............STNUM: 205
...............STNUM_SUB: "A"
...............StationItem: "Monitoring Regluar SVC"
...............StationType: "MON"
...............Status: "ACT"
...............WBHSTNID: 3
...............__ID__: 0
...............LastInspected (object #5)
...................."Sun May 4 00:00:00 GMT-0400 2003"
..........[1] (object #6)
...............Activity: "Yes"
...............CUSNUM: 8699
...............PRYSID: 5
...............PTYID: 8333
...............RecentCount: 3
...............STNUM: 100
...............STNUM_SUB: (undefined)
...............StationItem: "Monitoring Regluar SVC"
...............StationType: "MON"
...............Status: "ACT"
...............WBHSTNID: 1
...............__ID__: 1
...............LastInspected (object #7)
...................."Fri May 2 00:00:00 GMT-0400 2003"
..........[2] (object #8)
...............Activity: "Yes"
...............CUSNUM: 8699
...............PRYSID: 5
...............PTYID: 8333
...............RecentCount: 6
...............STNUM: 205
...............STNUM_SUB: (undefined)
...............StationItem: "Monitoring Regluar SVC"
...............StationType: "MON"
...............Status: "ACT"
...............WBHSTNID: 2
...............__ID__: 2
...............LastInspected (object #9)
...................."Sat May 3 00:00:00 GMT-0400 2003"
.....mTitles (object #10)
..........[0]: "WBHSTNID"
..........[1]: "StationType"
..........[10]: "STNUM"
..........[11]: "STNUM_SUB"
..........[2]: "StationItem"
..........[3]: "Activity"
..........[4]: "LastInspected"
..........[5]: "RecentTargetCount"
..........[6]: "Status"
..........[7]: "CUSNUM"
..........[8]: "PTYID"
..........[9]: "PRYSID"
.....views (object #11)
..........No properties

Which (though for the moment lacking positional x, y data) has all of the other attributes that I am trying to assign to my duplicated clips (aside from the inspected date which looks screwy to me)...

I've found that in flash I can use a couple of the recordset instructions that give me some summary info about the recordset:
//list of column names
rs.getColumnNames().join();
//The total number of records in the RecordSet
recordcount = rs.getLength();

But I'm feeling cornered by Recordsets otherwise. It seems great for presenting datagrids, but that's not really what I'm after. I need to use the values in that recordset to affect the appearance and elements of my movie...

I'm sure I'm just missing the boat here, anybody got an example or a method I can try here?

thanks,
Steve

*PLS HELP* Referencing SQL Query Recordset Items
ok i'm using flash remoting to connect to a CFC and returning a recordset with, for example, 2 columns and 4 rows. how do i reference the value in row 2, column 3? is the recordset being returned in the form of a multi-dimensional array? i've tried setting a variable rs to: rs = result[1][2] but to no avail...

desparately trying to get this to work- TIA

Function Didn't Return RecordSet
I am using amfphp and using AS2 class for remote calls.

I have categories and fetch it through loop and at same time I want t fetch subcategory in another loop inside
the loop based on some id

The function doen't returns the RecordSet.

is there anyway to solve it.

returning doesn't looks working. and I'm just using _global variable get any mysql_query.

Please any one help me.

Problems Getting A Query (recordset) From Coldfusion
hi all,

i have a few projects that were origionally built in flash 6 using remoting to call data from a coldfusion server. i have recently been asked to extend one of those projects using flash 9 (as3).

my problem is that after adjusting all the code to work for as3, i am now finding that when i call the cfc in remoting, i do not recieve the results in the format i used to... in fact, the actual data no longer gets passed back. i have tested and found that if i pass any other type of variable than a query to flash from the cfc method, it works, but passing a query give me an array with index 0 with a value of undefined in flash.

there used to be a recordset object in flash for managing query data passed in via remoting. does anyone know what the equivilent is in as3?

i can't change the origional method to pass back an array/struct as it is used extensively for many other purposes and i don't really want to have to write new methods just for the as3 stuff. i'd much rather be able to continue to use queries as this is the norm for most of the methods on the system i am working with.

thanks a mil',
nikki

[AMFPHP] Recordset's And Callback Handlers
I'm having a real hard time getting my head around how to properly design an OOP app with AMFPHP's recordset's. I have a function that performs the service call, as normal. The service call has a success handler, which operates just fine. My proble is what to do with the data after the service is called successful.

I don't want to have this success callback function be the single location in which I draw the data on the stage. Is it possible to send this record set data out of the success hanlder function, so I can use it within other classes that are more geared towards drawing the data on the stage?

If I want to go more of an MVC approuch, that makes sense, but how do I call that function to return it properly?


ActionScript Code:
//example to return data from the success callback
 
function getAllReleases()
{
    var pc:PendingCall = service.getAllReleases();
    pc.responder = new RelayResponder(this, "handleGetAllReleases", null);
}
   
 
function handleGetAllReleases(re:ResultEvent):Object
{
    //call back function. re.result is an object
    return re.result;
}

Flash, ASP And Baffling ASP Recordset Variable Values
I hate to continue this thread and demonstrate my absolute lack of knowledge on this subject so publicly, but I hope everyone can be patient with me. I've been writing ASP, VB, SQL, etc. for years and years, but I'm new to Flash and a little confused...

I have followed all the posted suggestions, however, my Flash movie is reading everything EXCEPT the value of the ASP variable. You see, I use a SQL statement to retrieve a recordset and the correlating value for this variable. As long as I don't include the code for the recordset, my hard-coded ASP variable value gets passed into MX just fine.

However, with the recordset as output from the asp I put:

Response.write "&Flash_LevelID=" & rs(0)

My Flash movie is only seeing:

Flash_LevelID= "

---- OR ----

If I change the ASP code to:

Response.write "&Flash_LevelID=" & rs(0) & "&"

then what Flash sees is:

Flash_LevelID=""

---- OR -----

I have also tried:

Response.write "Flash_LevelID=" & rs(0)
(without the ampersand before the variable name)

In response, my Flash movie is only seeing:

Flash_LevelID= undefined

-----------------------------------------------
Like I said, if I create ASP code that says:

"&Flash_LevelID=23&"

Then Flash reads CORRECTLY:

Flash_LevelID=23
----------------------------------------------

Apparently I've missed something very important in transferring the values from ASP recordset and I just can't get a handle on what it might be.

Can someone who knows what they are doing with these crazy ASP recordsets and Flash variables help me?

Thank you, thank you, thank you!

[AMFPHP] Return A Recordset From Microsoft SQL Server?
Hey guys,

I'm using this connection string to fetch some results in AMFPHP :

Code:
$this->Con = new COM('ADODB.Connection') or die('Cannot start ADO.');
$this->Con->Open("Provider=sqloledb;Data Source=qbc-dev;Initial Catalog=datab;User Id=admin;Password=1234");
It works fine if I return a particular field (ex: $rsSelect->Fields[0]->value) but the service browser just freezes when I try to return a entire recordset (it doesn't return anything, not even some kind of error message).

Any idea what's going on? I am wondering if it could be my sql provider (sqloledb) that may be not supported.

Thanks!

My RecordSet Class Won't Import Fl.data.DataProvider
Why won't the DataProvider base class import!?

I keep getting an error with this class.

PHP Code:



package com.gfxcomplex.data {        import fl.data.DataProvider;            class RecordSet extends DataProvider{                public var dataProvider:DataProvider;                    public function RecordSet(values:Array, category:Array){            var ar:Array = new Array();            for (var a:Number = 0; a < values.length; a++) {                ar[a] = new Object();                for (var aIndex:* in category) {                    ar[a][category[aIndex]] = values[a][aIndex];                }            }            dataProvider = new DataProvider(ar);        }    }} 





Quote:




class RecordSet extends DataProvider{
1017: The definition of base class DataProvider was not found.

Pre-fetched Data Vs MySql Query Resource Id (RecordSet Class)
Hello,

It has been some time since I started developing RIA in the flash platform using Flash Remoting for the client/server communication. I use the CakePHP framework (www.cakephp.org) and AMFPHP alltogether (through the CakeAMFPHP Cake add-on) and I´m quite happy with it...

I know about Pageable RecordSets and I would like to use it as much I as I can. However, PageAble recordsets mean that I need to return the mysql query resource id. Here is an example (not using CakePHP for the sake of simplicity):


PHP Code:



function getEvents() {
     $query = "SELECT * FROM events";
     $resource_id = mysql_query($query);
     return $resource_id;





This would be enough for AMFPHP, and at the client-side I would use the RecordSet class to fetch the data on demand (or not). However, lets say an event record has this structure (columns/fields)


Quote:




id,name,city_id,event_date




Where "city_id" being a FK to the Cities table and event_date being a int storing a unix timestamp.

In this case, if I would like to return only the city name and the formated date string (dd/mm/aaaa), I would do this way:


PHP Code:



function getEvents() {
     $query = "SELECT * FROM events";
     $resource_id = mysql_query($query);
  
   
     foreach($arr = mysql_fetch_array($resource_id)) {
             
             $arr['event_date'] = $this->convertToString($arr['event_date']); //Converts the unix timestamp to dd/mm/aaaa
             $arr['city_name'] = $this->getCityName($arr['city_id']); //query to the cities table returning the name where id = $arr['city_id']

     }

     return $arr;






This way, I would not be returning a mysql query resource id but already fetched data instead, and I wouldn´t be able to use all the features of the recordset class, but, I could do some processing in the array (get the city name of the event´s city and convert the unix timestamp to dd/mm/aaaa string).

This foreach strategy is the only way I know to pre-process the data this way before sending it to flash... I would be grateful if someone could enlight me and maybe show me a better way (maybe direct through sql in the dbms layer?) to do such thing!

Thanks, and if you need more information please ask! I really need a hand here!

- Marcelo.

Recordset, Links To Flash Movies With Dynamically Loaded Content
I am building an inventory page. The item name and image name will come from a database, and this will serve as a link to the product detail page. I have retrieved the info from an asp page and loaded them into flash no problem. The question is this:

How do you loop through the items in a "recordset", displaying each row in a clip or other object that can act as a button that links to another clip. The number of items will be changing day to day so I never know how many until polling the database.

What Is This Error? "Operation Not Allowed On Partial Recordset"
I am having a problem with an AMFPHP project that continues to return the following error ->

"RecordSet Warning 108: Operation not allowed on partial recordset"

Basically, I have a database of names, addresses, etc.. When the remoting connects it does an initial call to a search function and retrieves data. The user can then select a name and modify that person's info...pretty simple and it all works fine.

This error message occurs in a specific script when the user updates the First or Last name field in the database. The script first returns a confirmation that the PHP update call was successful and then attempts to 'refresh' the search screen by calling the search function again. This is when I get the recordSet error.

Does anyone know what this error is referring to? The search call works when I call it in other parts of the script, but I can't figure out why it generates this error at this particular time. If I knew what this error meant it might be able to figure it out.

Thanks, Kevin

Looping Sound And Looping Animation Sync
I'm working on a navagation interface for a new site, and I'm running into a few issues.

1) when you click on a button, it activiates an MC. within that MC, the first frame is the initial "off" state, and clicking on a button triggers the rest of the clip to play, from frame 2. I have a sound that starts in frame 2, and I set up an animation of a VU meter that is supposed to be synced very closely to the music. In the last frame of the MC is an action, gotoandplay, that sends it back to frame 2. The idea here is that once the button is pressed, the music loops and the animation loops with it.

When I test the movie, do a publish preview, or view the swf file in the flash player, the animation seems to be synced to the music for the first few times it loops, but then the animation drifts ahead of the music, getting progressively further out of sync with each loop. The other real problem here, is that when viewing the swf in any web browser, the animation is immediately behind the music, and seems to be running much slower than it should.

you can see the swf here:

http://www.lsrdigital.com/flash/index.html

Does anyone have any ideas about how to get this to work the way I am trying to get it to?

the .fla file is here if you want to look at it as well:

http://www.lsrdigital.com/flash/LSR.fla

2) The other problem I'm having is that the stage is set to be 680 pixels wide, and the graphic that fills the background is 680 pixels wide, BUT Flash MX publishes the movie at only 679 pixels wide! You can see the line of white pixels on the right side of the movie here:

http://www.lsrdigital.com/flash/index.html

I've double checked the html file and the table cell holding the movie element is 680 pixels wide. You can also tell that Flash is cutting off the last column of pixels because the background image is visibly just missing the edge to the right of the screws.

Any ideas on that one?

Looping External Mp3 Not Looping Perfectly
Hi there

I have a looping external mp3 file playing in the background of my flash (Flash MX 2004) movie.

Unfortunately it does not loop perfectly even though I know the mp3 file loops perfectly in sound editing programs.

There seems to be a slight delay.

Here is my code

function Play_Background_Audio() {
myMusic.loadSound(audioFile,true);

myMusic.onSoundComplete = function() {
myMusic.loadSound(audioFile,true);
};

};

audioFile = "home.mp3";
myMusic = new Sound(myMusicMc);
Play_Background_Audio();

Any help would be much appreciated.

Thanks

Paul

Looping & Non-looping Components In Same Movie
I'm new to using Flash MX, and would be grateful if someone could give me some advice for this animation I'm trying to do.

I'm making a banner for a website that is being designed by someone else. The background consists of four photos that fade in and out continuously (I think "looping" is the correct term) as soon as the animation (movie?) opens up. That part wasn't too hard!

However, the client wants a name (in white text) to gradually fade in on top of the looping background, and stay visible and static for as long as the looping animation plays. As well, after the white name fades in and becomes static, she needs another name (in gold text) to gradually appear and start fading in and out below it.

So the sequence is:
- Looping background begins to play.
- The name (in white text) gradually fades in (say at around frame 50) and stays visible (alpha at 100%) while the background is looping.
- Around frame 100 a second name (in gold text) fades in and then starts fading in and out continuously in synch with the looping background.

I can't figure out how to do this. Do I need multiple time lines? Or triggers in various frames? Or different scenes?

I have a sinking feeling that I'm going to have to use Actionscript for this, and although I'm perfectly willing to learn, I haven't a clue where to start. Could anyone help, please?

Music Looping And Looping And.....
Hi all, thanks for taking a look at this.
I have made an Audio off/on button which I have added to the main scene, it has 2 frames, first one with the stop(); script and the second frame with
stop();
stopAllSounds();
but when i am navagating through the main scene the music loops onto itself till u end up with a god awful noise.

Help?!!



btw, I am using flash MX

LOOPING MC.....
Hey Guys,

I was wondering what the actionscript was to loop a MC..

for example i have a MC half way through my flash movie and wanting to loop it 3 times...

If anyone can help me out it would be a great help

Cheers
mdesign

Looping ?
Hello evry one, first time here

I hope i am in the good section

I am really unable to figure out how to do looping action

What i'm am trying to do is a scrolling text field that begin to scroll with a button mouse over and stop scrolling at mouse out or at maxscroll

can anyone help me??????????6
pleeeease

HELP On LOOPING
Hey Thanks for Readin this,

Im done making my 1st flash item and it displays fine in the test view but when I upload it and test it on the REAL internet, as soon as it's done it starts all over. How do i prevent this from happening? Thanks
CJ

Looping...
I want to be able to loop only a certain object within my movie. I want everything else to remain static while a couple words fade in and out. Thanx for the help.

Chase

Looping
I am useing swish. I wont to stop the looping. I unchecked the loop ,but in the browser it's still looping. This is what I have done. [I made a line ,I used the move effect Y postion - move up by 123 ,and x angle - rotate ccw by 180. this is good for me ,but I can not stop the loop. can you help.


Thank You
leecs2northrock.bm

Looping
Does or anyone did have a problem with looping? I turned off the loop and saved it then when I tried it in my browser(ie 5) it would keep looping.... any quick suggestions or is this a bug with swish?

Thank in advance...

Looping
Ok, Obviously since I am in here I must be pretty new at this so just bare with me because I have a few questions.
1. How can I make a movie clip in one layer loop continously without looping the rest of the movie?

2. Why is it that when I preview my site in a browser everything is so much bigger? Do I have to make my movie that small to get it to fit in a browser?

3. What is the standard size width for a web browser? The height I'm not concerned with because the user can scroll down?

4. And last (for now) Is there any way to make a standard type frame using Flash 5? Just so that I might keep things seperated on my page.

Thank you

Brian.

Looping
I have an animation consisting of a few seperate movie clips.
I need it to loop 3 or 4 times and I want to do it using actionscript. Does anybody know how?

Looping
I'm trying to get some understanding here.

amount = 10;
while (amount>0) {
duplicateMovieClip("mc", "mc"+counter, amount);
amount = amount-1;
}
stop();

Why would you need to take away 1 (or whatever) from amount??
If I don't have that command, flash crashes.

Please, help me.

Thanks

Looping A MC
I have a Movie and I want it to play to frame 18 then loop back to frame 16, eight (8) times

Is this possible If you could give me some insight I feel very dumb right now, (it seem that it would be really easy to do but I can't do it?)

Copyright © 2005-08 www.BigResource.com, All rights reserved