Adding Childs to a treeNode in "RowDisclosureListener"
Hi ,
What I want to do is to add Child Nodes to e tree Node when the user attempts to disclose it.
I've tried to do the same in "selectionListener" just for testing and its working fine.
but I need to do it in "RowDisclosureListener" .
the point is, on RowDisclosure there is no nodes selected yet and I need to make the node selected first (and that's what I don't know how to do)
JDeveloper 11.1.1.5.0
Please Advise .
Thank you
Shahab
hi,
I will explain in detail.
First step u need to create a role in pfcg say DP_PAKISTAN.
next step is role comparison and then activate the role.
then go to Bex analyser say save as a workbook under the role DP_PAKISTAN.
U can view ur saved workbook in the Bex Browser under the role or folder DP_PAKISTAN.
While transportation u need to transport the role by selecting neccessary objects in the grouping column. Make sure that all the infoproviders are transported in advance.
Hope it helps
Bhaskar
Similar Messages
-
Inconsistent results for adding child node in a JTree
I have a JTree where I add child nodes when a user clicks on the node or handle. When the user clicks on the node, through implementing TreeSelectionListener interface, I add a node, the tree expands, and I see the newly added node. However, when the user clicks on the handle, through implementing the TreeExpansionListener, the tree does not expand and I do not see the newly added node. The problem is repeatable by compiling the code below.
Why is there this difference? Aren't all the methods implemented through the TreeSelectionListener and TreeExpansionListener in the SWT thread?
public class TestFrame extends JFrame implements TreeSelectionListener, TreeExpansionListener {
public TestFrame() {
String[] alphabets = {
"a", "b", "c", "d", "e", "f", "g",
"h", "i", "j", "k", "l", "m", "n",
"o", "p", "q", "r", "s", "t", "u",
"v", "w", "x", "y", "z"
DefaultMutableTreeNode top = new DefaultMutableTreeNode("CEDICT");
for(int i=0; i < alphabets.length; i++) {
DefaultMutableTreeNode node =
new DefaultMutableTreeNode(alphabets) {
public boolean isLeaf() { return false; }
top.add(node);
JTree tree = new JTree(top);
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
tree.addTreeSelectionListener(this);
tree.addTreeExpansionListener(this);
tree.setShowsRootHandles(true);
JScrollPane treePane = new JScrollPane(tree);
treePane.setHorizontalScrollBarPolicy(
JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
treePane.setVerticalScrollBarPolicy(
JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
treePane.setSize(new Dimension(200,400));
treePane.setPreferredSize(new Dimension(200,400));
getContentPane().setLayout(new BorderLayout());
getContentPane().add(treePane, BorderLayout.CENTER);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
int inset = 50;
setBounds(inset, inset,
screenSize.width - inset*2,
screenSize.height - inset*2);
setLocationRelativeTo(null);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
pack();
show();
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
JFrame.setDefaultLookAndFeelDecorated(true);
TestFrame frame = new TestFrame();
public void valueChanged(TreeSelectionEvent e) {
JTree tree = (JTree)e.getSource();
DefaultMutableTreeNode node =
(DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
System.out.println(node);
Date date = new Date();
node.add(new DefaultMutableTreeNode(date.toString()));
public void treeCollapsed(TreeExpansionEvent event) {
JTree tree = (JTree)event.getSource();
TreePath path = event.getPath();
DefaultMutableTreeNode node =
(DefaultMutableTreeNode) path.getLastPathComponent();
System.out.println(node);
Date date = new Date();
node.add(new DefaultMutableTreeNode(date.toString()));
tree.invalidate(); //does not help to show newly added child
public void treeExpanded(TreeExpansionEvent event) {
JTree tree = (JTree)event.getSource();
TreePath path = event.getPath();
DefaultMutableTreeNode node =
(DefaultMutableTreeNode) path.getLastPathComponent();
System.out.println(node);
Date date = new Date();
node.add(new DefaultMutableTreeNode(date.toString()));
tree.invalidate(); //does not help to show newly added childI couldn't figure out why inserting a node in the valueChanged(...) method works. In all three methods no listeners are notified about the change, so you would think all three would fail.
For a JTree using the DefaultTreeModel the nodesWereInserted(...) method needs to be called. For example, if I change your last three methods to this
public void valueChanged(TreeSelectionEvent e) {
insertNode((JTree) e.getSource(),
(MutableTreeNode) e.getPath().getLastPathComponent());
public void treeCollapsed(TreeExpansionEvent event) {
insertNode((JTree) event.getSource(),
(MutableTreeNode) event.getPath().getLastPathComponent());
public void treeExpanded(final TreeExpansionEvent event) {
insertNode((JTree) event.getSource(),
(MutableTreeNode) event.getPath().getLastPathComponent());
public void insertNode(JTree tree, MutableTreeNode parent) {
Date date = new Date();
MutableTreeNode child = new DefaultMutableTreeNode(date.toString());
int index = parent.getChildCount();
parent.insert(child,index);
((DefaultTreeModel) tree.getModel())
.nodesWereInserted(parent,new int[]{index});
}then it works as you desire. You can (and should) of course use the DefaultTreeModel's own insert method.
DefaultTreeModel#insertNodeInto(MutableTreeNode,MutableTreeNode, int) -
Parent key 1393696 not found when adding child 1393727.
By posting, I received this :
An error in the system has occurred. Please contact the system administrator if the problem persists.
type: java.lang.IllegalArgumentException
java.lang.IllegalArgumentException: Parent key 1393696 not found when adding child 1393726.
at com.jivesoftware.util.LongTree.addChild(LongTree.java:99)
at com.jivesoftware.forum.database.DbTreeWalker.addChild(DbTreeWalker.java:233)
at com.jivesoftware.forum.database.DbForumThread.addMessage(DbForumThread.java:617)
at com.jivesoftware.forum.proxy.ForumThreadProxy.addMessage(ForumThreadProxy.java:145)
at com.jivesoftware.forum.action.PostAction.createMessage(PostAction.java:1083)
at com.jivesoftware.forum.action.PostAction.execute(PostAction.java:946)
at com.jivesoftware.forum.action.PostAction.doPost(PostAction.java:666)
at sun.reflect.GeneratedMethodAccessor110.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.opensymphony.xwork.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:300)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:166)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
at com.jivesoftware.forum.action.JiveExceptionInterceptor.intercept(JiveExceptionInterceptor.java:63)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
at com.jivesoftware.base.action.JiveObjectLoaderInterceptor.intercept(JiveObjectLoaderInterceptor.java:56)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
at oracle.wocapps.forum.action.OracleLocaleInterceptor.intercept(OracleLocaleInterceptor.java:74)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
at com.opensymphony.webwork.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:71)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164)
at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:116)
at com.opensymphony.webwork.dispatcher.ServletDispatcher.serviceAction(ServletDispatcher.java:272)
at com.jivesoftware.base.util.JiveWebWorkServlet.service(JiveWebWorkServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
at com.jivesoftware.util.SetResponseCharacterEncodingFilter.doFilter(SetResponseCharacterEncodingFilter.java:53)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
at com.jivesoftware.util.SetRequestCharacterEncodingFilter.doFilter(SetRequestCharacterEncodingFilter.java:48)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:627)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:299)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:187)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)Check the adapter that is attached to the child table , compile it again and try adding .
BTW which connector you are using and paste the error trace from log files
Thanks
Suren -
Issue adding Child member to the outline in 11.1.2.2
Hi ,
We have any Issue with adding the member to the Outline. Details mentioned below.
Server locked up when i was updating the outline. I was erasing lower level structure.. This has been a chronic problem..
http://gvw3086-v.atlanta.hp.com:9000/easconsole/console.html
Need this server reset asap.. this is holding up important forecast work. Many people are depending on this getting done.
However to make it work you have to change the name of an existing member.. then add to the data base outline.. which disappear when you put it in.. save it. close and reopen and the structure add will be present. Do not copy, and delete siblings.. this will cause the server to lock up.
We had this issue before and what I have done is
just add the Child Outline and when we saved it it’s not saving the cursor keeps on browsing and rotating and it will not save. So in order to save just rename some other child member and save it then it saves. And when we close and reopen the outline we can see the child Outline was added. And again rename the other child member what we renamed to its original name.
The above one is just a temporary fix what we did but can any one help me on Permanent Fix for this.
Regards,
NaveenHi Naveen,
I think this issue is related to JRE version. As per support matrix for 11.1.2.2, JRE version version should be 1.6_29+. (that does not mean Java 7 is supported)
Check whats the Java/JRE version you have on the system from which you are accessing EAS link.
If its Java 7, uinstall it & install supported 1.6 version.
Hope this resolves the issue.
Thanks,
Santy. -
CUA client doesn't know any profile/role anymore after adding child system
Hi,
I did set up a CUA client on our Solman system. The client is client 500 which has been copied over from 000 via the SAP_CUST profile.
In this client 500 I did create some users with the SAP_ALL profile, so no problem here.
After adding a child system to the CUA, it seems that if I want to create a new user in the CUA client 500 it doesn't know any role/profile anymore which is standard available in this client.
In PFCG I can find a lot of standard roles, but when adding one via SU01 I do get the error that it doesn't exist. The same goes for the profile SAP_ALL.
Just to be clear, adding profiles or roles from child systems is not a problem, just adding roles or profiles for the CUA client itself doesn't seems to work anymore.
I had this problem on a 7.0 solman system and now also on a 7.01.
Did anyone had the same problem?
Thanks,
GregoryHello Georges,
I have exactly the same issue.
I have created a new CUA. I have copie 001 client to 333 client, using SAP_ALL profile.
Now, from CUA client (333), I cannot add any roles or profiles to my user.
I have created an RFC D1CCLNT333, but it does not resolved the problem.
Did you do anything else to fix your issue ?
Thanks
Best regards
CP2009 -
Hi Experts,
I have created a Data object by importing as "BAPI Wrapper" . It had a Parent node and a child node. Now i added one more child node.
But if i am activating this node it is giving below error.
Object not adequately specifiedError
Regards,
AbhishekHi Dhana,
I have deleted the child node and added these attributes in header so now i can activate this header structure but when i tried to activate BA after mapping , then it says
Invalid field mapping
But i have counter checked everything is fine even when i checked my BA with "Error check" button it didn`t give any error. Any idea how to sort it out.
Regards,
Abhishek -
Filtering not working for newly added child objects in master-detail table
Hi,
I am using Jdeveloper 11.1.1.4 version.
Problem scenario:
Filtering of records is not working for newly created child objects in a master-detail scenario.
Steps to reproduce this issue using HR Schema (using LOCATIONS and DEPARTMENTS table ) :
1. Create Business components (EO's & VO's ) for LOCATIONS & DEPARTMENTS table)
1. Create a .jspx page and insert a readonly master table of Locations
2. Insert a child table (inline-edit table) of Departments and enable filtering
4. For the child table, drag and drop CreateInsert operation as a toolbar button .
5. Create a new child record using the toolbar button and enter data .
6. Filtering on the newly created child record's attributes does not work.
Please note that the same filter works for existing child records.
Any suggestions for resolving this issue?
Thanks,
VikasFound from Fusion Developer's Guide the following snippet about QBE functionality :
"+When you create data controls, all data collections will automatically include a Named Criteria node with an All Queriable Attributes criteria. This is the default view criteria that includes all the searchable attributes or columns of the data collection. You cannot edit or modify this view criteria+. "
So, the question is if the implicit view criteria cannot be edited, how else to set the query execution mode to "Both" ?
Shouldn't ADF BC support this by default? Is this a bug?
Note:- If you create a maste-detail table using POJO datacontrols, filter works correctly for newly created child records also .
This seems to be an issue with ADF-BC datacontrols only.
Thanks,
Vikas -
Hittest only working with 1 added child
Ive got this piece of script where i place objects on the stage, to hittest eachother.
Ive got two seperate addchilds: one child must hittest another child
But for some reason it will only hittest with one object from the 2nd addchild :/
this is the addchild for the hittesting objects:
all variables are defined properly
for(var ringteller=0; ringteller<2; ringteller++) {
for(var teller1=1; teller1<17; teller1++) {
//var ringsegment_mc:Ring_1=new Ring_1();
var ClassReference:Class = getDefinitionByName("Ring_"+teller1) as Class;
var ringsegment_mc:MovieClip=new ClassReference();
ringsegment_mc.addEventListener(Event.ENTER_FRAME,vernietig);
addChild(ringsegment_mc);
for(var teller2=0; teller2<2; teller2++) {
var hitte_mc:Hitte=new Hitte();
Hittes.push(hitte_mc);
hitte_mc.mousedown=0;
hitte_mc.addEventListener(Event.ENTER_FRAME, floaten);
hitte_mc.addEventListener(MouseEvent.MOUSE_DOWN, slepenStart);
hitte_mc.addEventListener(MouseEvent.MOUSE_UP, slepenStop);
addChild(hitte_mc);
and this is the code for the slepenStart and vernietig:
function vernietig(evt:Event) {
for(var teller3:int=1;teller3<Hittes.length;teller3++){
if (evt.currentTarget.hitTestObject(Hittes[teller3]) ) {
evt.currentTarget.alpha+= -0.1;
if (evt.currentTarget.alpha<=0.05) {
evt.currentTarget.x=evt.currentTarget.y=-200;
this["segmentenkapot"+evt.currentTarget.kerngroep]+=1;
if (this["segmentenkapot"+evt.currentTarget.kerngroep] == 16) {
trace("ring kapot");
function slepenStart (evt:MouseEvent):void {
evt.currentTarget.startDrag();
evt.currentTarget.snelheidx=evt.currentTarget.snelheidy=0;
evt.currentTarget.mousedown=1;
function slepenStop (evt:MouseEvent):void {
evt.currentTarget.stopDrag();
evt.currentTarget.snelheidx=4; evt.currentTarget.snelheidy=2;
evt.currentTarget.mousedown=0;
so: only one instance of the hitte_mc will hittest with the instances of Ring_
what did i miss to fix this :/i replaced
teller3:int=1;
with
teller3:int=0;
which seems to have done it ^^
that is what you meant, right?
btw: the for loop was only checking for one, instead of the whole array ^^ -
Remove a Dynamically Added Child Symbol
I am trying to check if a symbol exists, and if it does remove it. Otherwise, add it. Since this is being added to a bettun, the goal is that an object shows up when you click and goes away when you click again.
My current code is below. Help?!
var chatPanel = sym.getSymbol("chat_wrap").getChildSymbols;
if (chatPanel.length > 0) {
chatPanel[0].deleteSymbol();
else {
// handle the error however you want here, or fail silently
sym.createChildSymbol("chat_panel", "chat_wrap");
console.log("symbol added")Hi Phil and thanks for your answer.
I have got my own cellrenderer but i do handle selected nodes different..
Here the code in the paint method of my treecellrenderer:
public void paint(Graphics g)
super.paint( g );
Icon currentIcon = getIcon();
TreeModelNode node = getCurrentUserObject();
//Set color for node, selected or not.
if(selected)
g.setColor( new Color(0,0,132) );
setForeground( Color.white );
else
g.setColor( getParent().getBackground() );
//Get textarea to paint.
if( currentIcon != null && getText() != null )
int offset = ( currentIcon.getIconWidth() + getIconTextGap() );
g.fillRect( offset, 0, getWidth() - offset +1 ,getHeight()-1 );
else
g.fillRect( 0, 0, getWidth() +1, getHeight()-1 );
} -
Adding child-component in silent mode
how can i edit my silent script to add new child elements?
example:
create Server "main_server" as s1;
and now to add COM element or ExecuteQueue element to the Server, what is the syntax?
ThanksHi all,
I am facing this same problem. More concretely, I want to create an EJBComponent as a child of an Application object.
Any insight on how to perform this through a silent script?
Best,
Oscar -
Is it possible to add 'Panels' within 'Panels' using the UIR editor or programmatically?
The UIR editor does not permit you to create a panel inside an existing panel, you must do it a load time instead. The trick is to pass a valid panel handle in the first parametere of the function; as you ca read in the online help;
parentPanelHandle
integer
Handle of the panel into which to load the panel as a child panel. Pass 0 to
load the panel as a top-level window.
Take a look at \userint\panels.prj for an example on how to create and treat child panels.
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos? -
CUA - Adding Child systems after implementation
Hello all, just have a quick question:
We have about 10 systems all with 8-10 clients in each of them and are in desperate need of the CUA. I wanted to just do a couple of systems at first so that everyone could get used to the CUA and then add the rest of the systems at a later time. Is there anything wrong with this? Or does the whole distribution model have to be setup BEFORE setting up the CUA?
Thanksi know your question is answered but i wanted to add my comment anyway - i was not around the last few days ... so: endure it now !
there's no restriction as to when to add other clients/systems to your distribution model. you can go step by step here if you like.
i have an adivce anyway: normally i do it systemwise (not client-wise) because in that way i find it more transparent what ports (WE20/21) and rfc-destinations (SM59) i have created (because i maintain them with the same names/numbers in all the systems in one landscape - just in case there is a system-copy to a new sandbox or somesuch ... then my settings will already be there).
but that's just a personel preference. -
Sorry to bring problems but i am trying to learn some as3 and so far i can not resolve this situation ,,,,,,
this is the script i am using ,,,,,,,,,,,,,,
Ent.buttonMode = true;
Bio.buttonMode = true;
ent.addEventListener(MouseEvent.CLICK, goEnt);
function goEnt (e:MouseEvent):void
var new Ent:MovieClip = new firstIntro();
this.addChild(newEnt);
newEnt.x = 659;
newEnt.y = 428;
Bio.addEventListener(MouseEvent.CLICK, goBio);
function goBio (e:MouseEvent):void
var newBio:MovieClip = new bioIntro();
this.addChild(newBio);
newBio.x = 659;
newBio.y = 428;
the problem is that when i click on first button the Movie Clip does load ok but when i click on second button the first movie cliip is visible ,,,, i have try everything i have read here but no luck ,,,,,,, i want to learn how to remove first child and allow only the second child to show up ,,,,,,, i am looking forward to add more buttons so the remove child should be for multiple buttons ,,,,, i am learning and so far did purchase a online tutorial but did not help me with this situation ,,,, thank you all in advance ,,,,,Create a variable to hold a reference to any child object that is added to the display list, then when any given button is used to add a new movieclip to the display list, use removeChild to get rid if any existing movie clip that was added through the reference in the variable. After the new movie clip is added to the display list, add a reference to that movie clip to the variable so that it can be used when the next movie clip will be added.
Ent.buttonMode = true;
Bio.buttonMode = true;
// create a variable to hold a reference to the currently added child, if any...
var currentChild: MovieClip;
ent.addEventListener(MouseEvent.CLICK, goEnt);
function goEnt (e:MouseEvent):void
var new Ent:MovieClip = new firstIntro();
// remove any child object currently in the display list...
if(currentChild != null) {
removeChild(currentChild);
this.addChild(newEnt);
// put a reference to the added child to the variable...
currentChild = newEnt;
newEnt.x = 659;
newEnt.y = 428;
Bio.addEventListener(MouseEvent.CLICK, goBio);
function goBio (e:MouseEvent):void
var newBio:MovieClip = new bioIntro();
// remove any child object currently in the display list...
if(currentChild != null) {
removeChild(currentChild);
this.addChild(newBio);
// put a reference to the added child to the variable...
currentChild = newBio;
newBio.x = 659;
newBio.y = 428; -
Add Child Element Appears Twice on Different Panels?
Hi,
I am guessing that I must have done something wrong here. I
have two panels here that I have used a large amount of
Actionscript draw a diagram, and when the users finish making the
selections, it should bring users the result.
I have no problems with the result display of the first
panel, except that when the result changes to a different state,
the added child I attempt to add only to the second panel also gets
displayed on the first panel.
I have attached the entire code below, and I hope that
someone on the list could help me figure out what the problem is
here.
Thanks in advance.
Alice"alice_data" <[email protected]> wrote in
message
news:[email protected]...
> Hi, Amy:
>
> Thanks for helping me figuring this out. The attached is
the code from
> my
> ShapesFactory.as
> What I have noticed is that if I shift around my
rectangle, if I shift
> my
> mx:AddChild element to
>
> <mx:AddChild relativeTo="{myCanvas4}"
position="lastChild">
> <mx:Label text="The answer to 5*4 is
{total_incidence}"
> id="text6" x="40.9" y="9.95" fontWeight="bold"
fontSize="12"/>
> </mx:AddChild>
>
> The text does show properly on the right tab, but if I
shift around the
> "rectangle," I do have the text hidden behind the
rectangle.
>
> Thanks again for your help.
>
> Alice
>
> // ActionScript file
>
> package {
>
> import flash.display.*;
>
> import mx.core.UIComponent;
>
> public class ShapesFactory extends Sprite
> {
> //some initial values
>
> public function Rectangle(x:int, y:int, width:int,
height:int,
> color:uint):UIComponent
> {
> var rect:UIComponent=new UIComponent();
> rect.graphics.lineStyle(1);
> rect.graphics.beginFill(color,2);
> rect.graphics.drawRect(x,y,width,height);
> rect.graphics.endFill();
> return rect;
> }
>
> }//class
> }//package
http://www.magnoliamultimedia.com/flex%5Fexamples/Alice/#
Also note that I slimmed down your ShapesFactory by making it
extend Object.
It doesn't need to extend Sprite.
Also note that with the way you're using it, I would probably
make it static
and would not instantiate it. Instead, I'd call the static
methods right
from the class:
package {
import flash.display.Graphics;
import mx.core.UIComponent;
public class ShapesFactory
//some initial values
public static function Rectangle(x:int, y:int, width:int,
height:int,
color:uint):UIComponent
var rect:UIComponent=new UIComponent();
rect.graphics.lineStyle(1);
rect.graphics.beginFill(color,2);
rect.graphics.drawRect(x,y,width,height);
rect.graphics.endFill();
return rect;
}//class
}//package
Then use it like this:
//don't put extra blank space in the UIComponent instead of
positioning it
myUIComponent = ShapesFactory.Rectangle(0, 0, 100, 30);
//position it here
myUIComponent.move(100, 100);
Also note that properties and methods of classes, by
convention, usually
start with lowercase letters, so you should consider renaming
the method
rectangle instead of Rectangle. By the same token, you shouls
consider
renaming the Result state to result.
HTH;
Amy -
Controlling loaded SWF inside a child
Hello to everyone, may this question be too obvious to
everyone, but I've been googling for hours without any luck.
Have seen examples but they are not exactly as my scenario...
Please, I need some help.
I have loaded a SWF and attached to a MovieClip which exist
in my current movie using the following code, and now I just want
to access the loaded SWF to send it orders like play() or
gotoAndPlay(); I have tried also: container=
MocieClip(loader.content); instead adding child, but it trhows an
error//this is your minimum code to load a file
var url:String = "put your url here ";
var request:URLRequest = new URLRequest(url);
var loader:Loader = new Loader();
loader.load(request);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
loadComplete);
function loadComplete(event:Event):void {
addChild(loader.content);
//you don't need all that code just concentrate on the bit
you need; when this work then you can start putting the rest
Maybe you are looking for
-
Profit Center in Goods Receipt
Hi Gurus, 1. We are creating a PO with Account Assignment WBS and in line item we are able to see the Profit Center and this purchase order Account Assignment Category - Q (Proj. make-to-order). 2. In material master we dont have any Profit Center 3.
-
Dear Friends, I had installed oracle 9i using database configuration assitance for learning purpose. Installation was successful. Now, is it possible to view the database creation script of the above created database. If it is possible, kindly share
-
Can I download ibooks from my mac to my kindle?
Can I transfer iBooks from my MacBook Pro to my Kindle ereader?
-
PLSQL 10g on Windows 7 Professional
Hi everyone, I have installed Oracle Client 10g on Windows 7 Professional, but when I run PLSQL and type all of my user credentials my PLSQL window closes, but if I right click on the icon and choose run as administrator or run this program in compat
-
I just recently pre-ordered an iPhone 4 to be shipped to my house. I used another person's upgrade on my account and was wondering if the iPhone will come specifically for that number, or can I choose which number I want when I activate in iTunes? I