Help with automatic insert

Hello forum members!
Today I created an auxiliar table (t_final_qtd) to make a report lighter. it worked as expected but now the problem is that this table does not receive data automatically from the system.
This table receives data from 2 other tables (aevent and disposition) that receive data automatically, they're used to store event history. Each time the program inserts a new row to the event, both tables update a column called curent on the past rows changing it to 'F' and the most actual to 'T'. I want t_final_qtd to store only the rows with 'T'.
At first i thought about creating triggers but there's one problem, t_final_qtd's lighter because it only receives the most actual row of an event, it doesn't depends on "Where curent = 'T'" to retrieve data. I wanted to do with this table something like a materialized view (but not one, because the parameters are not set) that refreshes itselft, maybe a trigger or some job. Is it possible?
Thank you very much!

K- wrote:
BluShadow wrote:
That's not a valid test.
The first time you ran it (using the view) it had to do lots of I/O to read the data.
The second query ran quicker because the same data was already cached and didn't have to be read using expensive I/O.
The two queries are essentially the same and performance of them will be the same.
You should either do the same test, restarting the database before each query to get the same type of I/O hit, or try clearing out the cache via other means (though that's not completely accurate in itself).
The other thing you can do is to look at the explain plans and execution plans from tracing the query execution, which will show there is really no difference except for the cached data.I did the explain plans and there was really a cost difference as bellow. The view vw_final_qtd I'm using has the same structure as the table t_final_qtd.
Using vw_final_qtd: SELECT STATEMENT 83220
Using t_final_qtd: SELECT STATEMENT 1050Cost is not truly indicative of the time a query takes to execute.
The view is a stored SQL statement, so your first query...
SELECT *
FROM vw_final_qtd v --a view created exatcly as the table t_final_qtd
,ev_t e
WHERE v.dispo = e.typecode
AND v.adts BETWEEN '20101119' and '20101119235959';is essentially processed by the SQL engine as... (assuming your view is defined as "select * from t_final_qtd where current = 'T'")
SELECT *
FROM (select * from t_final_qtd where current = 'T')
,ev_t e
WHERE v.dispo = e.typecode
AND v.adts BETWEEN '20101119' and '20101119235959';... which the optimizer will look at and see that it is just the same as
SELECT *
FROM t_final_qtd t
,ev_t e
WHERE t.dispo = e.typecode
AND t.adts BETWEEN '20101119' and '20101119235959'
and t.current = 'T';... so will most likely execute it just like that, hence there is no difference between the two queries.
You can't just look at the explain plans, you need to look at the traces of the queries if you want to compare.
However, take our word for it, the two things are the same and there's no reason you can't use the view.
What would be more of a concern is the where clause:
AND t.adts BETWEEN '20101119' and '20101119235959'which is doing a range comparison on strings rather than dates or numbers. That's open to potential errors, and may be causing lack of index usage if the column is actually a data or number.

Similar Messages

  • Help with the insert table/form tool in BIP 10.1.3.2.1

    Hi, I'm trying to use the insert table/form tool in BIP, and running into some issues that I don't understand. First off, my data coming in looks like this (left column of tool):
    Rowset
    --- Row
    ------ Customer ID
    ------ Customer Name
    ------ Customer City
    ------ Product
    ------ Amount Sold
    I would like the output to do the following:
    a) have one page per customer. Customer should be determined by customer ID, and has attributes of customer ID, customer Name, Customer City
    b) Show a table of all products and the total Amount Sold by product for that customer
    c) Give a "grand total" for the customer
    Can someone help with the steps needed to do this? I've tried several variations of the following without much luck:
    1) Added Rowset and all children to the "Template" pane
    2) Clicked on the "Row" group, and set Grouping = Customer ID, with a break of "New page per Element"
    3) Clicked on the newly created (from step 2) Cust ID group, and set it to group by Product
    4) Moved "amount sold" to be at same level as Product
    5) Moved all of the customer attributes (name, address, etc.) to be at same level as Cust ID
    6) On the Cust ID level, set the style to table
    7) on row and rowset levels, set style to free form
    This seems to be VERY close, except that it isn't creating a total amount for the sum of all products purchased by a customer. What do I need to do inside the tool to get a total per customer to show up?
    Thanks in advance!
    Scott
    p.s. the final hierarchy in the template window looks like this:
    Rowset (style = freeform, no grouping/sort by/breaks)
    --- Row (style = freeform, group by customer ID, break new page per element)
    ------ Customer ID (style = table, group by product, no breaks)
    --------- Product (nothing special)
    --------- Amount Sold (calc for grouping = SUM)
    ------ Customer Name (nothing special)
    ------ Customer City (nothing special)
    Thanks very much for the help!
    Scott

    To anyone else who sees this post, the answer is to do the following. Insert the Amount Sold field using the "Insert Field" tool, and set the function to sum, with the grouping checkbox turned on.
    Thanks,
    Scott

  • Looking for some help with building insert statements...

    Hi, I am using some sql to build some insert statements for me to update a set of tables in our qa environments. The scripts that I have created were working great until someone added a column to some of the tables in the qa env which in turn makes my scripts break because I was simply building the statment to do someting like this...
    insert into dest_table (select * from source_table@dblink);
    But now when the coumns in the tables do not match it breaks...
    This is the dynamic create script I use, can anyone help or suggest a better way to be able to build update statements update to qa tables when the columns are mismatched?
    spool insert.sql
    select
    'insert into ' || table_name || ' (select * from ' || table_name || '@prod );' || chr(10) || ' commit;'
    from user_tables
    where table_name in
    (select * from refresh_tablesl)
    any help is greatly appreciated,
    Thanks.

    See my reply to your duplicate post
    looking for help building dynamic insert statements...

  • Help with "Automatically fill empty space on ipod" Function in itunes

    I am having an issue I don't understand when trying to sync my ipod. I go into the "music" tab where it allows you to select the music you want on the ipod. In addition to selecting playlists, artists, genres, etc. there is a box you can check that says "automatically fill free space with songs." I select a playlist with only a few albums on it which leaves me with a good deal of free space. My assumption was that checking this box would RANDOMLY choose songs (or albums?) in itunes to fill up the free space. However, when I do this it fills up the free space with the *exact same songs/albums every time*! The only thing I have checked off is the 1 playlist so I don't understand why it keeps choosing the same albums and songs to fill up the free space. I want it to just randomly choose songs from my entire music collection to fill up the free space. any help is appreciated!!

    Also, it seems that iTunes is not smart enough to -remove- songs when you add something new, i.e. movies or podcasts, and will constantly tell you that the iPod is full. That results in having to un-check the option, remove every song 'automatically added', add the new content, then re-check the "fill free space" box. Did no one actually test this feature or is it done on purpose to wear out your iPod quicker?

  • Help with automatic unmounting via script

    Sorry, for some reason, this question got posted twice.
    I would like to reroute you to this thread: http://discussions.apple.com/thread.jspa?threadID=1610643&tstart=0
    Could some kind soul please help me a bit with some applescript?
    I would need two things in applescript:
    1. A way to check whether a certain external (firewire) disk is mounted
    (so that I can unount, er, eject it, if it is there)
    2. A way to make an applescript being executed whenever the laptop goes to sleep.
    For the interested reader:
    what I want to do is to write an applescript that would automatically unmount my external backup disk whenever the laptop goes to sleep.
    Oftentimes I forget to do that myself, then, when the computer is asleep and I want to unplug everything to take it home, I remember that I haven't properly ejected the backup disk ...
    Any hints, pointers, tips will be appreciated!
    Best regards,
    Gabriel.
    Message was edited by: GabrielZ

    TeHDoHBoY wrote:
    *sudo rm -rf ~/Library/Caches*
    *sudo ln -s /private/tmp ~/Library/Caches*
    If you have a script using "sudo", it will always prompt for a password. The easy way to call this is put your script in /Library/Resources/Scripts/ (you'll have to create the Resources/Scripts/ path) and follow these steps.
    Step 1.) Edit your script and take out the "sudo" commands, leaving the following:
    rm -rf ~/Library/Caches*
    ln -s /private/tmp ~/Library/Caches*
    Step 2.) Then open up Terminal and execute the following commands:
    chown root:wheel /Library/Resources/Scripts/NameOfYourScript.sh
    chmod 755 /Library/Resources/Scripts/NameOfYourScript.sh
    Now create your login hook to call this script. If I'm correct, the script will run as root and not prompt the student for a password.

  • Need help with Automatic Generating Form Numbers

    Hello,
    I am new to all this and have found myself stuck trying to figure out how to have my forms automatiacally generate a new number each time it is used. I tried looking through similar posts but do not understand the directions given there. If someone could help me figure this out I would really appreciate it. Thank you.

    Before opening my forms for responses I am creating a column with my starting form number - 1.  in the cell above(first response) I am setting an equation =B2 +1.  All incoming responses automatically generate an ID number within my responses table.  The form itself will not present the number, but if you were looking for an easy way to track responses w/ an ID it has worked well for me so far.

  • Help with automatic guides?? Please!

    I hope I can make this make sense...
    I'm a beginner with InDesign. I've been using Photoshop for years, I am a photographer, and I'd like to say I know my way around Photoshop pretty well. I'm very comfortable with it. So InDesign isn't TOO complicated for me. The big thing right now is something that I actually noticed on accident when I first started using it. I hope this makes sense, please bear with me...haha
    As I was resizing images, I noticed Adobe was automatically guiding me. It was showing me the widths and helping me snap the images into place so that they align with the other objects in the document. It was AWESOME! Helps big time, especially since at work my bosses are very particular about margins and spacing. It was a very simple tool. Now, it's not doing it! Is there a way to engage this? I must have hit something not realizing that disabled it... I'm not sure but man I sure am bummed out right now. I don't know what it's even called so I don't know how to search for answers. ANY help would be awesome!!
    Thanks so much!!!

    You're looking for
    View>Grids and Guides>Smart Guides.
    It's a cool feature!

  • Help with SQL insert

    Hi,
    Brand new to CF - using CF9. Have SQL Server 2005 database. Only one table. Using CF for frontend. Do not know proper syntax to get INSERT to work. Keep getting "Element XXXXXX is undefined in FORM."
    Database name is RAWH.
    Columns for insert are:
    startdate
    enddate
    TypeHrs
    NoOfHours
    projects
    justification
    Frontend has forms and fields which are:
    Form                                       Field (value)
    firstDates                                startdate
    firstDates                                enddate
    typHrs                                     TypeHrs
    noHrs                                      NoOfHours
    none                                        projects
    none                                        justification
    Do not know how to code for INSERT - have this for now - which obviously does not work:
    <cfquery name="RAWH" datasource="RAWH">
    INSERT INTO RAWH
    (startdate, enddate, TypeHrs, NoOfHours, projects, justification)
    VALUES
    (#Form.firstDates#, '#Form.startdate#', '#Form.enddate#', #Form.typHrs#, '#Form.TypeHrs#', #Form.noHrs#, '#Form.NoOfHours#')
    </cfquery>
    What am I doing wrong?
    Get this:
    Element FIRSTDATES is undefined in FORM.
    The error occurred in D:\ColdFusion9\wwwroot\RAWH1\RAWH1.cfm: line 5
    3 : (startdate, enddate, TypeHrs, NoOfHours, projects, justification)
    4 : VALUES
    5 : (#Form.firstDates#, '#Form.startdate#', '#Form.enddate#', #Form.typHrs#, '#Form.TypeHrs#', #Form.noHrs#, '#Form.NoOfHours#')
    6 : </cfquery>
    7 :
    Really appreciate any help - thank you. BTW - datasource is in CF Admin.
    John
    RAWH 
    Microsoft SQL Server 
    OK 

    Ian & Dan,
    Thanks. I added "<cfdump var="#form#">" and the result is "struct [empty]."
    I altered the form/input code thusly,
    <form id="beginDate" name="beginDate" onclick="function compareDate(); method="post"
                   style="width: 1px; height: 1px;">
              <td><input style="width: 70px" type="text" id="startdate" name="startdate" /></td>
            </form>
            <form id="endnDate" name="endDate" onclick="function compareDate(); method="post"
                   style="width: 1px; height: 1px;">
              <td><input style="width: 70px" type="text" id="enddate" name="enddate" /></td>
            </form>
    Should this be a cfform? I also made separate forms for startdate and enddate rather than one form for both.
    The cfquery is this:
    <cfquery name="RAWH" datasource="RAWH">
    INSERT INTO RAWH
    (startdate, enddate, TypeHrs, NoOfHours, projects, justification)
    VALUES
    (#Form.beginDate#, '#Form.startdate#', '#Form.endDate#', '#Form.enddate#', #Form.typHrs#, '#Form.TypeHrs#', #Form.noHrs#, '#Form.NoOfHours#', 'projects', 'justification')
    </cfquery>
    Still the same result -
    Element BEGINDATE is undefined in FORM.
    The error occurred in D:\ColdFusion9\wwwroot\RAWH1\RAWH1.cfm: line 7
    5 : (startdate, enddate, TypeHrs, NoOfHours, projects, justification)
    6 : VALUES
    7 : (#Form.beginDate#, '#Form.startdate#', '#Form.endDate#', '#Form.enddate#', #Form.typHrs#, '#Form.TypeHrs#', #Form.noHrs#, '#Form.NoOfHours#', 'projects', 'justification')
    8 : </cfquery>
    9 :
    What am I doing wrong?
    Dan - you said that I do not have a form until I submit one - I get this error by opening the web page (F12). There is no onsubmit coding done.
    Sorry guys, I am lost with this.
    Thank you,
    John

  • Help with sql insert single quotes

    String insert = "INSERT INTO users(firstName, lastName, emailAdd, password) VALUES("+ firstNameForm + "," + lastNameForm + "," + emailForm + "," + passwordForm + ")";
    Statement stmt = conn.createStatement();
         int ResultSet = stmt.executeUpdate(insert);
    I have that sql insert statment in my servlet the servlet compiles fine but does not insert into the users table, i have been told that it is something to do with single quotes in sql statement, can anybody help me out?

    Or can i change my sql table is there a autonumber which would increase everytime this servlet runs?make your field autoincrement :-)
    example
    ALTER TABLE `users` CHANGE `user_id` `user_id` INT( 10 ) UNSIGNED DEFAULT '0' NOT NULL AUTO_INCREMENT To insert record in the table.
    example:
    you have a table test and got two fields,
    id = (INT) autoincrement
    name = VARCHAR / TEXT etc.
    to insert data to the table test try something like this:
    String SQLStatement = "INSERT INTO test";
    SQLStatement += "(name)";
    SQLStatement += " VALUES (?)";
    statement = Conn.prepareStatement(SQLStatement);
    statement.setString(1, "Duke");
    statement.executeUpdate();
    statement.close();
    Conn.close();Note we dont provide the field for id on our sql statement since it is set as auto-increment ;-)
    regards,
    Message was edited by:
    jie2ee

  • Need help with automatic printing of a page

    I am looking for inputs for a particular scenario; On the Oracle HR Self-service pages, once the employee adds/updates his personal details and submits his changes to be approved by the HR manager, the final confirmation page should be automatically routed to a particular printer and be printed. Can this functionality be achieved with OAF coding for the Submit button?

    Hi,
    Check this link, it will help you.
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/collaboration">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/collaboration</a>
    Dont forget to close the thread when answered.
    Regards,
    Amit

  • Help with BULK Insert

    Hello SQL Buddies,
    I am trying to run a BULK insert.
    Here is my code:
    Code start:
    use Lagerliste
    drop table Import
    use Lagerliste
    create table Import
    TOTALQTY float null,
    PARTNO nvarchar (255) null,
    [DESC] nvarchar (255) null,
    CO nvarchar (255) null,
    BIN nvarchar (255) null,
    PRICE float null,
    DISCOUNT nvarchar (255) null,
    LASTPURC nvarchar (255) null,
    AGECODE nvarchar (255) null,
    MANFPART nvarchar (255) null
    use Lagerliste
    bulk
    insert Import
    from 'D:\FTP\RG\Stockfile.csv'
    with
    formatfile = 'D:\FormatFile\test.xml',
    Errorfile = 'D:\FormatFile\error.txt'
    Code stop..
    My format file code is here:
    Code start:
    <?xml version="1.0"?>
      <BCPFORMAT xmlns = "http://schemas.microsoft.com/sqlserver/2004/bulkload/format"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <RECORD>
          <FIELD ID="1"    xsi:type="CharTerm"        TERMINATOR= ',"'    />
          <FIELD ID="2"    xsi:type="CharTerm"    MAX_LENGTH="255"    TERMINATOR= '","' />
          <FIELD ID="3"    xsi:type="CharTerm"    MAX_LENGTH="255"    TERMINATOR= '","'    />
          <FIELD ID="4"    xsi:type="CharTerm"    MAX_LENGTH="255"    TERMINATOR= '","'    />
          <FIELD ID="5"    xsi:type="CharTerm"    MAX_LENGTH="255"    TERMINATOR= '",'    />
          <FIELD ID="6"    xsi:type="CharTerm"      TERMINATOR= ',"'    />
          <FIELD ID="7"    xsi:type="CharTerm"    MAX_LENGTH="255"    TERMINATOR= '","'    />
          <FIELD ID="8"    xsi:type="CharTerm"    MAX_LENGTH="255"    TERMINATOR= '","'    />
          <FIELD ID="9"    xsi:type="CharTerm"    MAX_LENGTH="255"    TERMINATOR= '","'    />
          <FIELD ID="10"    xsi:type="CharTerm"    MAX_LENGTH="255"    TERMINATOR= '"'        />
        </RECORD>
        <ROW>
          <COLUMN SOURCE="1" NAME="TOTALQTY"    xsi:type="SQLFLT8"/>
          <COLUMN SOURCE="2" NAME="PARTNO"    xsi:type="SQLNVARCHAR"/>
          <COLUMN SOURCE="3" NAME="DESC"        xsi:type="SQLNVARCHAR"/>
          <COLUMN SOURCE="4" NAME="CO"        xsi:type="SQLNVARCHAR"/>
          <COLUMN SOURCE="5" NAME="BIN"        xsi:type="SQLNVARCHAR"/>
          <COLUMN SOURCE="6" NAME="PRICE"        xsi:type="SQLFLT8"/>
          <COLUMN SOURCE="7" NAME="DISCOUNT"    xsi:type="SQLNVARCHAR"/>
          <COLUMN SOURCE="8" NAME="LASTPURC"    xsi:type="SQLNVARCHAR"/>
          <COLUMN SOURCE="9" NAME="AGECODE"    xsi:type="SQLNVARCHAR"/>
          <COLUMN SOURCE="10" NAME="MANFPART"    xsi:type="SQLNVARCHAR"/>
        </ROW>
      </BCPFORMAT>
    Code stop..
    If i run the code it says:
    Msg 4832, Level 16, State 1, Line 20
    Bulk load: An unexpected end of file was encountered in the data file.
    Msg 7399, Level 16, State 1, Line 20
    The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.
    Msg 7330, Level 16, State 2, Line 20
    Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".
    And the error file says:
    Row 473629 File Offset 42503226 ErrorFile Offset 0 - HRESULT 0x80004005
    If i then in my bulk insert adds: "Lastrow = '473629' it works all fine. So it will mean that it gets an error at the last line where there is no more data? But this sql query should run every day, so i have to do so it dont gets the error.
    Can someone help me?
    Looking forward to an answer, i hope someone have a solution.
    Regards Christian.

    Try the below format file,
    <?xml version="1.0"?>
    <BCPFORMAT xmlns = "http://schemas.microsoft.com/sqlserver/2004/bulkload/format"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <RECORD>
    <FIELD ID="1" xsi:type="CharTerm" TERMINATOR= ',"' />
    <FIELD ID="2" xsi:type="CharTerm" MAX_LENGTH="255" TERMINATOR= '","' />
    <FIELD ID="3" xsi:type="CharTerm" MAX_LENGTH="255" TERMINATOR= '","' />
    <FIELD ID="4" xsi:type="CharTerm" MAX_LENGTH="255" TERMINATOR= '","' />
    <FIELD ID="5" xsi:type="CharTerm" MAX_LENGTH="255" TERMINATOR= '",' />
    <FIELD ID="6" xsi:type="CharTerm" TERMINATOR= ',"' />
    <FIELD ID="7" xsi:type="CharTerm" MAX_LENGTH="255" TERMINATOR= '","' />
    <FIELD ID="8" xsi:type="CharTerm" MAX_LENGTH="255" TERMINATOR= '","' />
    <FIELD ID="9" xsi:type="CharTerm" MAX_LENGTH="255" TERMINATOR= '","' />
    <FIELD ID="10" xsi:type="CharTerm" MAX_LENGTH="255" TERMINATOR= '"\r\n' />
    </RECORD>
    <ROW>
    <COLUMN SOURCE="1" NAME="TOTALQTY" xsi:type="SQLFLT8"/>
    <COLUMN SOURCE="2" NAME="PARTNO" xsi:type="SQLNVARCHAR"/>
    <COLUMN SOURCE="3" NAME="DESC" xsi:type="SQLNVARCHAR"/>
    <COLUMN SOURCE="4" NAME="CO" xsi:type="SQLNVARCHAR"/>
    <COLUMN SOURCE="5" NAME="BIN" xsi:type="SQLNVARCHAR"/>
    <COLUMN SOURCE="6" NAME="PRICE" xsi:type="SQLFLT8"/>
    <COLUMN SOURCE="7" NAME="DISCOUNT" xsi:type="SQLNVARCHAR"/>
    <COLUMN SOURCE="8" NAME="LASTPURC" xsi:type="SQLNVARCHAR"/>
    <COLUMN SOURCE="9" NAME="AGECODE" xsi:type="SQLNVARCHAR"/>
    <COLUMN SOURCE="10" NAME="MANFPART" xsi:type="SQLNVARCHAR"/>
    </ROW>
    </BCPFORMAT>
    Refer
    http://stackoverflow.com/questions/8530353/sql-bulk-insert-xml-format-file-with-double-quotes-in-terminator
    http://technet.microsoft.com/en-us/library/ms191234(v=sql.105).aspx
    Regards, RSingh

  • Help with simple INSERT statement?

    How can I do an insert into Oracle without having to
    specify EVERY field name in the table? This isn't necessary
    with Access or
    SQL Server, which will insert null's in the non-specified
    fields, the Oracle SQL
    tool tells me that there aren't enough field values when I run
    this SQL Statement:
    INSERT INTO TABLE_NAME VALUES (1234, 'test', 'test')
    There are over 10 different fields, but I get the error message:
    Native Error Code 947, Not enough values.
    TIA
    Kris
    null

    Kristofer Goss (guest) wrote:
    : How can I do an insert into Oracle without having to
    : specify EVERY field name in the table? This isn't necessary
    : with Access or
    : SQL Server, which will insert null's in the non-specified
    : fields, the Oracle SQL
    : tool tells me that there aren't enough field values when I run
    : this SQL Statement:
    : INSERT INTO TABLE_NAME VALUES (1234, 'test', 'test')
    : There are over 10 different fields, but I get the error
    message:
    : Native Error Code 947, Not enough values.
    : TIA
    : Kris
    You may omit the columns list, but if you do then the VALUES
    clause must provide values for every column in the table.
    FOR EXAMPLE: if your table were created as follows:
    COLUMN_1 NOT NULL, VARCHAR2(4)
    COLUMN_2 NUMBER(6)
    COLUMN_3 DATE
    COLUMN_4 VARCHAR2(4)
    You could submit a statement like:
    insert into my_table VALUES ('ALLA', , , 'XYZ');
    You could also submit a statement like:
    insert into my_table (column_1, column_4) VALUES ('ALLA', 'XYZ');
    If you do not want to store any value in a particular column,
    then that column must be allowed to accept NULLs.
    Hope this helps.
    null

  • Need help with automatic resizing of images

    I am working with a liquid template in dreamweaver and when I insert my banner image and preview the page, the image stays the same size while the page template expands with the screen resolution.
    How can I set the image so it automatically expands with the page?

    Expanding an image in this way isn't really the best way of doing things, because depending on the image it can get very distorted when it's increased or decreased in size.  You are better off selecting a background colour and blending the image into that, so that when the browser window is increased you see the majority of the image, but on larger monitors, the image is blending into the background on either side of that image.
    There is a technique that may make this possible - I did read something about it at one point, but didn't save the URL.  However, the above method is probably the most reliable way of doing what you want.

  • Need help with automatic slideshow

    I made an automatic slideshow that switches frames at a set
    interval but now i want to load each frame from an extrenal swf and
    add a preloader for each frame, how do i tell the slideshow to wait
    until the frame is loaded before it proceeds to the next frame, but
    still have the movieclip be automatic. Also the slideshow can be
    controlled mannually so i also want to know how to disable the
    manual control till each frame is loaded.

    Here is some of the action script for the slideshow.
    This first bit sets up the automatic interval transitions in
    the main movie timeline
    function nextImage()
    mc_slide.mc_transition.play();
    } // End of the function
    function waitImage()
    clearInterval(slideTimer);
    var slideTimer = setInterval(nextImage, timer * 1000);
    nextImage();
    } // End of the function
    function pauseSlide()
    mc_slide.mc_quicktransition.gotoAndPlay(2);
    } // End of the function
    var timer = 8;
    var pauseTime = 20;
    var slideTimer = setInterval(nextImage, timer * 2000);
    stop ();
    the movieclip loaders that load each movie clip are embedded
    with the transition animation.
    this is the code in the embedded mc-it loads the 1st movie
    clip and allows the user to manually jump to any of the other movie
    clips.
    emptyMC.loadMovie("frame1.swf");
    var pageAddress = "about:blank";
    btn1.onRelease = function ()
    _parent.pauseSlide();
    gotoAndStop(1);
    btn2.onRelease = function ()
    _parent.pauseSlide();
    gotoAndStop(2);
    btn3.onRelease = function ()
    _parent.pauseSlide();
    gotoAndStop(3);
    btn4.onRelease = function ()
    _parent.pauseSlide();
    gotoAndStop(4);
    stop();
    I need to know how to put the code for the automation of the
    slideshow pause until each movieclip has finished loading and also
    at the same time disable the manual control of the movie clips
    before they are fully loaded.

  • Help with Automatic refreshing

    I got this graph that I can slide with my finger, Im wondering if its possible to update it automatic with this code?
    //Function for sliding graph.
       protected function mouseDownHandler(event:MouseEvent):void
        lastX = event.stageX;
        systemManager.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
        systemManager.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
       protected function mouseMoveHandler(event:MouseEvent):void
        var delta:Number = (lastX - event.stageX) / chart.width * viewportMax;
        if (hAxis.minimum + delta < 0)
         hAxis.minimum = 0;
         hAxis.maximum = viewportMax;
        else if (hAxis.maximum + delta  > chart.dataProvider.length - 0)
         hAxis.maximum = chart.dataProvider.length - 0;
         hAxis.minimum = hAxis.maximum - viewportMax;
        else
         hAxis.minimum += delta;
         hAxis.maximum += delta;
        lastX = event.stageX;
       protected function mouseUpHandler(event:MouseEvent):void
        systemManager.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
        systemManager.removeEventListener(MouseEvent.MOUSE_MOVE, mouseUpHandler);

    Here is the whole graph code, the source is the "myArray", it gets updated thru UDP.
    I guess something have to be done in the "mouseMoveHandler". Tried to change different things, but it
    still scolls with finger only, and does not update by itself. There should be a way to make it scroll by itself, dont you agree?
    <fx:Script>
      <![CDATA[
       import flash.events.TimerEvent;
       import flash.utils.Timer;  
       import flashx.textLayout.events.ScrollEvent;  
       import mx.collections.ArrayCollection;
       import mx.events.FlexEvent;
       import mx.rpc.events.AbstractEvent;  
       public var NewValue:Object; 
       public var Value:String;
       public var myTimer:Timer;
       public var PowerNumber:Number;
       //Function for UDP graph.
       protected var lastX:Number = 0;  
       [Bindable]
       protected var viewportMax:Number = 10;
       private function creationCompleteHandler():void
        completeHandler();
        init();
       protected function completeHandler():void
        chart.dataProvider = myArray;
       protected function mouseDownHandler(event:MouseEvent):void
        lastX = event.stageX;
        systemManager.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
        systemManager.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
       protected function mouseMoveHandler(event:MouseEvent):void
        var delta:Number = (lastX - event.stageX) / chart.width * viewportMax;
        if (hAxis.minimum + delta < 0)
         hAxis.minimum = 0;
         hAxis.maximum = viewportMax;
        else if (hAxis.maximum + delta  > chart.dataProvider.length - 1)
         hAxis.maximum = chart.dataProvider.length - 1;
         hAxis.minimum = hAxis.maximum - viewportMax;
        else
         hAxis.minimum += delta;
         hAxis.maximum += delta;
        lastX = event.stageX;
       protected function mouseUpHandler(event:MouseEvent):void
        systemManager.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
        systemManager.removeEventListener(MouseEvent.MOUSE_MOVE, mouseUpHandler);
       public var myArray:ArrayCollection = new ArrayCollection();
       public function initTimer():void
        var myTimer:Timer = new Timer(500, 0);
        myTimer.addEventListener("timer", timerHandler);
        myTimer.start();
       //Function for UDP graph.
       public function timerHandler(event:TimerEvent):void
        var obj:Object = new Object();   
        obj.time = getTimer();   
        obj.Value = NewValue;
        myArray.addItem(obj);
       //Function for UDP graph.
       protected function applicationCompleteHandler(event:FlexEvent):void
        udpSocket = new UDPSocket();
        udpSocket.addEventListener(DatagramSocketDataEvent.DATA, udpDataHandler);
        udpSocket.bind(1000);
        udpSocket.receive();   
        initTimer();
       //Incomming UDP for graph (Tracking).
       protected function udpDataHandler(event:DatagramSocketDataEvent):void
        var Value:String = event.data.readUTFBytes(event.data.bytesAvailable);
        if(Value)
         NewValue = Value;
        else
         NewValue = 0;
      ]]>
    </fx:Script>
    <fx:Declarations>
      <mx:SolidColorStroke id = "s1" color="0x0000ff" weight="2"/>
    </fx:Declarations>
    <mx:LineChart id="chart"  x="51" y="141" width="875" height="190" paddingLeft="5" paddingRight="5"
          showDataTips="true"
          mouseDown="mouseDownHandler(event)">
      <mx:series>  
       <mx:LineSeries yField="Value" form="curve" displayName="Tracking" lineStroke="{s1}"/>  
      </mx:series>
      <mx:horizontalAxis> 
       <mx:LinearAxis id="hAxis" minimum="0" maximum="{viewportMax}"/> 
      </mx:horizontalAxis>
    </mx:LineChart>
    </s:Application>

Maybe you are looking for