ABAP Code for loading the flat files kept at FTP locations
Hi all,
I need to automate the process of data loading via flat files with the help of process chains , with respect to which I require following help:
1. what steps should I follow to load the data with respect that whenever the new file comes in the directory of the ftp location start that process chain for data load.(Note : there is no fix time that when the new file will be coming)
2. Every time the new file will be having differnt name , then in that case how we will be fetching the new file which is require for data loading?
Thanks and Regards,
Neha
Hi Neha,
I have not worked on this or made this code.
Recently my onsite did it.
Try to find more gyan on this functiona module...'DX_GET_PHYSICAL_FILENAME'
Code is... write it in infopackge start routine.
DATA: v_filename LIKE dxfile-filename.
Below function module generates the filename with the complete path
based on the app server attached to the Central Instance
The logical mapping Z_INBOUND_EBIZ_PAYMENTS is maintained in the
transaction - "FILE"
CALL FUNCTION 'DX_GET_PHYSICAL_FILENAME'
EXPORTING
i_filename = 'Z_INBOUND_EBIZ_PAYMENTS'
IMPORTING
o_filename = v_filename
EXCEPTIONS
not_registered = 1
logical_filename_error = 2
OTHERS = 3.
IF sy-subrc = 0.
p_filename = v_filename.
p_subrc = 0.
ELSE.
p_subrc = 4.
ENDIF.
Regards,
San!
Similar Messages
-
Unable to load the flat file from client work station
Hi,
I am trying load a flat file (.CSV file)from my desktop (Client work station) and getting the following error.
An upload from the client workstation in the background is not possible
Message no. RSM860
Diagnosis
You cannot load data from the client workstation in the background.
Procedure
Transfer your data to the application server and load it from there.
I have recd a .XLS file and then I have converted to .CSV file , which I saved in my desktop and trying to load the same.
Please help me how to go about this?...
Thanks in advance.
Christy.Hi All,
Again, I have tried to load the flat file from clint work station with direct loading..I have got the following errors..
Errors : 1
Record 990: Contents '50,000' from Field /BIC/ZPLQTY_B Not Convertible in Type QUAN -> Long Tex
like this i recd so many errors.
ERROR : 2
Error in an arithmetic operation in record 259
Please help me how to load the flat file successfully.
If I hv to save the flat file in Appl server..how to do that..Please provide step by step instruction..
Thanks
Christy -
Error in when loading the flat file for hierarchy
Hi all,
I get this error when i do the entire Hierarchy process and try to upload the flat fil in the infopackage.
Has anyone faced this kind of error.
No Transfer Structure Available SS_DEMOH IO_SRID_HIER (SY-SUBRC=5)
Can someone tell me how to proceed further.
HarishHi lakshmi,
I have checked it thrice before loading it through infopackage.Everything is fine.
Harish -
Conversion_Exit_Cunit_error occured while loading the Flat file data
Hi
Iam tryign to load Flat file data into an ODS, i am getting error like Error Conversion Cunit.
Also we are using 0unit in the ODS for which CUNIT is a conversion rule
Can you please suggest me why iam getting this errorHi Sunil
Hope you can check whether you are loadig the flat file data from application server or Client workstation.
May be if you are loading from Client work station you will face problem of this type.
Try to check if any change in format in the file.
at the end of the file delete the spaces. -
Getting a error when loading the flat file
Hi,
I have created a infoobject called ID and i have a attribute name.I have assigned a data source and done the update rules.When i try to upload the flat file i get a error.
Error 8 when compiling the upload program: row 227, message: A newer version of data type /BIC/CCDHIO_SRPID_ATT
I have faced this problem earlier but now i am not able to rectify it .Can someone suggest me what to do.I am working on 3.5 version.
Thanks
Regards
HarishHi,
Check the Flatfile Infoobjects and in datasource structure ,It should be same order and check whther you you are ignoring header rows or not in infopackage
Regards,
Marasa. -
Settings for loading from FLat File in BI7
Hi guys
i am trying to load data from a csv file. i used MS excel to create this cvs file. now in BI-7 what settings do i need to use to load the data. i need info like "Seperator" and "Replacement for Blank".
i have already tried ; and , for seperator, but the preview is all messed up.
thanksHi Adnan,
First you create a source system for flat file loading.
Do this in RSA1 - Source Systems. Via context menu, create it in node "File".
Then, goto the RSA1 - Datasources view. Choose the corrrect source system.
Create a datasource and assign fields.
Use your datasource to load data into infoobject, datastore using a transformation between the datasource and datastore.
Create and schedule an infopackage to load to PSA.
Create and schedule a DTP to load into target.
Setting for flat file loading
in SPRO
Thousand separator
dec.pointer separator
field separator
Field delimiter
In info package
External Data
Here we can give the file path & where the file exist(wether in appllication server or client work station
file type
data separator
esacpesign
thousand separator
how many to be igonered
hope this will help you...............
for more info
Pls refer to the link below
[http://help.sap.com/saphelp_nw04s/helpdata/en/43/03450525ee517be10000000a1553f6/frameset.htm ]
[http://help.sap.com/saphelp_nw04s/helpdata/en/fc/1251421705be30e10000000a155106/content.htm]
[b.i 7.0 ffile extraction;
[http://help.sap.com/saphelp_nw04/helpdata/en/8e/dbe92341c84242be2c7d3917f1c197/content.htm]
[https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/biw/g-i/how%20to%20load%20a%20flat%20file%20into%20bw-bps%20using%20sapgui.pdf]
Regards,
NR
Assign points if useful... -
ABAP code for caliculating the demand variability
Hi gurus,
I need to calculate the the demand variability for the requested raw material,
Demand Variability for raw materials is calculated by taking the standard deviation of 52 data points, each point representing the total consumption in a week.
The raw consumption data contains negative figures on many days, resulting from inventory adjustment transactions. Aggregate consumption to a weekly bucket to keep variability from being artificially inflated by any negative figures from adjustments due to physicals, poor practices, or cycle counts.
Calculation
Calculate the consumption for every week based on MSEG-MENGE where MKPF-BUDAT falls within the week bucket from Sunday till Saturday. This is the value Xn.
SUM all 52 Xn values for every week. This is Y.
Divide the Y/52 = Z
Calculate for that year the standard deviation
SQRT (((Xn-Z)2)/n)
Can you any one give the code for this condition.
Thanks in advance.any help please...
-
ABAP Code for Backup the entire table data in the application server
Hello Friends,
I have to create the table data Backup and Store the entire table data in the application server and also be able to restore the data back if needed.
this should be dynamic program for any table based on the table name given on the application server.. I have developed a program for this but its having problems with the Quantity, amount. Its not writing it correctly at the application level.
ANy Suggestions on this.
Below is the program for this.
Thanks,
Ster.
* Report YWMM_TABLE_DUMP *
REPORT ywmm_table_dump .
TABLES :
dd03l.
* Type spool declaration
TYPE-POOLS:
abap, slis.
DATA: i_table_data1 TYPE REF TO data.
DATA : it_dd03l LIKE dd03l OCCURS 0 WITH HEADER LINE.
*DATA : gt_fieldcat TYPE lvc_s_fcat.
DATA : i_fcat TYPE STANDARD TABLE OF lvc_s_fcat,
l_dr_line TYPE REF TO data,
l_v_as4vers TYPE as4vers.
FIELD-SYMBOLS: <f_table_data1> TYPE STANDARD TABLE,
<f_wa_table_data1> TYPE ANY.
SELECTION-SCREEN: BEGIN OF BLOCK bl1 WITH FRAME TITLE text-001.
PARAMETERS: rb_copy RADIOBUTTON GROUP map DEFAULT 'X',
rb_rest RADIOBUTTON GROUP map.
SELECTION-SCREEN: END OF BLOCK bl1.
SELECTION-SCREEN: BEGIN OF BLOCK bl2 WITH FRAME TITLE text-002.
PARAMETERS: p_table TYPE tabname OBLIGATORY,
p_plfld TYPE dd03l-fieldname.
SELECTION-SCREEN SKIP 1.
PARAMETERS: p_bkfile TYPE localfile OBLIGATORY.
SELECTION-SCREEN: END OF BLOCK bl2.
PERFORM get_data.
IF rb_copy = 'X'.
PERFORM backup.
ELSEIF rb_rest = 'X'.
PERFORM database_update.
ENDIF.
*& Form get_data
FORM get_data.
CLEAR i_fcat.
REFRESH i_fcat.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = p_table " Table Name
CHANGING
ct_fieldcat = i_fcat
EXCEPTIONS
OTHERS = 1.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = i_fcat
IMPORTING
ep_table = i_table_data1.
IF sy-subrc = 0.
ASSIGN i_table_data1->* TO <f_table_data1>.
ELSE.
WRITE: 'Error creating internal table'.
ENDIF.
IF rb_copy = 'X'.
SELECT * FROM (p_table) INTO CORRESPONDING FIELDS OF
TABLE <f_table_data1> UP TO 20 ROWS.
ELSEIF rb_rest = 'X'.
CREATE DATA l_dr_line LIKE LINE OF <f_table_data1>.
ASSIGN l_dr_line->* TO <f_wa_table_data1>.
*Get Data from Application Server
* Opening the dataset P_BKFILE given in the selection screen
TRANSLATE p_bkfile TO LOWER CASE.
OPEN DATASET p_bkfile FOR INPUT IN TEXT MODE." ENCODING DEFAULT.
IF sy-subrc NE 0.
* MESSAGE:
ELSE.
DO.
* Reading the file from application server
READ DATASET p_bkfile INTO <f_wa_table_data1>.
IF sy-subrc = 0.
APPEND <f_wa_table_data1> TO <f_table_data1>.
ELSE.
EXIT.
ENDIF.
ENDDO.
* Closing the dataset
CLOSE DATASET p_bkfile.
ENDIF.
ENDIF.
ENDFORM. " get_data
*& Form backup
* text
* --> p1 text
* <-- p2 text
FORM backup.
TRANSLATE p_bkfile TO LOWER CASE.
OPEN DATASET p_bkfile FOR OUTPUT IN TEXT MODE.
IF sy-subrc NE 0.
WRITE: text-017.
STOP.
ELSE.
LOOP AT <f_table_data1> ASSIGNING <f_wa_table_data1>.
TRANSFER <f_wa_table_data1> TO p_bkfile.
ENDLOOP.
ENDIF.
CLOSE DATASET p_bkfile.
ENDFORM. " backup
*& Form database_update
FORM database_update.
DATA : i_mara_u TYPE STANDARD TABLE OF mara WITH HEADER LINE,
i_ekpo_u TYPE STANDARD TABLE OF ekpo WITH HEADER LINE,
i_eban_u TYPE STANDARD TABLE OF eban WITH HEADER LINE,
i_resb_u TYPE STANDARD TABLE OF resb WITH HEADER LINE,
i_plpo_u TYPE STANDARD TABLE OF plpo WITH HEADER LINE,
i_stpo_u TYPE STANDARD TABLE OF stpo WITH HEADER LINE,
i_vbap_u TYPE STANDARD TABLE OF vbap WITH HEADER LINE,
i_vbrp_u TYPE STANDARD TABLE OF vbrp WITH HEADER LINE,
i_lips_u TYPE STANDARD TABLE OF lips WITH HEADER LINE,
i_afvc_u TYPE STANDARD TABLE OF afvc WITH HEADER LINE,
i_asmd_u TYPE STANDARD TABLE OF asmd WITH HEADER LINE,
* i_cooi_u TYPE STANDARD TABLE OF cooi WITH HEADER LINE,
i_qmel_u TYPE STANDARD TABLE OF qmel WITH HEADER LINE,
i_cooi_u TYPE STANDARD TABLE OF cooi WITH HEADER LINE,
i_esll_u TYPE STANDARD TABLE OF esll WITH HEADER LINE,
i_t165_u TYPE STANDARD TABLE OF t165 WITH HEADER LINE,
i_t165e_u TYPE STANDARD TABLE OF t165e WITH HEADER LINE,
i_twpko_u TYPE STANDARD TABLE OF twpko WITH HEADER LINE,
i_tpext_u TYPE STANDARD TABLE OF tpext WITH HEADER LINE,
i_ce4mxpa_u TYPE STANDARD TABLE OF ce4mxpa WITH HEADER LINE,
i_ce4mxpa_acct_u TYPE STANDARD TABLE OF ce4mxpa_acct WITH
HEADER LINE,
i_zaim_u TYPE STANDARD TABLE OF zaim WITH HEADER LINE,
i_s012_d TYPE STANDARD TABLE OF s012 WITH HEADER LINE,
i_s012_i TYPE STANDARD TABLE OF s012 WITH HEADER LINE,
i_dummy TYPE STANDARD TABLE OF mara.
CASE p_table.
WHEN 'MARA'.
* Non-Key
PERFORM move_to_table USING <f_table_data1>
CHANGING i_mara_u[]
i_mara_u.
PERFORM update_table USING i_mara_u[].
ENDCASE.
ENDFORM. " database_update
*& Form move_to_mara
FORM move_to_table USING p_tab_from TYPE STANDARD TABLE
CHANGING p_tab_to TYPE STANDARD TABLE
p_w_table.
DATA: l_wa_fcat TYPE lvc_s_fcat.
FIELD-SYMBOLS: <f_field_from> TYPE ANY,
<f_field_to> TYPE ANY.
LOOP AT p_tab_from ASSIGNING <f_wa_table_data1>.
LOOP AT i_fcat INTO l_wa_fcat.
ASSIGN COMPONENT l_wa_fcat-fieldname
OF STRUCTURE <f_wa_table_data1> TO <f_field_from>.
ASSIGN COMPONENT l_wa_fcat-fieldname
OF STRUCTURE p_w_table TO <f_field_to>.
<f_field_to> = <f_field_from>.
ENDLOOP.
APPEND p_w_table TO p_tab_to.
ENDLOOP.
ENDFORM. " move_to_mara
*& Form update_table
FORM update_table USING p_table_update TYPE STANDARD TABLE.
SELECT SINGLE *
FROM dd03l
WHERE fieldname = p_plfld
AND tabname = p_table
AND keyflag <> 'X'
AND as4local = 'A'
AND as4vers = l_v_as4vers
AND ( comptype = 'E' OR comptype = space ).
IF sy-subrc = 0.
* Do update
IF NOT p_table_update IS INITIAL.
UPDATE (p_table) FROM TABLE p_table_update.
IF sy-subrc = 0.
COMMIT WORK.
ELSE.
ROLLBACK WORK.
WRITE: text-003.
STOP.
ENDIF.
ENDIF.
ELSE.
*delete and insert.
IF NOT p_table_update IS INITIAL.
* DELETE (p_table).
IF sy-subrc = 0.
INSERT (p_table) FROM TABLE p_table_update.
IF sy-subrc = 0.
COMMIT WORK.
ELSE.
ROLLBACK WORK.
WRITE: text-018.
STOP.
ENDIF.
ELSE.
ROLLBACK WORK.
WRITE: text-018.
STOP.
ENDIF.
ENDIF.
ENDIF.
ENDFORM. " update_table
Edited by: Julius Bussche on Jul 18, 2008 1:43 PM
Please use a meaningfull subject title!ARS,
I am struggling a bit to get this.
there is a syntax error,
Field "FIELDS_INT-TYPE" is unknown. It is neither in one of thespecified tables nor defined by a "DATA" statement.
Again you have asked to move to a diffrent table. What is that table and how to build it.
LOOP AT <f_table_data1> ASSIGNING <f_wa_table_data1>.
LOOP AT i_fcat INTO l_fcat.
IF l_fcat-inttype EQ 'P'.
ASSIGN COMPONENT l_fcat-fieldname
OF STRUCTURE <f_wa_table_data1> TO <f_field>
TYPE fields_int-type
DECIMALS fields_int-decimals.
ELSE.
ASSIGN COMPONENT l_fcat-fieldname
OF STRUCTURE <f_wa_table_data1> TO <f_field>
TYPE fields_int-type.
ENDIF.
" Move <f_field> to a new table and use this table for download
ENDLOOP.
TRANSFER <f_wa_table_data1> TO p_bkfile.
ENDLOOP.
Ster -
What is the code to load a .swf file in AS3 on the same layer?
I'm new to AS3 and am trying to figure out the code for loading a .swf file on the same layer of the same page, thereby replacing all of the information. I don't want to put it on layer 2, etc. Another easy thing I can do in AS2 but am struggling with in AS3.
thanks!
SteveThere are no 'layers' in AS3 - there is just the display list. You can use addChildAt to add things at a specific depth - thereby placing it behind or above something, but if you just use addChild it goes on top of whatever is currently there...
Anyway - to answer your question, you can load a .swf with a Loader object like so:
var l:Loader = new Loader();
l.load(new URLRequest("myFile.swf"));
addChild(l);
You can wait for complete like was shown, but you don't have to. And this will not 'replace' anything - it just loads myFile.swf on top of anything currently being shown. If you want to 'replace' what's there you need to remove it first:
while(numChildren){
removeChildAt(0); -
Convert the flat file to xml format.
hi,
I need to write a interface program in the R/3 to pull the flat file data from the unix application server and do some manipulation and place back into the unix application server in XML format, From the unix box XML file taken by the XI server.
pls give me some idea to convert the flat file to XML format, through any function module or any other logic is there...
with regards,
Thambee.Hi Thambe
in addition to the above posts
Program to convert flat file to XML file.
please download tool from this link:
http://www.download.com/Stylus-Studio-2008-XML-Enterprise-Suite/3000-7241_4-10399885.html?part=dl-StylusStu&subj=dl&tag=button&cdlpid=10399885
how to use:
http://www.stylusstudio.com/learn_convert_to_xml.html
http://www.sap-img.com/abap/sample-xml-source-code-for-sap.htm
Flat file to XML
CONVERTION OF FLAT FILE TO XML : NO OUT PUT FOUND
Converting Idoc flat file representation to XML
how to convert flat file into IDOC-XML
Thanks
sandeep sharma
PS ; if helpful kindly reward points -
ABAP code for Hierarchy Loading from Flat File
Hi,
Can anyone give me some idea / ABAP code for generating parent - child relationships (NODEIDS) from a flat file and load into BW.
Best regards
Any insight into this development is highly appreciatedHi,
also have a look at this how to to get informations about the file structure:
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/0403a990-0201-0010-38b3-e1fc442848cb
/manfred -
Hello,
My hierarchy is loaded through flat file. This file is present in the application server.
We have hard coded the filename path in our program in the production system as:
DATA:p_fname LIKE rlgrap-filename value '
A0001SAP\PACE_PRD\interface\BI\BO\PYD_PDL.CSV'
Now, our pre production system is refreshed and hence after the refresh, the same path got copied in the pre production system and our process chain got failed as the path name is wrong. Same is the case in the development system.
Please note: The file path is same in all the systems except the name of the system i.e.
For development system, the name is PACE_DEV
for preprodcution system, the name is PACE_PREPRD,
for production system, it is PACE_PRD.
Could anyone let us know, what global logic should be developed so that the process chain runs smoothly in all the systems?
Thanks in advance for the reply.
Regards,
Nitin Chopade.Nitin Chopade,
Put the path /file name on the selection screen.
parameters: p_output(120).
Then use that selection-screen field in place of the hard coded value.
You can then change the path / file name at will.
or
Change the file '
A0001SAP\PACE_PRD\interface\BI\BO\PYD_PDL.CSV'
to '
A0001SAP\PACE_&SYSID&\interface\BI\BO\PYD_.CSV'
Assign the hard coded value to a variable, w_variable.
Before you use the file:
replace '&SYSID&' in w_variable with sy-sysid
Bruce
Edited by: Bruce Tjosvold on Dec 20, 2011 4:09 PM -
BAPI_PO_CREATE1 not able to create PO's for multiple rows from the flat fil
Hi
i am uploading PO's from a flat file into SAP using the BAPI_PO_CREATE1. Everything works fine if the flat file hast only one record.
if the flat file has more than one record then while loading the second record the BAPI returns a error message. I am calling the BAPI in a loop.
The strange thing is that if i load the second record individually the program is able to create the PO. So only when i have multiple records in the flat file i am unable to load the PO into SAP. I debugged and checked all the internal tables passed to the BAPI. All seems to have the data correctly but still the BAPI fails.
any idea where i am going wrong?
the code looks something like this.
LOOP AT HEADER_ITAB.
PERFORM FILL_HEADER_RECORDS.
LOOP AT ITEM_ITAB WHERE EBELN eq HEADER_ITAB-EBELN.
PERFORM FILL_ITEM_RECORDS.
ENDLOOP.
PERFORM CERATE_PO_VIA_BAPI.
ENDLOOP.What is the error message. Are you trying something like this:
LOOP AT T_DATA1.
AT NEW LIFNR.
READ TABLE T_DATA1 INDEX SY-TABIX.
PERFORM INIT_TABLES.
PERFORM FILL_DATA.
--Call the BAPI to create PO
PERFORM CREATE_PO.
ENDAT.
ENDLOOP.
FORM CREATE_PO .
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
POHEADER = POHEADER
POHEADERX = POHEADERX
POADDRVENDOR =
TESTRUN =
MEMORY_UNCOMPLETE =
MEMORY_COMPLETE =
POEXPIMPHEADER =
POEXPIMPHEADERX =
VERSIONS =
NO_MESSAGING =
NO_MESSAGE_REQ =
NO_AUTHORITY =
NO_PRICE_FROM_PO =
IMPORTING
EXPPURCHASEORDER = EXPPURCHASEORDER
EXPHEADER = EXPHEADER
EXPPOEXPIMPHEADER = EXPPOEXPIMPHEADER
TABLES
RETURN = RETURN
POITEM = POITEM
POITEMX = POITEMX
POADDRDELIVERY =
POSCHEDULE = POSCHEDULE
POSCHEDULEX = POSCHEDULEX
POACCOUNT = POACCOUNT
POACCOUNTPROFITSEGMENT =
POACCOUNTX = POACCOUNTX
POCONDHEADER =
POCONDHEADERX =
POCOND = POCOND
POCONDX = POCONDX
POLIMITS =
POCONTRACTLIMITS =
POSERVICES =
POSRVACCESSVALUES =
POSERVICESTEXT =
EXTENSIONIN =
EXTENSIONOUT =
POEXPIMPITEM =
POEXPIMPITEMX =
POTEXTHEADER =
POTEXTITEM = POTEXTITEM
ALLVERSIONS =
POPARTNER = POPARTNER
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = RETURN1.
DATA: L_NAME TYPE LFA1-NAME1.
CLEAR L_NAME.
SELECT SINGLE NAME1
FROM LFA1
INTO L_NAME
WHERE LIFNR = POHEADER-VENDOR.
LOOP AT RETURN.
WRITE : / RETURN-TYPE,
RETURN-ID,
RETURN-MESSAGE.
WRITE : '--> For vendor:',
POHEADER-VENDOR,
L_NAME.
ENDLOOP.
ENDFORM. " CREATE_PO -
Different formats of the flat file for the same target
In our deployment, we use plugin code to extract the csv files in the required format. The customers are on same version of datamart, but they are on different versions of source database - from 3.x to 4.5 depending on which version of application they are using. In 4.0, we introduced a new column email in the user table in the source database. Accordingly, plugin will add the field in the csv file. But not all the customers will get the upgraded version of plugin at the same time. So ETL code needs to decide which data flow to process depending on the format of the csv file to load data to the same target table. I made the email field in the target table nullable but it still expects the same format of the csv file with delimiter for null value.
Need help to achieve this. Can I read the structure of the flat file in DS or get the count of delimiters so that I can use a conditional to use different data flow based on the format of the flat files.
Can I make the email column in the flat file optional?
Thanks much in advance.You can add an email column that maps to null in a query transform for the source that does not contain this column.
Or else you can define two different file formats that map to the same file. One with the column and one without -
Can I combine two methods of code to load various SWF files into the same location
I presently have a set up where a large SWF file brought on the stage by clicking small icons from the scrollable thumbnail menu on the bottom of the stage. All of it happens at the same frame with .xml loading file.
Here is the code for constructing the ImageLoader(for thumbnails) and SWFLoader for (bigger SWF files)
[CODE]
function _xmlCompleteHandler(event:LoaderEvent):void {
_slides = [];
var xml:XML = event.target.content; //the XMLLoader's "content" is the XML that was loaded.
var imageList:XMLList = xml.image; //In the XML, we have <image /> nodes with all the info we need.
//loop through each <image /> node and create a Slide object for each.
for each (var image:XML in imageList) {
_slides.push( new Slide(image.@name,
image.@description,
new ImageLoader("loadingAssets/appThumbnails/slideshow_image scroller greenSock_mine/assets/thumbnails/appThmb_imgs/" + image.@name + ".jpg",
name:image.@name + "Thumb",
width:_THUMB_WIDTH,
height:_THUMB_HEIGHT,
//centerRegistration:true,//messes up the code as places SWFLoader in the upper left corner which is 0,0 coordinates
//x:260, y:320,//doesn't work here but works in line 69
scaleMode:"proportionalInside",
bgColor:0x000000,
estimatedBytes:13000,
onFail:_imageFailHandler}),
new SWFLoader("loadingAssets/appThumbnails/slideshow_image scroller greenSock_mine/assets/images/" + image.@name + ".swf",
name:image.@name + "Image",
width:_IMAGE_WIDTH,
height:_IMAGE_HEIGHT,
//centerRegistration:true,//messes up the code as places SWFLoader in the upper left corner which is 0,0 coordinates
x:0, y:144,
scaleMode:"proportionalInside",
bgColor:0x000000,
estimatedBytes:820000,
onFail:_imageFailHandler})
[/CODE]
Here is what I would like to resolve. I have another section on the site with an image collage. Every image is a button. I want to script this each image on click to go to the label with ImageLoader and SWFLoader AND TO OPEN A UNIQUE SWF (ASSOCIATED WITH AN IMAGE CLICKED) ON THAT PAGE
Previously this is what I did to achieve it. I would specify a String:
[CODE]
var sourceVar_ProductsPopUps:String;
[/CODE]
and then all my buttons will have their unique SWF assigned for them which opens at another labeled section ("prdctsPopUps" in this example):
[CODE]
function onClickSumix1PopUp(event:MouseEvent):void {
sourceVar_ProductsPopUps="prdcts_popups/sumix1-popup_tl.swf";
gotoAndPlay("prdctsPopUps");
[/CODE]
Then in the "prdctsPopUps" section I would specify that var string to bring up SWF files. The value of sourceVar_ProductsPopUps allows to load mulitple SWFs from the previous page.
[CODE]
loaderProductPopUps = new SWFLoader(sourceVar_ProductsPopUps,
[/CODE]
But I need both of them to be working at the same time. First there is a sectionA from where a user can navigate to specifically targeted SWF to section B's SWFLoader. Then in the section B a user has an option to bring up other SWF files into SWFLoader from the scrollable thumbs menu. Is there a way to combine these two lines into one:
[CODE]
new SWFLoader("loadingAssets/appThumbnails/slideshow_image scroller greenSock_mine/assets/images/" + image.@name + ".swf",
[/CODE]
and
[CODE]
new SWFLoader(sourceVar_ProductsPopUps,
[/CODE]Thanks for looking into my issue.
Unfortunatelly I am not so advanced in AS and do not complitely understand the logic of the problem. I will try to decribe my set up more precise.
So, my main flash file is broken into labeled sections on the main time line.
One of the sections is "Applications" It has an animated collage of images. Each image acts as a button and once clicked brings a user to a section called "ApplicationsPopUps".
"ApplicationsPopUps" section has small image thumbnails scroll menu at the bottom of the screen and a large SWFLoader in the middle of the screen. User can click on an image in the thumbnails scroll menu and a corresponding SWF file will load in the middle of the screen in SWFLoader. User can click on left/right navigation buttons and preceeding/following SWF file will load in SWFLoader.
Everything works fine (with your previous help)
Here is the working code for the ImageLoader and SWFLoader (please let me know if you need additional code on the page):
function _xmlCompleteHandler(event:LoaderEvent):void { _slides = []; var xml:XML = event.target.content; //the XMLLoader's "content" is the XML that was loaded. var imageList:XMLList = xml.image; //In the XML, we have nodes with all the info we need. //loop through each node and create a Slide object for each. for each (var image:XML in imageList) { _slides.push( new Slide(image.@name, image.@description, new ImageLoader("loadingAssets/appThumbnails/slideshow_image scroller greenSock_mine/assets/thumbnails/appThmb_imgs/" + image.@name + ".jpg", { name:image.@name + "Thumb", width:_THUMB_WIDTH, height:_THUMB_HEIGHT, //centerRegistration:true,//messes up the code as places SWFLoader in the upper left corner which is 0,0 coordinates //x:260, y:320,//doesn't work here but works in line 69 scaleMode:"proportionalInside", bgColor:0x000000, estimatedBytes:13000, onFail:_imageFailHandler}), new SWFLoader("loadingAssets/appThumbnails/slideshow_image scroller greenSock_mine/assets/images/" + image.@name + ".swf", { name:image.@name + "Image", width:_IMAGE_WIDTH, height:_IMAGE_HEIGHT, //centerRegistration:true,//messes up the code as places SWFLoader in the upper left corner which is 0,0 coordinates x:0, y:144, scaleMode:"proportionalInside", bgColor:0x000000, estimatedBytes:820000, onFail:_imageFailHandler})
Thumbnails in the section "ApplicationsPopUps" and images in the image collage in the section "Applications" represent the same photographs. So when a user clicks on one of the images in "Applications" section it would be natural that that image will load in the "ApplicationsPopUps" section. However "ApplicationsPopUps" section presently has a working code (as sampled above) It looks too complex for me and I do not know hot to implement this feature. I do want to keep the functionality of the thumbs image scroller in section "ApplicationsPopUps" as it is now. But I want to add that when a user click on an image from section"Applications" then that particular SWF file will load in SWFLoader in section "ApplicationsPopUps" and then the present functionality can as well be exectuted. Presently it just opens on a first image in xml order.
P.S. I see that you had a download link in your answer. How did you do it? I could also upload a small sample file with my problem. This way you could see all the set up right away.
Maybe you are looking for
-
Replace windows 7 home premium 64bit oem
Hi I've a Lenovo g770 laptop from Poland and using in uk. Changing language to uk does not work 100% on home premium edition. So if I buy new windows 7 in uk could I install this as a new oem version on the laptop replacing existing (which would be u
-
Apple TV 1st generation via rca
Hey, i have the old style back box TV & i was wondering is there anyway to connect my 1st gen apple tv to it using RCA? as cheap as pos
-
Xen/KVM/other - which solution for Linux virtualization
Hello, we are intensively using Solaris 10 virtualization called Solaris zones. It is so secure (in terms of separation), easy to use and has so little overhead that our DBAs doesn't want to install our RDBMS-es out of zones. But we are going to depl
-
Trojan.Haxdoor-131 file corruption ...
ClamXav discovered 2 Phishing .Card-28. It also located a Mail library folder that was corrupted by the Trojan.Haxdoor-131. I trashed all three. I did save the corrupted Mail folder called: /Library/Mirrors/###... My question is do I need to replace
-
V$db_object_cache
Hi, I have a package OWA that is executing many times and I see that has a lot of locks. What means this? How could I fix this issue? Thanks! sql> select type, sharable_mem, loads, executions, locks, pins, kept, child_latch 2 from v$db_object_cach