Attach eventlisteners to dynamic movieclips and pass a variable.
Hi there,
I have a mc (changeColorMc) and three movieclips. The three
movieclips are created on the fly (so there could be more
movieclips) and filled with a color from an Array. This works fine.
Now I want to add an eventlistener for each movieclip, so
when someone push one of the movieclips the movieclip with the name
"changeColorMc" gets that same color from the colorArray.
My question is: How can I pass the color value from the
colorArray to the buttonPressed function? Is this possible?
I was also thinking that I had to create three buttonPressed
functions ie. buttonPressed1, buttonPressed2 and buttonPressed3 and
attach these to the created movieclips.. but how? Because I don't
know up front how many movieclips there will be..
Thanks Peter.
My code:
Frankly, I am yet to see any piece of code that could be
considered perfect and the only way to deal with a task. There are
so many dependencies that what looks perfect today may turn out to
be a total failure tomorrow and vise versa.
My question about better way was purely conceptual. What
would be the perfect code if it was written in English?
Congratulations on purchasing Moock's book. So far I think it
is the best single piece about AS3. I am sure you will be up to
speed in no time.
Similar Messages
-
Virtual KF(as Date) in Cube and pass the variable value to this VKF runtime
Hi ,
User would enter 1 date using date variable untime.
My cube also has 1 Completed Date (KF).
And i wann do comparisan based on input variable and exisitng variable.
Can i add 1 Virtual KF(as Date) in Cube and pass the variable value to this VKF runtime and do the calculation in cube ???
I know the same thing i can do in formula , but i have some different req.which i am unable to explain u here .
So please let me know can i use VKF if yes how ???
Points would be thrown for all .
Bapuit's the exact posting from your last post. Please don't duplicate the postings, so that we can help you in one thread and not so many different threads
-
Resetting movieclip between levels and passing required variables
Hi there,
I'm currently working on my first flash game and have managed to near enough get everything working...
I can play each level individually by manually changing the variable 'level =' (to whichever level I want to play) in the actionscript..
Now i need to find out the correct way to reset the movie after each level but still pass the 'currentTime' Timer variable and the 'level' variable over...
Is there any usual practice way of doing this ??
Would I use variables I have saved in the init() function...
I really hope someone can help I'm so close to being finished..OK this is what I have done.. all the eventListeners from my function Main() copied into the levelEnd() function... is this reammy good practise ?? Is there not a way I can just call Main() again :-
function levelEnd(event:Event):void {
gamePage = new GamePage;
removeChildAt(0);
addChildAt(gamePage, 0);
mainTimer.start();
//Is this in between really good practice ??
gamePage.helpIcons.visible = false;
gamePage.help_txt.text = "Passez la souris sur les indices à droite pour connaître leur signification.";
var persoArray:Array = [gamePage.a1, gamePage.a2, gamePage.a3, gamePage.a4, gamePage.a5];
var animalArray:Array = [gamePage.b1, gamePage.b2, gamePage.b3, gamePage.b4, gamePage.b5];
var persoHitArray:Array = [gamePage.h1, gamePage.h2, gamePage.h3, gamePage.h4, gamePage.h5];
var animalHitArray:Array = [gamePage.h6, gamePage.h7, gamePage.h8, gamePage.h9, gamePage.h10];
function addPersoListeners():void {
for(var i:uint = 0; i < persoArray.length; i++) {
(persoArray[i]).addEventListener(MouseEvent.MOUSE_DOWN,persoMouseDown);
(persoArray[i]).addEventListener(MouseEvent.MOUSE_UP,persoMouseUp);
(persoArray[i]).buttonMode = true;
function addAnimalListeners():void {
for(var i:uint = 0; i < persoArray.length; i++) {
(animalArray[i]).addEventListener(MouseEvent.MOUSE_DOWN,animalMouseDown);
(animalArray[i]).addEventListener(MouseEvent.MOUSE_UP,animalMouseUp);
(animalArray[i]).buttonMode = true;
function persoHitAreaListeners():void {
for(var i:uint = 0; i < persoHitArray.length; i++) {
(persoHitArray[i]).visible = false;
function animalHitAreaListeners():void {
for(var i:uint = 0; i < animalHitArray.length; i++) {
(animalHitArray[i]).visible = false;
addPersoListeners();
addAnimalListeners();
persoHitAreaListeners();
animalHitAreaListeners();
//Add event listeners
buttons.rulesButton.addEventListener(MouseEvent.CLICK,onRulesButtonClick);
buttons.startGameButton.addEventListener(MouseEvent.CLICK,onStartGameButtonClick);
buttons.highScoresButton.addEventListener(MouseEvent.CLICK,onHighScoresButtonClick);
buttons.infoButton.addEventListener(MouseEvent.CLICK,onInfoButtonClick);
mainTimer.addEventListener(TimerEvent.TIMER, incrementCounter);
countdownTimer.addEventListener(TimerEvent.TIMER_COMPLETE, levelEnd);
gamePage.validerButton.addEventListener(MouseEvent.CLICK,onValiderButtonClick);
gamePage.recommencerButton.addEventListener(MouseEvent.CLICK,onRecommencerButtonClick);
gamePage.infoBox.l1i1.addEventListener(MouseEvent.MOUSE_OVER,l1i1MouseOver);
gamePage.infoBox.l1i1.addEventListener(MouseEvent.MOUSE_OUT,l1i1MouseOut);
gamePage.infoBox.l1i2.addEventListener(MouseEvent.MOUSE_OVER,l1i2MouseOver);
gamePage.infoBox.l1i2.addEventListener(MouseEvent.MOUSE_OUT,l1i2MouseOut);
if(level == 1) {
gamePage.difficulty.difficultyIndicator.scaleY = .01;
gamePage.house1.visible = false;
gamePage.house5.visible = false;
gamePage.a4.visible = false;
gamePage.a5.visible = false;
gamePage.b1.visible = false;
gamePage.b2.visible = false;
gamePage.b3.visible = false;
gamePage.b4.visible = false;
gamePage.b5.visible = false;
mainTimer.start();
} else if(level == 11) {
gamePage.difficulty.difficultyIndicator.scaleY = .11;
gamePage.house1.visible = false;
gamePage.house5.visible = false;
gamePage.a4.visible = false;
gamePage.a5.visible = false;
gamePage.b1.visible = false;
gamePage.b2.visible = false;
gamePage.b3.visible = false;
gamePage.b4.visible = false;
gamePage.b5.visible = false;
} else if(level == 21) {
gamePage.difficulty.difficultyIndicator.scaleY = .21;
gamePage.house1.visible = false;
gamePage.house5.visible = false;
gamePage.a4.visible = false;
gamePage.a5.visible = false;
gamePage.b4.visible = false;
gamePage.b5.visible = false;
} else if(level ==31) {
gamePage.difficulty.difficultyIndicator.scaleY = .31;
gamePage.house1.visible = false;
gamePage.house5.visible = false;
gamePage.a4.visible = false;
gamePage.a5.visible = false;
gamePage.b4.visible = false;
gamePage.b5.visible = false;
} else if(level == 41) {
gamePage.difficulty.difficultyIndicator.scaleY = .41;
gamePage.house1.visible = false;
gamePage.house5.visible = true;
gamePage.a5.visible = false;
gamePage.b1.visible = false;
gamePage.b2.visible = false;
gamePage.b3.visible = false;
gamePage.b4.visible = false;
gamePage.b5.visible = false;
} else if(level == 51) {
gamePage.difficulty.difficultyIndicator.scaleY = .51;
gamePage.house1.visible = true;
gamePage.house5.visible = true;
} else if(level == 61) {
gamePage.difficulty.difficultyIndicator.scaleY = .61;
gamePage.house1.visible = true;
gamePage.house5.visible = true;
} else if(level == 71) {
gamePage.difficulty.difficultyIndicator.scaleY = .71;
gamePage.house1.visible = true;
gamePage.house5.visible = true; -
JS popup and passing URL variables or ?
Hi ...
The following JS script opens a new window and that window is
a template called "viewer.cfm". The images are all going to shown
in that template (viewer.cfm) ... eg: HPIM0877.JPG, HPIM1009.JPG
I have to pass variables from any pages that have the
following link (below) to "viewer.cfm".
I will have maybe 40 images to deal with but I am getting
stuck on a universal #variable# to display the images and passing
them.
I have not included any code on the receiving template
"viewer.cfm" as I am a little stuck.
Thanks ...
EXAMPLE
<cfoutput><A HREF="javascript:void(0)"
onclick="window.open('viewer.cfm?#HPIM0877.JPG#',
'welcome','width=580,height=440,menubar=no,status=no')">
courses</A></cfoutput>On the template with the JS pop up window. (index.cfm)
<cfset
peaks="/motorcoach/ca/images/popup/HPIM1070.JPG">
<cfoutput><A HREF="javascript:void(0)"
onclick="window.open('viewer.cfm?image=#peaks#',
'welcome','width=650,height=500,menubar=no,status=no')">
peaks</A></cfoutput>
On the template which will produce the image (viewer.cfm)
<cfparam name="url.image" default="0">
<cfoutput><IMG SRC="#url.image#" width="550"
height="413" class="image"></cfoutput>
Cheers -
Dynamic MovieClip and TextField
Hi, I'm begginer in as3, and I want to ask you my problem.
I'm creating a lot of MovieClip in for cicle, and i want to add at every MovieClip a textField.
I try in this way
for (var i:int = 0; i < 100; i++)
var giorno:MovieClip;
giorno = new MovieClip();
giorno.graphics.beginFill(Math.random() * 0xFFFFFF);
giorno.graphics.drawRect(i*(boxWidth+boxMargin), 0, boxWidth, boxWidth);
var nameGiorno:String = "giorno" + String(i);
giorno.name = nameGiorno;
giorno.alpha = 0.6;
var numGiorno:TextField = new TextField();
numGiorno.text = String(i);
giorno.addChild(numGiorno);
addChild(giorno);
but the textfield is only in the first movieclip.
Somebody can help me?
Thank a lot !!!yes, but i'dont find the error. under i post the code entirely
package
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import caurina.transitions.Tweener;
import flash.text.TextField;
public class Main extends Sprite
private const boxCount:int = 10;
private const boxCount_ok:int = 365;
private const boxWidth:int = 300;
private const boxMargin:int = 0;
private const startPoint:int = 50;
private const boxesWidth:int = boxCount * (boxWidth + boxMargin);
private const endPoint:int = boxesWidth + startPoint;
private const zeroPoint:int = stage.stageWidth / 2 + startPoint;
private var container:MovieClip;
private var targetX:Number;
private var speed:Number = 0;
public function Main():void
if (stage) init();
else addEventListener(Event.ADDED_TO_STAGE, init);
private function init(e:Event = null):void
removeEventListener(Event.ADDED_TO_STAGE, init);
container = new MovieClip();
addChild(container);
container.x = 150;
container.y = 0;
for (var i:int = 0; i < boxCount_ok; i++)
var giorno:MovieClip;
giorno = new MovieClip();
giorno.graphics.beginFill(Math.random() * 0xFFFFFF);
giorno.graphics.drawRect(i*(boxWidth+boxMargin), 0, boxWidth, boxWidth);
var ok:String = "giorno" + String(i);
giorno.name = ok;
giorno.alpha = 0.6;
var numGiorno:TextField = new TextField();
numGiorno.text = String(i);
//trace(giorno.name);
giorno.addChild(numGiorno);
giorno.addEventListener(MouseEvent.MOUSE_OVER, illumina);
giorno.addEventListener(MouseEvent.MOUSE_OUT, spegni);
giorno.addEventListener(MouseEvent.CLICK, tracciaNome);
function tracciaNome(e:MouseEvent):void{
//Per tracciare il nome del MovieClip corrente sul quale si applica l' evento
//bisogna usare il nome della variabile evento della funziona (e:MouseEvent)
//e applicare la funzione currentTarget
trace(e.currentTarget.name);
function illumina(e:MouseEvent):void{
Tweener.addTween(e.currentTarget, {alpha:1, time:1});
function spegni(e:MouseEvent):void{
Tweener.addTween(e.currentTarget, {alpha:0.6, time:0.5});
container.addChild(giorno);
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
private function mouseMoveHandler(e:MouseEvent):void
var distanceFromCenter:int = stage.mouseX - zeroPoint;
speed = distanceFromCenter * -0.05; // Bring number into a good range, and invert it.
private function enterFrameHandler(e:Event):void
container.x += speed;
Thank a lot! -
How can I pass a variable to an applet in JSP?
I want to invoke an Applet in JSP and pass a variable( ie. port) to the Applet. I do as follows:
<applet code="best.Applet1.class" width=400 height=300 >
<param name=port1 value=port>
</applet>
in Applet1.java , I use getParameter("port1"),yet I got character string "port" ,not the value of port(i.e. 100).
How can I get 100 not "port"? Thanks!!!Assuming that port is a variable defined and initailized in the jsp:
<applet code="best.Applet1.class" width=400 height=300 >
<param name=port1 value=<%= port %>>
</applet> -
Error while Passing shell variable into exec UTL_MAIL.SEND
Hello,
I am new in shell scripting, please help me to rectify, whats wrong in my code.
login='system/manager'
code=`
sqlplus -s $login <<EOF
set heading off
SELECT tablespace_name,(SUM(bytes/1024/1024)) FROM dba_free_space WHERE tablespace_name IN ('PIN00','PINX00','SYSTEM','SYSAUX','UNDOTBS1','STATSPACK') GROUP BY tablespace_name;
EOF`
exec UTL_MAIL.SEND(sender=>'[email protected]', recipients=>'[email protected]', cc =>'[email protected]' , subject=>'$ORACLE_SID BACKUP', message =>'$code')
exit;
EOF
echo "sqlplus exited"
ERROR:
ORA-01756: quoted string not properly terminated
SP2-0734: unknown command beginning "SYSTEM ..." - rest of line ignored.
SP2-0734: unknown command beginning "PIN00 ..." - rest of line ignored.
SP2-0734: unknown command beginning "PINX00 ..." - rest of line ignored.
SP2-0734: unknown command beginning "SYSAUX ..." - rest of line ignored.
SP2-0044: For a list of known commands enter HELP
and to leave enter EXIT.
Edited by: 929236 on Apr 21, 2012 12:46 AM
Edited by: 929236 on Apr 21, 2012 12:48 AMHello,
Thanks for your review.
But please look into below output i am getting after running below code
ORACLE_BASE=/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0.4/db_1; export ORACLE_HOME
ORACLE_SID=pindb; export ORACLE_SID
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
login='system/manager'
code=`
sqlplus -s $login <<EOF
set heading off
set feedback off
SELECT tablespace_name,(SUM(bytes/1024/1024)) FROM dba_free_space WHERE tablespace_name IN ('PIN00','PINX00','SYSTEM','SYSAUX','UNDOTBS1','STATSPACK') GROUP BY tablespace_name;
exit`
output:
PIN00 28287.1172 PINX00 93813.1367 STATSPACK 54.1875 SYSAUX 215.125 SYSTEM .1015625 UNDOTBS1 745.8125 6 rows selected.
Here its working very fine but when i am passing code variable to utl_mail.send procedure, its giving error same as i mentioned previous. I have put all the environment variable as well. But when i put utl_mail.send and pass CODE variable into it it gives error.
ORACLE_BASE=/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0.4/db_1; export ORACLE_HOME
ORACLE_SID=pindb; export ORACLE_SID
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
login='system/manager'
code=`
sqlplus -s $login <<EOF
set heading off
set feedback off
SELECT tablespace_name,(SUM(bytes/1024/1024)) FROM dba_free_space WHERE tablespace_name IN ('PIN00','PINX00','SYSTEM','SYSAUX','UNDOTBS1','STATSPACK') GROUP BY tablespace_name;
exit`
$ORACLE_HOME/bin/sqlplus -s /nolog << EOF
connect / as sysdba
exec UTL_MAIL.SEND(sender=>'[email protected]', recipients=>'[email protected]', cc =>'[email protected]' , subject=>'$ORACLE_SID BACKUP', message =>'$code')
exit;
EOF
echo "sqlplus exited"
ERROR:
ORA-01756: quoted string not properly terminated
SP2-0734: unknown command beginning "PIN00 ..." - rest of line ignored.
SP2-0734: unknown command beginning "PINX00 ..." - rest of line ignored.
SP2-0734: unknown command beginning "STATSPACK ..." - rest of line ignored.
SP2-0734: unknown command beginning "SYSAUX ..." - rest of line ignored.
SP2-0044: For a list of known commands enter HELP
and to leave enter EXIT.
SP2-0734: unknown command beginning "SYSTEM ..." - rest of line ignored.
SP2-0734: unknown command beginning "UNDOTBS1 ..." - rest of line ignored.
sqlplus exited
Thanks,
Ashish
Edited by: user13271251 on Apr 22, 2012 11:49 PM -
How to pass characterstic variable value using button in sap wad
Hello Gurus,
I have one requirement in WAD 7.0.i have made one user input characterstic variable in Bex i.e on 0calmonth.Now i have passed the same variable in WAD drop down button.Now suppose based on the logic on that variable which i have made in bex is like when i select 04.2010 in drop down button it dispalys data for next three months.
Now my user wants same thing to be displayed with the help of button as well. I need to make two buttons one for previous month and other for next month.I made two button using button group and passed that variable also but data is not changing.
How to get the desired output using buttons.
I want two buttons like this <<(previous) >>(next) and i want to pass that same variable which i passed in drop down button and when i press previous button it should display last month data and when i press next it should display next month data.
How to achieve this in WAD with the help of buttons.Give me your useful suggestions.
Hope my requirement is clear.
Thanks in advance
Regards,
ALNeed your valuable suggestions on this...
-
Getting an "undefined" error when passing a variable to a function using Microsoft Razor
I am trying to call a function and pass a variable to it. However I get an "undefined" error.
The code is:
Layout = "~/_SiteLayout.cshtml";
Page.Title = "General Information";
var recID = 3;
<input type="text" id="rdy">
<p>
<a href=""><input type="button" name="button" id="button" value="Next Hypothetical" onclick='reselectState(recID)'></a>
</p>
<script>
function reselectState(recIDx)
var elem = document.getElementById("rdy");
elem.value = recIDx;
var rdy = $("#rdy").val();
alert(rdy);
location.href = '/hypothetical.cshtml?recordkey=' + rdy;
</script>
It seems to think that the variable "recID" is undefined even though it exists and I assign a value to it.Michael,
Let me ask you this ... Are you trying to pass the value of the Input value? If you are looking for the input value to be .. then I made some changes you can follow...
var recId = 3;
<input type="text" id="rdy">
<p>
<a href="">@*<input type="button" name="button" id="button" value="Next Hypothetical" onclick='reselectState(recId)'>*@</a>
<input type="button" name="button" id="button" value="Next Hypothetical" onclick='test()' />
</p>
<script>
function test() {
var inputValue = document.getElementById("rdy").value;
reselectState(inputValue);
function reselectState(recIDx) {
var elem = document.getElementById("rdy");
elem.value = recIDx;
var rdy = $("#rdy").val();
alert(rdy);
location.href = '/hypothetical.cshtml?recordkey=' + rdy;
</script>
--Thanks,
Pavan -
How to pass values in dynamic structure and then dynamic table
Hi,
we have a Z structure in se11 holding 10 fields. But at run time i need to create a dynamic table with more than 10 records.
I am able to create the structure and corresponding internal table. Now the issue is i have to populate this dynamic structure with some values and then append it to dynamic internal table. Since the dynamic table type is any its not allowing an index operation like modify etc etc.
Could anyone help me in passing the values . I have searched in SDN . everyone created a dynamic table and then populated it values from some standard or custom tables.Then assigning the component of structure and displaying the output. but in my situation i have no such values stored in any tables. i populate values based on certain calculation.Hi Friends,
This is the piece of code.After creating dynamic work area and dynamic table what i should do?
TYPES: BEGIN OF STR,
ID TYPE I,
NAME(30) TYPE C,
END OF STR.
data: v_lines type i.
STR_TYPE ?= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_NAME( 'STR' ).
STR_COMP = STR_TYPE->GET_COMPONENTS( ).
APPEND LINES OF STR_COMP TO COMP_TAB.
COMP-NAME = 'NAME1'.
COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
APPEND COMP TO COMP_TAB.
COMP-NAME = 'VALUE1'.
COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
APPEND COMP TO COMP_TAB.
COMP-NAME = 'NAME2'.
COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
APPEND COMP TO COMP_TAB.
COMP-NAME = 'VALUE2'.
COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
APPEND COMP TO COMP_TAB.
COMP-NAME = 'NAME3'.
COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
APPEND COMP TO COMP_TAB.
COMP-NAME = 'VALUE3'.
COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
APPEND COMP TO COMP_TAB.
NEW_STR = CL_ABAP_STRUCTDESCR=>CREATE( COMP_TAB ).
NEW_TAB = CL_ABAP_TABLEDESCR=>CREATE(
P_LINE_TYPE = NEW_STR
P_TABLE_KIND = CL_ABAP_TABLEDESCR=>TABLEKIND_STD
P_UNIQUE = ABAP_FALSE ).
CREATE DATA DREF TYPE HANDLE NEW_TAB.
CREATE DATA DREF1 TYPE HANDLE NEW_str. -
Dynamic text and animated masking problem?
Hi
Can anyone suggest to me what might be happening here. I will
try and explain step by step... I am using flash MX
I have dynamically created a movieclip which I want to mask -
_root.createEmptyMovieClip("myMovie", 1);
I dynamically add a movieclip into it which I then load a jpg
into -
_root.myMovie.createEmptyMovieClip("image1", 0);
_root.myMovie.image1.createEmptyMovieClip("newFile", 0);
_root.myMovie.image1.newFile.loadMovie("http:...");
I dynamically create another movieclip called myNormalText1
insde the first movie -
_root.myMovie.createEmptyMovieClip("myNormalText1", 2);
this holds a dynamically created text box called mytext -
_root.myMovie.myNormalText1.createTextField("mytext",1,0,0,0,10);
// the text box formating is dynamic, uses devise fonts,
arial and is red ect.
I have then attach a movieclip and use it as a mask to create
a transition effect over _root.myMovie (which holds the image and
text)
_root.attachMovie("mask","mask",5);
_root.myMovie.setMask("mask");
the mask movieclip is what is causing me the problem!!!
method one
when the mask movieclip contains this -
a phisically drawn box that fills the whole page
I use a shape tween to make the box transform into a thin
rectangle down the left hand side of the screen
I get a transition effect which makes _root.mymovie disapear
to the left which is what I want!
The image and text are masked correctly!
*** Please note I am aware that dynamic text boxes using
devise fonts are not displayed correctly under a mask layor when
they are not embeded, in flash MX. I am able to view my movie in a
browser window which uses flash player 8 that now allows dynamic
devise fonts to be masked!
method two
I then wanted to create a different transition effect like
venitian blinds,
so, in my mask movieclip I created several rectangles that
fill the page
again I used a shape tween so they get thinner,
when I tested my movie the same way in the browser,
the mask did not work correctly over my text in
_root.mymovie???
yet the image in _root.mymovie was masked correctly???
the only differance between the two methods is the shape
tween in method one uses one box shape, and the shape tween in
method two uses several rectangler box shapes.
I was wondering if anyone knows why the text is correctly
masked in case one and is not correctly masked in case 2
I want to do other transition effects using masks in this way
and I am having no luck :-(
Thanks for any advice
Claire WallHi
I have been researching this ALOT and found some info that
basically tells me when I use setMask() over dynamic device fonts,
the mask uses its bounding box (the rectangular outside edge of the
whole mask movieclip) as the mask.
In case 1 the mask moviclips bounding box shrinks when the
shape tween plays because there is one rectangular box being
tweened. It appears to mask the text correctly.
In case 2 I have variouse different shape tweens going on
inside the mask movieclip so the bounding box stays the same size
across the whole screen and it wont appear to mask my text
correctly.
I think I have answered my own question, but this still
leaves me stuck! I want to create this venitian blind effect using
masks over devise fonts.
I came up with the idea of using for example 4 different
masks over the one movieclip but again flash doesnt like this and I
guess I can only use one setMask() per movieclip?
Can anyone suggest a way I can use multiple dynamically
created masks on one movieclip or cant it be done?
Thanks
Claire x -
I want need to use dynamic SQL, and include a subquery in the where clause. However, I am getting a syntax error.
I have code that looks like this.
SELECT (p_v_sqlobj_select)
INTO CORRESPONDING FIELDS OF TABLE <matrix>
FROM (p_v_sqlobj_from)
WHERE (p_v_sqlobj_where).
and I pass it the following bold-faced SQL where clause (please ignore whether the statement makes sense and is the best way to do it - this is just to illustrate). However, it returns an error.
select tcode from tstc where tcode in <b>( select min( tcode ) as min from tstc )</b>
Am I correct in concluding that I cannot pass complex statements, or have I just missed something?
Thanks for any help.Hi,
Please try with order by clause in select statement and also use descending
select * from (p_table)
into corresponding fields of table <ptab>
up to p_rows rows
order by <fieldname> descending.
aRs -
Issues in persisting dynamic entity and view objects using MDS
Hi All,
I'm trying to create dynamic entity and view objects per user session and to persist these objects throughout the session, I'm trying to use MDS configurations(either file or Database) in adf-config.xml.
I'm facing following two errors while trying to run the app module:
1. MDS error (MetadataNotFoundException): MDS-00013: no metadata found for metadata object "/model/DynamicEntityGenModuleOperations.xml"
2. oracle.mds.exception.ReadOnlyStoreException: MDS-01273: The operation on the resource /sessiondef/dynamic/DynamicDeptEntityDef.xml failed because source metadata store mapped to the namespace / DEFAULT is read only.
I've gone through the following links which talks about the cause of the issue, but still can't figure out the issue in the code or the config file. Please help if, someone has faced a similar issue.
[http://docs.oracle.com/cd/E28271_01/doc.1111/e25450/mds_trouble.htm#BABIAGBG |http://docs.oracle.com/cd/E28271_01/doc.1111/e25450/mds_trouble.htm#BABIAGBG ]
[http://docs.oracle.com/cd/E16162_01/core.1112/e22506/chapter_mds_messages.htm|http://docs.oracle.com/cd/E16162_01/core.1112/e22506/chapter_mds_messages.htm]
Attached is the code for dynamic entity/view object generation and corresponding adf-config.xml used.
///////////App Module Implementation Class/////////////////////////
public class DynamicEntityGenModuleImpl extends ApplicationModuleImpl implements DynamicEntityGenModule {
private static final String DYNAMIC_DETP_VO_INSTANCE = "DynamicDeptVO";
* This is the default constructor (do not remove).
public DynamicEntityGenModuleImpl() {
public ViewObjectImpl getDepartmentsView1() {
return (ViewObjectImpl) findViewObject("DynamicDeptVO");
public void buildDynamicDeptComp() {
ViewObject internalDynamicVO = findViewObject(DYNAMIC_DETP_VO_INSTANCE);
if (internalDynamicVO != null) {
System.out.println("OK VO exists, return Defn- " + internalDynamicVO.getDefFullName());
return;
EntityDefImpl deptEntDef = buildDeptEntitySessionDef();
ViewDefImpl viewDef = buildDeptViewSessionDef(deptEntDef);
addViewToPdefApplicationModule(viewDef);
private EntityDefImpl buildDeptEntitySessionDef() {
try {
EntityDefImpl entDef = new EntityDefImpl(oracle.jbo.server.EntityDefImpl.DEF_SCOPE_SESSION, "DynamicDeptEntityDef");
entDef.setFullName(entDef.getBasePackage() + ".dynamic." + entDef.getName());
entDef.setName(entDef.getName());
System.out.println("Application Module Path name: " + getDefFullName());
System.out.println("EntDef :" + entDef.getFileName() + " : " + entDef.getBasePackage() + ".dynamic." + entDef.getName());
entDef.setAliasName(entDef.getName());
entDef.setSource("DEPT");
entDef.setSourceType("table");
entDef.addAttribute("ID", "ID", Integer.class, true, false, true);
entDef.addAttribute("Name", "NAME", String.class, false, false, true);
entDef.addAttribute("Location", "LOCATION", Integer.class, false, false, true);
entDef.resolveDefObject();
entDef.registerSessionDefObject();
entDef.writeXMLContents();
entDef.saveXMLContents();
return entDef;
} catch (Exception ex) {
System.out.println(ex.getLocalizedMessage());
return null;
private ViewDefImpl buildDeptViewSessionDef(EntityDefImpl entityDef) {
try {
ViewDefImpl viewDef = new oracle.jbo.server.ViewDefImpl(oracle.jbo.server.ViewDefImpl.DEF_SCOPE_SESSION, "DynamicDeptViewDef");
viewDef.setFullName(viewDef.getBasePackage() + ".dynamic." + viewDef.getName());
System.out.println("ViewDef :" + viewDef.getFileName());
viewDef.setUseGlueCode(false);
viewDef.setIterMode(RowIterator.ITER_MODE_LAST_PAGE_FULL);
viewDef.setBindingStyle(SQLBuilder.BINDING_STYLE_ORACLE_NAME);
viewDef.setSelectClauseFlags(ViewDefImpl.CLAUSE_GENERATE_RT);
viewDef.setFromClauseFlags(ViewDefImpl.CLAUSE_GENERATE_RT);
viewDef.addEntityUsage("DynamicDeptUsage", entityDef.getFullName(), false, false);
viewDef.addAllEntityAttributes("DynamicDeptUsage");
viewDef.resolveDefObject();
viewDef.registerSessionDefObject();
viewDef.writeXMLContents();
viewDef.saveXMLContents();
return viewDef;
} catch (Exception ex) {
System.out.println(ex.getLocalizedMessage());
return null;
private void addViewToPdefApplicationModule(ViewDefImpl viewDef) {
oracle.jbo.server.PDefApplicationModule pDefAM = oracle.jbo.server.PDefApplicationModule.findDefObject(getDefFullName());
if (pDefAM == null) {
pDefAM = new oracle.jbo.server.PDefApplicationModule();
pDefAM.setFullName(getDefFullName());
pDefAM.setEditable(true);
pDefAM.createViewObject(DYNAMIC_DETP_VO_INSTANCE, viewDef.getFullName());
pDefAM.applyPersonalization(this);
pDefAM.writeXMLContents();
pDefAM.saveXMLContents();
////////adf-config.xml//////////////////////
<?xml version="1.0" encoding="windows-1252" ?>
<adf-config xmlns="http://xmlns.oracle.com/adf/config" xmlns:config="http://xmlns.oracle.com/bc4j/configuration" xmlns:adf="http://xmlns.oracle.com/adf/config/properties"
xmlns:sec="http://xmlns.oracle.com/adf/security/config">
<adf-adfm-config xmlns="http://xmlns.oracle.com/adfm/config">
<defaults useBindVarsForViewCriteriaLiterals="true"/>
<startup>
<amconfig-overrides>
<config:Database jbo.locking.mode="optimistic"/>
</amconfig-overrides>
</startup>
</adf-adfm-config>
<adf:adf-properties-child xmlns="http://xmlns.oracle.com/adf/config/properties">
<adf-property name="adfAppUID" value="TestDynamicEC-8827"/>
</adf:adf-properties-child>
<sec:adf-security-child xmlns="http://xmlns.oracle.com/adf/security/config">
<CredentialStoreContext credentialStoreClass="oracle.adf.share.security.providers.jps.CSFCredentialStore" credentialStoreLocation="../../src/META-INF/jps-config.xml"/>
</sec:adf-security-child>
<persistence-config>
<metadata-namespaces>
<namespace metadata-store-usage="mdsRepos" path="/sessiondef/"/>
<namespace path="/model/" metadata-store-usage="mdsRepos"/>
</metadata-namespaces>
<metadata-store-usages>
<metadata-store-usage default-cust-store="true" deploy-target="true" id="mdsRepos">
<metadata-store class-name="oracle.mds.persistence.stores.file.FileMetadataStore">
<property name="metadata-path" value="/tmp"/>
<!-- <metadata-store class-name="oracle.mds.persistence.stores.db.DBMetadataStore">
<property name="jndi-datasource" value="jdbc/TestDynamicEC"/>
<property name="repository-name" value="TestDynamicEC"/>
<property name="jdbc-userid" value="adfmay28"/>
<property name="jdbc-password" value="adfmay28"/>
<property name="jdbc-url" value="jdbc:oracle:thin:@localhost:1521:XE"/>-->
</metadata-store>
</metadata-store-usage>
</metadata-store-usages>
</persistence-config>
</adf-config>
//////////////////////////////////////////////////////////////////////////////////////////////////////////Hi Frank,
I m trying to save entity and view object xml by calling writeXMLContents() and saveXMLContents() so that these objects can be retrieved using the xmls later on.
These methods internally use MDS configuration in adf-config.xml, which is creating the issue.
Please share your thoughts on resolving this or if, there is any other way of creating dynamic entity/view objects for db tables created at runtime.
Nik -
I have a number of test systems that use a parallel model with labview. We have a good number of instruments(PXI).
What is the prefered method for open,closing and passing instrument handles in teststand using labview?
Solved!
Go to Solution.Hi,
No, Below is a bit from the Session Manager Help
Currently, Session Manager supports the following instrument session types:
IVI Sessions—Use an IVI session to obtain the C-based instance handle for an IVI logical or virtual instrument name. NI Session Manager does not support IVI-COM drivers at this time. When IVI-COM drivers are available, you can use an IVI session to obtain an ActiveX interface reference to an IVI-COM driver.
VXIplug&play Sessions—Use a VXIplug&play session to obtain a C-based instance handle for a VXIplug&play logical or virtual instrument name. Configure VXIplug&play names in the <VXIplug&play directory>\<Platform directory>\NISessionMgr.ini file.
VISA Sessions—Use a VISA instrument session to obtain a C-based viSession handle to a VISA resource or logical name. Configure VISA logical names in the <VXIplug&play directory>\<Platform directory>\NISessionMgr.ini file.
Custom Sessions—Use a custom session to create a data container object that shares ActiveX objects you create or other data between software components you write. Use the Attach and Get methods to attach data to and retrieve data from a session. A custom session does not initialize, close, or own an instrument handle. The data you share with a custom session does not have to be instrumentation related. You can create a custom session with any name you request.
Regards
Ray Farmer
Regards
Ray Farmer -
Problem in tabular form based on dynamic view and pagination
Hi All,
I have a manual tabular form based on a dynamic view. The view fetches the records based on search criteria given by the user in all cases. But this view fetches ALL records when user clicks on pagination, without considering the search criteria. This is the problem I am facing.
I am doing the following:
Since tabular form does not support pl/sql function returning query, I cannot use a table directly. I need my results based on search criteria selected by user. Hence I created a dynamic view and used a "INSTEAD OF UPDATE" trigger to update the table.
I use a set bind variables procedure, on load before header for setting the variables.
This view fetches the correct data based on user search always. It creates a problem only in one situation, when using pagination in the report.
The example can be found at:
http://apex.oracle.com/pls/otn/f?p=19399:1:
username = [email protected]
pwd = kishore
Here if "manager name" is entered as test, we get 5 records in "Summary of requests" report and 5 records in "Inactive Requests" report. When user clicks on Pagination in any of the reports, ALL the 7 records get fetched in "Summary of Requests" and 6 records in "Inactive Requests". How can I overcome this problem?? The report must consider the search variables even when pagination occurs.
Is this because, the inbuilt "html_PPR_Report_Page" executes the region query once again by considering all search variables as NULL?
Backend Code is at:
http://apex.oracle.com/pls/otn/
workspace: sekhar.nooney
Username :[email protected]
pwd: kishore
application id = 19399
My region code is something like:
select *
from regadm_request_v
where access_type = :F110_REGADM
and status <> 'INACTIVE'
order by request_id
My view code is:
CREATE OR REPLACE VIEW REGADM_REQUEST_V
AS
SELECT *
FROM REGREGOWNER.REGADM_REQUEST
WHERE upper(employee_name) LIKE '%'||nvl(upper(REGADM_REQUEST_PKG.GET_EMPLOYEE_NAME),'%')||'%'
AND upper(manager_name) LIKE '%'||nvl(upper(REGADM_REQUEST_PKG.GET_MANAGER_NAME),'%')||'%'
AND upper(employee_sunetid) LIKE '%'||nvl(upper(REGADM_REQUEST_PKG.GET_EMPLOYEE_SUNET_ID),'%')||'%'
AND upper(manager_sunetid) LIKE '%'||nvl(upper(REGADM_REQUEST_PKG.GET_MANAGER_SUNET_ID),'%')||'%'
AND upper(request_date) LIKE '%'||nvl(upper(REGADM_REQUEST_PKG.GET_REQUEST_DATE),'%')||'%'
AND upper(USAGE_AGREEMENT_RECVD) LIKE '%'||nvl(upper(DECODE(REGADM_REQUEST_PKG.GET_USAGE_AGREMNT_RECVD,'~!@',NULL,REGADM_REQUEST_PKG.GET_USAGE_AGREMNT_RECVD)),'%')||'%'
AND upper(STATUS) LIKE '%'||nvl(upper(DECODE(REGADM_REQUEST_PKG.GET_STATUS,'~!@',NULL,REGADM_REQUEST_PKG.GET_STATUS)),'%')||'%'
AND upper(REQUEST_APPROVED) LIKE '%'||nvl(upper(DECODE(REGADM_REQUEST_PKG.GET_REQUEST_APPROVED,'~!@',NULL,REGADM_REQUEST_PKG.GET_REQUEST_APPROVED)),'%')||'%'
AND upper(nvl(APPROVAL_DATE,sysdate)) LIKE '%'||nvl(upper(REGADM_REQUEST_PKG.GET_APPROVED_DATE),'%')||'%'
AND upper(APRVL_REQUEST_SENT) LIKE '%'||nvl(upper(DECODE(REGADM_REQUEST_PKG.GET_EMAIL_APPROVERS,'~!@',NULL,REGADM_REQUEST_PKG.GET_EMAIL_APPROVERS)),'%')||'%'
AND upper(NOTIFY_APPROVED) LIKE '%'||nvl(upper(DECODE(REGADM_REQUEST_PKG.GET_APPROVAL_NOTIFICATION,'~!@',NULL,REGADM_REQUEST_PKG.GET_APPROVAL_NOTIFICATION)),'%')||'%'
I would be glad for any suggestions.
Andy/Varad any ideas? You both helped me a lot on my problems for the same application that I had faced before in More Problems in Tabular form - Please give me suggestions.
Thanks,
SumanaHi Andy,
The view and the package for setting bind variables work properly in my entire application other than the pagination. A pity that I came across this only now :(
I have used this same method for holding variables in another application before, where I needed to print to PDF. I used this approach in the other application because my queries were not within the APEX character limit specified for the "SQL Query of Report Query shared component".
In this application, I initially had to fetch values from 2 tables and update the 2 tables. Updateable form works only with one table right? Hence I had created a view. Later the design got changed to include search and instead of changing the application design I just changed the view then. Still later, my clients merged the 2 tables. Once again I had just changed my view.
Now, I wanted to know if any method was available for the pagination issue (using the view itself). Hence I posted this.
But as you suggested, I think it is better to change the page design quickly (as it would be much easier).
If I change the region query to use the table and the APEX bind parameters in the where clause as:
SELECT *
FROM REGADM_REQUEST
WHERE upper(employee_name) LIKE '%'||nvl(upper(:P1_EMPLOYEE_NAME),'%')||'%' .....
I also changed the ApplyMRU to refer to the table.
Here the pagination issue is resolved. But here the "last Update By" and "Last Update Date" columns do not get updated with "SYSDATE" and "v(APP_USER)" values, when update takes place. Even if I make the columns as readonly text field, I am not sure how I can ensure that SYSDATE and v('APP_uSER') can be passed to the columns. Any way I can ensure this? Please have a look at the issue here: http://apex.oracle.com/pls/otn/f?p=19399:1:
I have currently resolved the "last update" column issue by modifying my view as:
CREATE OR REPLACE VIEW REGADM_REQUEST_V
AS
SELECT *
FROM REGADM_REQUEST
I modified my region query to use APEX bind parameters itself as:
SELECT *
FROM REGADM_REQUEST_V
WHERE upper(employee_name) LIKE '%'||nvl(upper(:P1_EMPLOYEE_NAME),'%')||'%' .....
And I use the "INSTEAD OF UPDATE" trigger that I had initially written for update. The code is:
CREATE OR REPLACE TRIGGER REGADM_REQUEST_UPD_TRG
INSTEAD OF UPDATE
ON REGADM_REQUEST_V
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
BEGIN
UPDATE REGREGOWNER.REGADM_REQUEST
SET MANAGER_EMAIL = :NEW.MANAGER_EMAIL
, EMPLOYEE_EMAIL = :NEW.EMPLOYEE_EMAIL
, STATUS_UPDATE_DATETIME = SYSDATE
, USER_UPDATE_ID = (SELECT v('APP_USER') FROM DUAL)
WHERE REQUEST_ID = :OLD.REQUEST_ID;
END;
Please let me know how I can resolve the "last update" column issue using the table itself. (Just for my learning)
Thanks,
Sumana
Maybe you are looking for
-
24" iMac starts with a strange screen and freezes. HELP!
My iMac froze and I restarted it. Now when I start it got weirdturquoise stuff on each side of the screen. It does show the apple logoand the loading thingy but after that they disappear it freezes againand nothing happens. Also tried booting from DV
-
Apple please read this! Fix our .mac servers! WAY TO SLOW!
This is the same problem I and many others are having. http://discussions.apple.com/thread.jspa?threadID=376118&tstart=0 We pay for your service and we have had no notification that anything is even being worked on. If this is going to continue I thi
-
Convert from v5.1 to v11
Hi, Please convert from 5.1 to 11. Thanks in advance. Gerhard Solved! Go to Solution. Attachments: pid_control_digital.llb 79 KB
-
I want to create a new field on the account object. This new field should be automatically populated based on the parent account I choose. This functionality is similar to a pick map functionality in Siebel Enterprise. I understand that there is a fu
-
System Copy of ERP 6.0 ABAP using SAPINST
Hi guys. This is a quite simple question regarding system copy. I have done this on a ABAP+JAVA and since i have to perform an only ABAP system copy, i have a doubt related copy process flow. Im aware for ABAP+JAVA systems you have to perform the exp