Shell script: function doesn't set global variable when piped
Hey there, just started to play around with some bash scripting and I bumped into this issue today.
My code:
#!/bin/sh
MY_VAR=0
echo "First: $MY_VAR"
my_func() {
MY_VAR=1
my_func | grep "Fail"
echo "Pipe: $MY_VAR"
my_func
echo "Func: $MY_VAR"
Result:
First: 0
Pipe: 0
Func: 1
I assume that bash is starting a subshell to run my function when piping the result to grep. Is there any way to set the variable and pipe the output at the same time?
Thanks, that does confirm why it doesn't work as expected. At the moment my only solution is something along the lines of:
#!/bin/sh
MY_VAR=0
my_func() {
MY_VAR=1
#echo "Some Text"
MY_OUTPUT="Text that I was going to echo"
my_func
echo $MY_OUTPUT | grep "Text"
This sets MY_VAR to 1 as expected and I can still pipe the output to some other application but it looks awfully hackish, not to mention that it requires me to change every 'echo' to some var...
If anyone comes up with a better solution I'll be glad to hear it.
Similar Messages
-
Any way to set global variables except EAS console?
Hi pros,
I am searching for a way to set global variables (used by business rules) automatically.
I got several variables which should change each month. I know the rule to set them.
However, I cannot find any way to set them through scripting or something else.
I tried to research EAS repository. The one that I found relevant is HBRVariables table.
I cannot find any tool can help this.
Any one knows how?
Appreciated......
Casp HuangYes you can use substitution variables in business rules and they are widely used, it is relatively easy to automate the changing of values for subtitution values.
You can also put a sub var into the default value for a global variable in business rules.
Cheers
John
http://john-goodwin.blogspot.com/ -
UDM and shell scripts and working with the ENVIRONMENT variable options
In Userdefined metrics you have the ability to pass envronment variables.
I was going to send
DIR=/db/db05/oradata/ORCL/hot
How to handle whats passed to the shell script?
It passes $1 as {DIR=/db/db05/oradata/ORCL/hot}
yes with the brackets. Here I figured it would simply set the DIR environment variable.
Any cool tricks to work with this mess?
Is it meant for perl scripts instead?
Daryl.Ilmari Aalto wrote:
Hi Darth,
Thanks for your hint! Nevertheless I think it's something more profound, since there's no error etc. For example, should I have the path wrong I assume that OWB would return me some kind of an error when it doesn't find the .sh-file? Isn't there any log-file to see whether the command was executed? It seems like the execution of the User Defined element would be skipped altogether.
Cheers,
IlmariNo, if you don't give an absolute path OWB will not return any error, it just wont do anything at all... -
Set global variable in FOX formula
Hi all,
Does anybody know how to change the value of a global variable inside a FOX formula?.
I can get its value and assign to a local variable but I would like to set the global value after reading a keyfigure and make some calculations.
is it possible? maybe with some ABAP function call?
Thanks for your help!Include characteristic HIRE in your 'fields to be changed' of planning function and in FOX write:
DATA L_HIRE TYPE HIRE.
DATA EXISTBPSID TYPE ZTA_BPSID.
DATA BPSIDNO TYPE ZTA_BPSID.
BPSIDNO = VARV(BPSTAS2).
FOREACH L_HIRE.
IF EXISTBPSID = '#'.
{L_HIRE,BPSIDNO} = {L_HIRE,EXISTBPSID}.
BPSIDNO = BPSIDNO + 0000000001.
ENDIF.
ENDFOR. -
Setting global variable to be used in a SQL task
I am trying to create a simple SSIS package to be used in the SQL Task
The SQLStatement is
Update dbo.Users
set FirstName = ?
where UserID = 2
Added a parameter mapping for User::strDataString
From the data manager dynamic script, I included following code to prompt for the value and set to the global variable and then call the excecute SQL task.
PROMPT(TEXT,%strData%,"Enter value",,"")
GLOBAL(@[User::strDataString],%strData%)
TASK(Execute SQL Task,,)
When the check the database, the table is getting updated only with the default value of the strDataString but not with the value entered in BPC.
Am I missing any link?
Thanks
Omkar
Edited by: yomkar on Mar 17, 2010 1:13 PMHello,
on which version of BPC are you running ?
Can you try to make all your SSIS variables upper case, it helped me on earlier versions of BPC.
Be aware too that if you have an instruction like GLOBAL(STR,some_value), BPC will do a string replacement within the MODIFYSCRIPT variable : "STR" -> "some_value".
for example :
GLOBAL(STR,some_value)
TASK(STR TSK,....) will be replaced by TASK(some_value, ....).
Vladimir. -
How do I set global variables for use by ALL form1.#subform[0] items?
Hi All,
I know how to code javascript but am new to Adobe LiveCycle. When I open script editor, I have the following code (all code is in un-bolded):
----- form1.#subform[0]::initialize: - (FormCalc, client) ------------------------------------------
// BEGIN: SET GLOBAL PRICES //
var Cityscope_Sydney_CostUser1 = 60.39;
var Cityscope_Sydney_CostUsers2to5 = 3.02;
var Cityscope_Sydney_CostUsers6to20 = 1.21;
var Cityscope_Sydney_CostHardCopyWithOnline = 14.59;
var Cityscope_Sydney_CostHardCopyWithoutOnline = 54.67;
var Cityscope_Sydney_CostHardCopyAdditional = 14.59;
var Cityscope_NorthSydney_CostUser1 = 48.40;
var Cityscope_NorthSydney_CostUsers2to5 = 2.42;
var Cityscope_NorthSydney_CostUsers6to20 = 0.97;
var Cityscope_NorthSydney_CostHardCopyWithOnline = 14.59;
var Cityscope_NorthSydney_CostHardCopyWithoutOnline = 43.54;
var Cityscope_NorthSydney_CostHardCopyAdditional = 14.59;
// END: SET GLOBAL PRICES //
----- form1.#subform[0]::enter: - (FormCalc, client) -----------------------------------------------
----- form1.#subform[0]::exit: - (FormCalc, client) ------------------------------------------------
----- form1.#subform[0]::calculate: - (FormCalc, client) -------------------------------------------
----- form1.#subform[0]::validate: - (FormCalc, client) --------------------------------------------
----- form1.#subform[0]::preSave - (FormCalc, client) ----------------------------------------------
<<======= etc etc etc =======>>
----- form1.#subform[0].Item1Cost::initialize: - (JavaScript, client) ------------------------------
----- form1.#subform[0].Item1Cost::enter: - (FormCalc, client) -------------------------------------
----- form1.#subform[0].Item1Cost::exit: - (FormCalc, client) --------------------------------------
----- form1.#subform[0].Item1Cost::calculate: - (JavaScript, client) -------------------------------
//Store form values in user-friendly names.
var AreaSelected = Item1Area.rawValue;
var NumberOfUsersSelected = Item1Users.rawValue;
//Declare other vars.
var Users1Calculation;
var Users2to5Calculation;
var Users6to20Calculation;
//Calculate individual User Cost "components" based on number of users selected for the area.
switch(true)
case (NumberOfUsersSelected < 2):
Users1Calculation = NumberOfUsersSelected * Cityscope_Sydney_CostUser1;
Users2to5Calculation = 0.00;
Users6to20Calculation = 0.00;
break;
case (NumberOfUsersSelected > 1 && NumberOfUsersSelected < 6):
Users1Calculation = Cityscope_Sydney_CostUser1;
Users2to5Calculation = (NumberOfUsersSelected - 1) * Cityscope_Sydney_CostUsers2to5;
Users6to20Calculation = 0.00;
break;
case (NumberOfUsersSelected > 5):
Users1Calculation = Cityscope_Sydney_CostUser1;
Users2to5Calculation = 4 * Cityscope_Sydney_CostUsers2to5;
Users6to20Calculation = (NumberOfUsersSelected - 5) * Cityscope_Sydney_CostUsers6to20;
break;
default:
alert("BROKEN: Calculate individual User Cost components based on number of users selected for the area.");
//apply total cost for this item
Item1Cost.rawValue = Users1Calculation + Users2to5Calculation + Users6to20Calculation;
----- form1.#subform[0].Item1Cost::validate: - (FormCalc, client) ----------------------------------
----- form1.#subform[0].Item1Cost::mouseEnter: - (FormCalc, client) --------------------------------
----- form1.#subform[0].Item1Cost::mouseExit: - (FormCalc, client) ---------------------------------
----- form1.#subform[0].Item1Cost::change: - (FormCalc, client) ------------------------------------
----- form1.#subform[0].Item1Cost::full: - (FormCalc, client) --------------------------------------
----- form1.#subform[0].Item1Cost::mouseUp: - (FormCalc, client) -----------------------------------
----- form1.#subform[0].Item1Cost::mouseDown: - (FormCalc, client) ---------------------------------
----- form1.#subform[0].Item1Cost::click: - (FormCalc, client) -------------------------------------
----- form1.#subform[0].Item1Cost::preSave - (FormCalc, client) ------------------------------------
----- form1.#subform[0].Item1Cost::postSave - (FormCalc, client) -----------------------------------
----- form1.#subform[0].Item1Cost::prePrint - (FormCalc, client) -----------------------------------
----- form1.#subform[0].Item1Cost::postPrint - (FormCalc, client) ----------------------------------
----- form1.#subform[0].Item1Cost::preSubmit:form - (FormCalc, client) -----------------------------
----- form1.#subform[0].Item1Cost::docReady - (FormCalc, client) -----------------------------------
----- form1.#subform[0].Item1Cost::docClose - (FormCalc, client) -----------------------------------
----- form1.#subform[0].Item1Cost::ready:form - (FormCalc, client) ---------------------------------
----- form1.#subform[0].Item1Cost::ready:layout - (FormCalc, client) -------------------------------
----- form1.#subform[0].Item1Users::initialize: - (FormCalc, client) -------------------------------
----- form1.#subform[0].Item1Users::enter: - (FormCalc, client) ------------------------------------
----- form1.#subform[0].Item1Users::exit: - (FormCalc, client) -------------------------------------
----- form1.#subform[0].Item1Users::calculate: - (FormCalc, client) --------------------------------
----- form1.#subform[0].Item1Users::validate: - (FormCalc, client) ---------------------------------
----- form1.#subform[0].Item1Users::mouseEnter: - (FormCalc, client) -------------------------------
----- form1.#subform[0].Item1Users::mouseExit: - (FormCalc, client) --------------------------------
----- form1.#subform[0].Item1Users::change: - (FormCalc, client) -----------------------------------
----- form1.#subform[0].Item1Users::full: - (FormCalc, client) -------------------------------------
----- form1.#subform[0].Item1Users::mouseUp: - (FormCalc, client) ----------------------------------
----- form1.#subform[0].Item1Users::mouseDown: - (FormCalc, client) --------------------------------
----- form1.#subform[0].Item1Users::click: - (FormCalc, client) ------------------------------------
----- form1.#subform[0].Item1Users::preSave - (FormCalc, client) -----------------------------------
----- form1.#subform[0].Item1Users::postSave - (FormCalc, client) ----------------------------------
----- form1.#subform[0].Item1Users::prePrint - (FormCalc, client) ----------------------------------
----- form1.#subform[0].Item1Users::postPrint - (FormCalc, client) ---------------------------------
----- form1.#subform[0].Item1Users::preSubmit:form - (FormCalc, client) ----------------------------
----- form1.#subform[0].Item1Users::docReady - (FormCalc, client) ----------------------------------
----- form1.#subform[0].Item1Users::docClose - (FormCalc, client) ----------------------------------
----- form1.#subform[0].Item1Users::ready:form - (FormCalc, client) --------------------------------
----- form1.#subform[0].Item1Users::ready:layout - (FormCalc, client) ------------------------------
...and so on and so forth....
In short, I want the code within:
----- form1.#subform[0].Item1Cost::calculate: - (JavaScript, client) -------------------------------
...to be able to access the variables I have created in:
----- form1.#subform[0]::initialize: - (FormCalc, client) ------------------------------------------
(I have assumed that this is where I would store Global variables)
At this stage, the global variables cannot be accessed with the configuration above. The only was I can get this to work is to cut and paste the global vairables into each form1.#subform[0] item, which of course defeats the purpose of global variables! I plan to have many more items so would not want to duplicate the global variables for all of them!
Can somebody show me how to do this?
Any help is very much appreciated!
Thanks
Stanbridge
Message was edited by: stanbridgej - colors and or fonts won't save. Have bolded my question to make code (non-bolded) easier to read (I hope).Hi MorisTM,
Thanks for the reply!
Yes, I saw that option (I should have mentioned I already knew about it), but was wondering if there is a way I can do this via code.
There are two reason I want to be able to do it via code (only one of which may be valid):
1) I can automatically generate my pricing code form another inhouse app.
2) I am hoping that later on once I get this working I will be able take it a step further and get the data directly from a MySQL database!
Cheers though!
Any other suggestions?
Regards,
Stanbridge -
Setting global variable that are static but I want them to change
I'm trying to set a global variable so I can let the user change the state in the Plugin Manager. I've created a checkbox (in PluginManager.lua)
f:checkbox {
title = 'Show HTTP response',
value = _G.showHttpResponse,
that references the global variable (in PluginInit.lua)
_G.showHttpResponse = true
The state of the checkbox accurately reflects the initial value as set. Everything seems fine but after unchecking the checkbox, the value is always true in my plugin. I expected _G.showHttpResponse to change to reflect the setting in the checkbox.
What have I overlooked? Is this only for setting static globals?
AbeReading the Lightroom SDK manual seemed to indicate that using globals would be the way to go. I'm thinking that it is only appropriate for static text.
I've taken both your suggestions and have used the plugin preferences. I didn't think you could get and set them in the Plugin Manager but they work just fine. Now I set my debug flags in the plugin manager screen and they are available to the plugin and are persisted as well.
Thanks for the suggestion. Everything is working. -
Function REUSE_ALV_GRID_DISPLAY, events and global variables
Hi everybody,
in a report I use FM REUSE_ALV_GRID_DISPLAY with a registered callback for event 'USER_COMMAND'.
In the callback-form I want to change the internal table, which I provided for displaying to REUSE_ALV_GRID_DISPLAY.
How can I access the internal table in the callback-form without using global variables?.
Kind regards,
Hubert
Edited by: Hubert Heitzer on Feb 23, 2011 4:13 PM
This is not the solution I asked for, but I found a workaround.
I created a function group, which encapsulates the internal table.
A function provides the service for colleting data for the internal table and displays the ALV.
The callback-form is also a member of my function group and is therefore able to access the internal table.Hi everybody,
in a report I use FM REUSE_ALV_GRID_DISPLAY with a registered callback for event 'USER_COMMAND'.
In the callback-form I want to change the internal table, which I provided for displaying to REUSE_ALV_GRID_DISPLAY.
How can I access the internal table in the callback-form without using global variables?.
Kind regards,
Hubert
Edited by: Hubert Heitzer on Feb 23, 2011 4:13 PM
This is not the solution I asked for, but I found a workaround.
I created a function group, which encapsulates the internal table.
A function provides the service for colleting data for the internal table and displays the ALV.
The callback-form is also a member of my function group and is therefore able to access the internal table. -
Crystal Report 2008 doesn't set page size when export to excel file
Hi,
I am using Crystal Report 2008 Developer edition.
At Crystal report design time setting the below page setup:
Page Options -
to A3(297X420 mm)
Orientation --- Landscape
and using the following code in .net (c#)
I am using below format options to export in excel in .net 2005
ReportDocument oReport = new ReportDocument();
oReport.FormatEngine.PrintOptions.PaperOrientation = PaperOrientation.Landscape;
oReport.FormatEngine.PrintOptions.PaperSize = CrystalDecisions.Shared.PaperSize.PaperA3;
if (aParamlist.ReportFormat == ReportFormatEnum.MicrosoftExcel)
ExcelFormatOptions excel = new ExcelFormatOptions();
excel.ExcelUseConstantColumnWidth = false;
// Use detail section one as a guideline to determine column width
excel.ExcelAreaGroupNumber = 1;
//excel.ExcelAreaType = AreaSectionKind.Detail;
excel.ExcelAreaType = AreaSectionKind.Detail;
// Prepare exporting options
ExportOptions export = oReport.ExportOptions;
export.FormatOptions = excel;
export.ExportFormatType = ExportFormatType.Excel;
oReport.Export();
when export to excel it doesn't set the Paper Size to A3(297X420 mm).
Is there any way to set the paper size while export to excel or in other formats also????
Thanks & Regds,Hi,
thanks for your email.
This is not happening in development environment.It is setting the paper size anf paper orientation properly.
this is happening in the production environment where only redist installation is done.
thanks -
Best Practice for setting bind variable when application loads
I am using JDeveloper 11.1.2.3.
When my application loads, the first unbounded page has a table populated by a named query.
I would like to set the parameter used by the named query when the page loads, to populate the initial data that is displayed.
What is the best practice for a solution to this issue?user6003393 wrote:
I am using JDeveloper 11.1.2.3.
When my application loads, the first unbounded page has a table populated by a named query.
I would like to set the parameter used by the named query when the page loads, to populate the initial data that is displayed.
What is the best practice for a solution to this issue?Hi,
You can set the bind variable on VO by overriding prepareSession() method in Application Module check this http://docs.oracle.com/cd/E37975_01/web.111240/e16182/bcservices.htm#sthref357
Setting bind variable on runtime http://docs.oracle.com/cd/E37975_01/web.111240/e16182/bcquerying.htm#CHDECJHD
Zeeshan -
JDev903 debugger doesn't display local variable when debugging into JDK src
Hi,
I found that JDev903 debugger doesn't display local variables in the "smart data" and "data" panels when debugging into the JDK src. For most of the time, it only shows "this" object.
Is this right? How do I setup JDev903 to display local variables in debugger?
thanks,
RichardHi Fred,
Did you forget to put resultFormat="e4x"? -
Setting volume automatically in shell script
hi there, I'm trying to create a shell script that unmutes and sets the volume for a sound card's mixer controls, using amixer. It will pretty much always be run in Arch Linux using alsautils. This script will be used on computers where I won't necessarily know what exact controls the user will have in their sound card, so running a command like 'amixer set Master unmute 75%' won't really work, but they may not have a Master, or it might have a slightly different name. So really it seems like the only way to get this done is to parse through the output of 'amixer scontrols' and try to find all controls that have either a pvolume or cvolume capability. Is this the best way of doing this, or is there some simpler way? If so, I was hoping people could give me a headstart on the sed/awk pattern(s) I'll need for this.
Thanks allNot sure what you're asking but:
amixer scontrols | sed "s#^.*[']\(.*\)['].*#\1#"
returns a list of all available controls... or did you only want to find a way to test whether a control is c/p-vulume capable. Is that one always on top maybe?
My suggestion would be to try aumix... it's in comunity as "aumix-gtk"...
then you can simply use:
#voldown
aumix -v -10
#volup
aumix -v +10
If this doesn't help you, could you be more specific? -
Problem while calling concsub from shell script
Hi All,
I am facing problem when I am trying to run CONCSUB utility from shell script.The same works well when I try it from command line.The only prob I am facing from shell script is assigning values to temporary variables.
This is how my script looks
#!/bin/bash
export PARM5="$5"
export PARM6="$6"
export PARM7="$7"
echo "INTPARM5=\"$PARM5\""
echo "INTPARM6=\"$PARM6\""
echo "INTPARM7=\"$PARM7\""
echo $FND_TOP/bin/CONCSUB $1 ONT 'Order Management Super User, Vision Operations (USA)' $3 WAIT=Y CONCURRENT ONT $PROGRAM "$INTPARM5" "$INTPARM6" "$INTPARM7"When I try to run the above shell based concurrent program it doesn't pass the parameters as expected and it errors out saying "Wrong number of arguments to call the procedure"
I tried my luck from some of the previous posts ({thread:id=2360776} ),but to vain
If anyone has any ideas,please suggest!!
Thanks in advance!!
Edited by: sandy on May 4, 2013 12:54 PMHere are your proofs
Proocedure
PROCEDURE abc(--p_errbuf OUT VARCHAR2,
--p_errcode OUT VARCHAR2,
p_order_no IN NUMBER DEFAULT NULL,
p_customer_id IN NUMBER DEFAULT NULL,
p_name IN VARCHAR2 DEFAULT NULL
IS
v_cname VARCHAR2(200);
v_ordered_date DATE;
v_order_number NUMBER;
v_order_type VARCHAR2(200);
BEGIN
fnd_file.put_line(fnd_file.output, 'Begin Execution');
SELECT DISTINCT ac.customer_name,
d.ordered_date ordered_date,
d.order_number order_number,
x.NAME order_type
INTO v_cname
,v_ordered_date
,v_order_number
,v_order_type
FROM oe_order_headers_all d,
oe_transaction_types_tl x,
wsh_delivery_details b,
wsh_delivery_assignments c
,ar_customers ac
WHERE 1 = 1
AND ac.customer_id = b.customer_id
AND d.order_type_id = x.transaction_type_id
AND x.LANGUAGE = 'US'
AND b.released_status = 'B'
AND b.source_header_id = d.header_id
AND c.delivery_detail_id = b.delivery_detail_id
AND d.order_number=NVL(p_order_no,d.order_number)
AND ac.customer_id = NVL(p_customer_id,ac.customer_id)
AND x.name=NVL(p_name,x.name)
AND NOT EXISTS (SELECT 1
FROM wsh_delivery_details b
WHERE 1 = 1
AND b.released_status != 'B'
AND b.source_header_id = d.header_id)
--BETWEEN ('1213794') and ('1213797'))
AND rownum<2;
INSERT INTO xxc_temp(customer_name,ordered_date,order_number,order_type) VALUES(v_cname,v_ordered_date,v_order_number,v_order_type);
COMMIT;
fnd_file.put_line(fnd_file.output, 'Order Number is' || v_order_number);
fnd_file.put_line(fnd_file.output, 'Order Type is' || v_order_type);
END;Script
#!/bin/bash
set -x
export PARM5="$5"
export PARM6="$6"
export PARM7="$7"
sqlplus -s $1 <<EOF
set head off feed off serverout on size 1000000
exec abc('$PARM5','$PARM6','$PARM7');
exit
EOFNow when I run the 'XX Order Detail CSV Report' I get the below log and no Output
+---------------------------------------------------------------------------+
Application Object Library: Version : 12.0.0
Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
XXKES_PDF_TRANSFER module: XX Order Detail CSV Report
+---------------------------------------------------------------------------+
Current system time is 06-MAY-2013 05:05:56
+---------------------------------------------------------------------------+
+ export PARM5=66432
+ PARM5=66432
+ export PARM6=
+ PARM6=
+ export PARM7=Mixed
+ PARM7=Mixed
+ sqlplus -s APPS/APPS
+---------------------------------------------------------------------------+
Executing request completion options...
Output file size:
0
+------------- 1) PRINT -------------+
Disabling requested Output Post Processing. Nothing to process. The output of the request is zero byte.
+--------------------------------------+
Finished executing request completion options.
+---------------------------------------------------------------------------+
Concurrent request completed successfully
Current system time is 06-MAY-2013 05:05:56
+---------------------------------------------------------------------------+After the concurrent program executed I queried the table xxc_temp and here you see the data
SQL> select * from xxc_temp;
CUSTOMER_NAME
ORDERED_D ORDER_NUMBER ORDER_TYPE
A. C. Networks
18-FEB-13 66432 MixedMy procedure fetches the data fro given set of i/p parameters but it doesn't give o/p coz it's a host based conc program.Please advise if there's a way to get the o/p in a host based conc program
Thanks!! -
Shell script adapter and passwords
Does anyone know how to get a password into a shell script resource adapter?
I've set up the "password" attribute in my resource adapter's schema, expecting at least to see the encrypted password in in $WSUSER_password, but it's always empty. Other attributes I add to the resource scheme show up in the scripts as shell variables just fine.
Side question - the Solaris resource adapter, which looks a lot like the shell script adapter, doesn't even have a password in its schema map, yet it seems to set passwords just fine. What's up with that?
The ShellScriptResourceObjects55.xml example doesn't seem to deal with passwords at all.Hi,
Have you been able to resolve this issue?
I am currently working on configuring a Shell Script Resource on my IDM system.
I am still in the "*Create User"* stage of things (I haven't even begun working with the other Actions : Get User, Get All Users, Delete User, Update User)
After a month-long period of trial-and-error, and a lot of headaches, I finally succeeded in Creating a new user on my Unix Machine, without any errors
Except for one thing : for some reason, the user I create is not being given a password!
A first, I configured the "Attribute Mapping" page to include a "Password" attribute. This did not work.
Then I removed the password from there (I figured that when I input the user's basic information on the IDENTITY tab in IDM, then the password gets automatically passed to the Unix machine).
Still, this did not work.
The funniest thing is : I am not getting any errors. The user is created on my Unix machine. And, also, in my My-SQL database.
The problem is : when I try to log into that same Unix machine as the user, it does not work, because......of course.....*.there is NO PASSWORD*.
What could be the problem? -
How do I set a variable on the main timeline from within a symbol?
Just getting started with Animate and coming to it from Flash, as may be apparent from my question. How do you set a variable to the main timeline from within a symbol?
I have 24 pairs of clickable elements, each in their own symbols, and all 24 of those symbols sit inside another symbol. I want all 24 to be able to set the same global variable when clicked. I can't find that this question is addressed anywhere, which makes me think I may be stuck in a Flash mindset and approaching the task in the wrong way. (There are however MANY discussions of how to address objects at different levels in the hierarchy. That's well covered.)
Relatedly, how do you access a function on the main timeline from within a symbol?
Adobe should consider putting together a support page (or pages) just for folks migrating form Flash. In the materials I've encountered so far there seems to be a studied effort to refrain from mentioning Flash in any way. I imagine there are a lot of people out there like me who have a deep background in Flash coding, but are just getting started with Animate. We don't need help with most of the basic concepts, but we may still have some pretty basic questions about how to accomplish some things in Animate because our Flash knowledge is getting in the way.Hi Bill,
There are plenty of threads on here about scope, but here's one way to create a global variable:
// code on Stage.compositionReady
sym.myGlobalVar = 1;
Then, anywhere in your project, you can check/set that var like so:
sym.getComposition().getStage().myGlobalVar = 2;
And here's one way to create a global function:
// code on Stage.compositionReady
sym.myGlobalFunction = function(){
console.log('myGlobalFunction');
Then, anywhere in your project, you can call that function like so:
sym.getComposition().getStage().myGlobalFunction();
Maybe you are looking for
-
New laptop wont play any of itunes.
i have a new laptop. i did the step-by-step advice on apple help website to move my itunes library to my new laptop. at first it was only importing 300 of my 2000 songs. now it has imported all the names into itunes. but when i click on it to play or
-
Rebind invoked from non-local host (AccessException)
Hi all, I have a simple RMI setup where a client class asks for a new object from a server class, however, I use this call to create the new object on the server and then attempt to register it with the rmiregistry before passing the remote reference
-
Global Messages are not being shown ??
After an action, I am adding a global message to inform the user it was successful as such: String message = "Successfully created ticket. ID# " + id; FacesContext.getCurrentInstance().addMessage(null,new FacesMessage(FacesMessage.SE
-
How to get the empty column in the reports
Hi All, i am having a requirement where i need to create the gap of one column after every quarter column, Is this possible if let me know whats the procedure for this. will Appreciate ur suggestions. Regards KK
-
Nvidia nforce2 mpc - no graphics on boot up... please help?!
I'm not very good with computers so forgive me but I'm having a problem. I just got given a nvidia nforce2 mpc K7N2G I already have a 2400+ xp processor 512 DDR ram (brand samsung) I think I've installed everything correctly but on boot up I can't se