Creating a dynamic button class
Hi all. I'm trying to create a button class that has some
properties such as scale that can be coded at runtime. The tutorial
I found hard codes the scale amount into the class, but I would
like to be able to create a new instance of the button class in
Flash, and say on the main timeline, define my variables for
scale...and pass these to the class file. I'm running into an
"1120" error message. I have attached the original working code.
Thanks.
Thanks. I'm having trouble finding a clear tutorial that I
can understand on this topic. I've tried creating a set function
but not sure where to write the get function. I have attached my
class file and my call to it in the main timeline. I've been
struggling with learning custom classes and appreciate any help!
Also, I am now creating a new instance on the main timeline
instead of linking to it in the library. What is the best way of
doing this.
Similar Messages
-
How to create a dynamic button?
Hi,
I'm trying to find some information on how to create a button that can be used in a dynamic form within a flowable subform to duplicate that subfom if they need to add more information in that same format.
I've been able to find information on flowable forms and static vs dynamic as well as the concept behind the button but i can't seem to find anywhere instructions on how to actually do it. What scripts to put in in order to get the outcome i'm trying to achieve, all i can find is stuff on the samples and because i can only open the PDF version of the sample and the dynamic version that i can't open i'm unable to see exactly how they've done that sample.
Can anyone help me?????
Any help would be appreciated.
Thank you in advance.Hi Niall,
Thanks again for your help. That has helped a little. My next drama is that i cannot figure out at all is to get it to follow onto the next page instead of immediately after the section i want to repeat. Everytime i change the Pagination settings i loose my content on that page that has the section on it. I don't know how to change those settings to make it work. Any clues???
I am so close in getting it right that it's frustrating not being able to find the right setting. The scripting works on the buttons and i've worked that out but just can't seem to get that next step done. With this particular component of LC in creating a form, do you have to make the following fields/subforms to flow aswell so that it can move down the page???
Thanks in advance. -
How to create a dynamic button to download a photo gallery in Adobe Muse?
I need to create a gallery in Muse, so far so good, but when each photo was displayed automatically would have to see a download option that picture, ie, individual download each photo gallery. Is how to do this? Is there a script for Adobe Muse or widgets?
I thank your attention !!Hi Terry,
As I already said, this is really a helpful tutorial to me.
I have one question though. Is it possible to make a dropdown menu that gets triggerd by pushing only the menu button itself and not the whole header? It doesn't seem possible to me, as the accordion panel has to be the same size as the menu. I can't think of any solution but to align a small menu to the side of the screen, which would not be my first choice to do.
Any workaround suggestions are welcome!
Thanks in advance! -
Creation of satic and dynamic buttons in a view
Hi,
I have created a dynamic button using the code..
DATA: lr_container TYPE REF TO cl_wd_uielement_container,
lr_button TYPE REF TO cl_wd_button.
CHECK first_time = abap_true.
lr_container ?= view->get_element( id = 'ROOTUIELEMENTCONTAINER' ).
cl_wd_matrix_layout=>new_matrix_layout( container = lr_container ).
lr_button = cl_wd_button=>new_button( id = 'BUTTON'
text = 'My Button'
on_action = 'ACTION' ).
cl_wd_matrix_head_data=>new_matrix_head_data( element = lr_button ).
lr_container->add_child( the_child = lr_button ).
its working fine and iam able to see the button .....but when i create another button thorugh layout design its going for dump....whats the reason .?
Cant we create static and dynamic buttons at a time?
Thanks,.
Shailaja Ainala.Hi Shailaja,
Yes you can add static and dynamic ui elements together in the same view.
The possible problem here could be the way in which the ui elements are added.
You have created the dynamic button under the root container uielement.
What about you static button ? Check your layout and layout data property.
Thank You,
Radhika. -
Dynamic Proxy class in JDK1.18
I want to create a Dynamic Proxy class in JDK1.1.8 can any one help me out
thanX for ur reply.
I need to implement that in JDK1.1.8, I need to deletgate all opperations on my proxy class to another class. -
Dynamic proxy class from a Class instead of an Interface
Why is not possible to create a dynamic proxy class from a Class instead of an Interface, using java.lang.reflect.Proxy?
I have seen the source code of Proxy :
* Verify that the Class object actually represents an
* interface.
if (!interfaceClass.isInterface()) {
throw new IllegalArgumentException(
interfaceClass.getName() + " is not an interface");
It seems to be restricted as a desing desition. Has someone knows about the reason of that?
There is a workarround for creating dynamic proxy classes from any POJO which not implements any interface?The JDK doesn't allow you to proxy classes for a few reasons: it encourages you to use interfaces - often a good idea - and also, proxying of classes exposes you to unpredictable behaviour. Since dynamic proxies are created by generating a new class at runtime, if you proxied a class you'd be generating a subclass of that class, and if the superclass had any final methods, the proxy wouldn't be able to intercept invocation of them, so your proxy wouldn't work properly. Also, the superclass would actually be loaded, which could produce other unpredictable results if, say, that class had a static initializer. With an interfaces, you generate an object that just has the public API described by the interface, with a class, you're actually generating a subclass of the proxied type, which isn't the same thing
If you really want to proxy a class rather than an interface, there are various third-party libraries around that will do it for you. ASM, CGLIB, BCEL to name a few. My choice would be ASM, but really I'd urge you to try and re-design with interfaces if at all possible
http://cglib.sourceforge.net/
http://asm.objectweb.org/
http://jakarta.apache.org/bcel/ -
can anyone guide me to create dynamic button? Thank you,
Hi Pankaj,
This is what you need:
public static void wdDoModifyView(IPrivateStamappView wdThis, IPrivateStamappView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
//@@begin wdDoModifyView
if (firstTime){
IWDButton button = (IWDButton) view.createElement(IWDButton.class,"myButtomid");
IWDTransparentContainer myCont = (IWDTransparentContainer) view.getRootElement();
myCont.createLayout(IWDMatrixLayout.class);
myCont.addChild(button,0);
//@@end
Regards
Nir -
Creating a Button Class from MC
I have a few simple questions for those who know about
classes. I have been reading the tutorials on creating classes and
specifically extending the MC class. I am pretty sure that an
extended MC_Class might help me get what I need from my project.
I essentially have a bunch of buttons, hundreds to be exact -
and the exact number needs to be dynamic. Each one is currently a
static MC with a bunch of variables assigned to each one via global
variables. Its iis pulling in data taht assign the button values
from XML files and - these XML files may change.
Q1. If I extend the MC class so I can add attributes to MC's
instance (Avoiding global variables) - will it mess with the rest
of the movie clips in my scene? I mean if all I want to do is ad a
a few dynamic string variables - it really shouldnt effect any of
the other clips would it? MC.JumpURL = "newurl.com", MC.Thumnail
="/here/image.jpg" (This would help alot)
Q2. What if I wanted to define actions of the new MC in the
class? If the MC is an extension of the MC class. Would all of my
MC's automatically take on the actions of the custom MC Class? For
instance - I want the movieclip to animate onscreen and have
rollover effects. I could do this easy if it were static - but I
need this to become dynamic. Also - there are now unknown
quantities to deal with
Q3. How exactly would I call and assign the MC its atributes
at the same time? And how do I specify this MC to use the functions
defined in the class and not the other MC's I created elsewhere in
the File.
Example. Currently I have a grid of MCs' created when the
User clicks a menu item (Another type of MC).
Each new MC animates onstage - it calls a
loadMovie(_root.thumb[0], this.Flipper) to assign and embedded MC
an image defined in the XML that was loaded and assigned because I
placed the instance on stage and wrote a MC script on each MC.
Confused - check out what I am creating at
www.vincesidwell.com/Fischer
Click Fabrication or TurboSystems menus. Both menues will
load a new set of Thumbnails at the bottom. They are loaded via an
XML loaded by the menu and a function assigns the jpgs for the main
gallery, Rollover image, and eventually a URL for a downloadable
High Res Image.
The client recently added more than 9 images per menu item. I
will need to create a scrollable thumbnail gallery with dynamic
quantities
I can manually create the MC Scroller item for static number
of buttons. But scripting an unknown for each ones links and images
is insane. So I am looking at Classes. Assign a custom class for
the flipping buttons and I should be able to assign tthem as the
XML loads, and have it automatic. (pray please please please)
Anyhelp?
Thanks
Vince SidwellHi there!
I'll try and give some answers to your questions below...
"vin-E" <[email protected]> wrote in message
news:[email protected]...
>I have a few simple questions for those who know about
classes. I have
>been
> reading the tutorials on creating classes and
specifically extending the
> MC
> class. I am pretty sure that an extended MC_Class might
help me get what
> I
> need from my project.
>
> I essentially have a bunch of buttons, hundreds to be
exact - and the
> exact
> number needs to be dynamic. Each one is currently a
static MC with a
> bunch of
> variables assigned to each one via global variables. Its
iis pulling
> in
> data taht assign the button values from XML files and -
these XML files
> may
> change.
>
> Q1. If I extend the MC class so I can add attributes to
MC's instance
> (Avoiding global variables) - will it mess with the rest
of the movie
> clips in
> my scene? I mean if all I want to do is ad a a few
dynamic string
> variables -
> it really shouldnt effect any of the other clips would
it? MC.JumpURL =
> "newurl.com", MC.Thumnail ="/here/image.jpg" (This would
help alot)
You do not have to create a new MC class to assign local
values or functions
to it. A pseudo code example:
Loop through total buttons you want to make (which can be
number of entries
in an XML file)
Create a new movieclip and load the button graphic into
this, give it a
name like
MyButtonX, where X is an increasing number based on which
button this
is. (Instead of creating
and empty movielcip, you could also attach a movie (or
button) from
library.
Assign the values and create the functions for this button
that you
would like (probably based
on information in the XML file):
MyButtonX.someVariable = node.attribues.someData;
createOnRelease(MyButtonX, someOtherParamters)
(where you have defined the function createOnRelease to do
something
like
function createOnRelease(MC, someOtherParameteres) {
MC.onRelease = function() {
do what you want to do based on someOtherParameteres
Position and resize MyButtonX
In your example you have a 3x3 grid, which might extend to
3xTOTAL,
so you'd have to use some
mathematical formula based on the value X, something like
MyButtonX._x =
(((X-1)%3)*(buttonWidths+hSpaceBetweenButtons)
MyButtonY._y = Math.floor((X-1)/3)*(buttonHeights
+vSpaceBetweenButtons
end of loop.
>
> Q2. What if I wanted to define actions of the new MC in
the class? If
> the MC
> is an extension of the MC class. Would all of my MC's
automatically take
> on
> the actions of the custom MC Class? For instance - I
want the movieclip
> to
> animate onscreen and have rollover effects. I could do
this easy if it
> were
> static - but I need this to become dynamic. Also - there
are now unknown
> quantities to deal with
If you actually create a new class, than all instances of
that class will
have the methods you define for it (just like all instances
of a movieclip
has those methods. At least, have them available. That
doesn't mean they are
always in use ... like for example the onRollOver. But again,
you don't need
to create a class to give all your dynamically created
buttons a rollover
effect. (Check code above).
> Q3. How exactly would I call and assign the MC its
atributes at the same
> time? And how do I specify this MC to use the functions
defined in the
> class
> and not the other MC's I created elsewhere in the File.
You use the instance name of the MC to access that MC and its
attributes/methods. For example button number 10 might look
like this:
trace(MyButton10._x);
trace(MyButton10.someVariableYouHaveDefined);
MyButton10.callSomeFunctionYouHaveDefined();
For a movieclip to access a variable that has been defined
for that instance
of the movieclip, use "this" to point to that particular
instance. So if we
defined the function "callSomeFunctionYouHaveDefined" for
button number 10
and want to access "someVariableYouHaveDefined" for this
particular
instance, then
MyButton10.callSomeFunctionYouHaveDefined = function() {
trace(this.someVariableYouHaveDefined);
> Example. Currently I have a grid of MCs' created when
the User clicks a
> menu
> item (Another type of MC).
> Each new MC animates onstage - it calls a
loadMovie(_root.thumb[0],
> this.Flipper) to assign and embedded MC an image defined
in the XML that
> was
> loaded and assigned because I placed the instance on
stage and wrote a MC
> script on each MC.
>
> Confused - check out what I am creating at
www.vincesidwell.com/Fischer
>
> Click Fabrication or TurboSystems menus. Both menues
will load a new set
> of
> Thumbnails at the bottom. They are loaded via an XML
loaded by the menu
> and a
> function assigns the jpgs for the main gallery, Rollover
image, and
> eventually
> a URL for a downloadable High Res Image.
>
> The client recently added more than 9 images per menu
item. I will need
> to
> create a scrollable thumbnail gallery with dynamic
quantities
>
> I can manually create the MC Scroller item for static
number of buttons.
> But
> scripting an unknown for each ones links and images is
insane. So I am
> looking
> at Classes. Assign a custom class for the flipping
buttons and I should
> be
> able to assign tthem as the XML loads, and have it
automatic. (pray please
> please please)
Again, no need for a class for this. If you load the buttons
into seperate
MCs, and make sure to have all these MCs created inside a
common parent MC
for these buttons (which then _only_ contains these buttons).
You can move
this parent MC up and down on the stage based on the
scrollbar. And you can
read height off this MC to create your scrollbar.
You might want to check out the following tutorials at
http://www.gotoandlearn.com/:
XML Video Playlist
Creating Animated Buttons
Introduction to OOP
Now, I've said many times you don't need to make your own
class to do what
you want. That does not mean you can't make your own class. I
just think
that the main problem you are facing is the dynamic part,
which you will be
facing if you make your own class or not.
/Jensen/
>
> Anyhelp?
>
> Thanks
> Vince Sidwell
>
>
> -
Button class not creating a button
Hi,
I have some AS3 code which I was hoping would create a
re-usable button class but it does not. I just get a blank canvas.
I am not getting any errors. Code is attached. Anyone see what is
wrong?thanks for the response.
to instantiate this class with the var code that you posted
and I reposted. Would this code be added to the .as file or would I
put that on frame 1 of the .fla file?
Also I want to create multiple buttons and position them on a
page within a grid. With the class code I have posted, how would I
go about doing that? Lastly, I want one of two movie clips to
display once the button is clicked. Can someone explain how I would
go about that as well?
thanks -
Dynamically Create and Compile Java Classes
Hi,
I have a requirement to dynamically create and compile Java classes and would like some advice on the best method to do so.
Basically the project I am working on involves creating "Factors". Factors are items that have both attributes and weights so for example Factor A could have attribute B with weight 0.76, and attribute C with weight 1.33. There are a number of methods common to all factors such as calculateTotal, identify etc etc.
At the moment the application has 5 factors, but there is a requirement to dynamically add and remove factors on the fly.
I current solution I have been considering is using XML to describe the new class, build up the class and compile it; something along the lines of what is descibed at
http://www.javaworld.com/javaworld/jw-02-2002/jw-0201-xslt_p.html
however i would like to consider all options.
Any help with this is greatly appreciated.You want to dynamically create and compile Java classes.
I would try the following:
(1) Write the Source code of the new class into a text file with the name MyNewClass.java
(2) compile this new .java-file with Runtime r = getRuntime();
try {
r.exec ("javac MyNewClass.java");
} catch (IOException e) {
System.out.println("ooops " + e.getMessage());
} (3) somehow try to load that new class, maybe using ClassLoader cl = ClassLoader.getSystemClassLoader();
cl.loadClass("MyNewClass"); -
APEX:How to put dynamic buttons in a Report.
Hello all,
I am creating one application in which i want two buttons in every record. I can't put it manually because it should change according to records in a table So Can anyone tell me how to put dynamic buttons in a report.
Thanks & Regards,
Jiten PansaraHi Jiten,
you cannot create buttons in the report, but you can always create link columns with some css class to show it as button.
So in the both link column report attributes you will have class="button1" and class="button2"
And in dynamic actions you need to bind the events based on your link column's jquery selector like:
.button1
.button2Thanks -
Add dynamic buttons to each report row and bind the row data to buttons specific to that row
I have a page with a form at the top and a report at the bottom which is tied to a table. I need to add a pair of buttons for each row of the table and add dynamic actions for these buttons. I need to submit the data corresponding to the row to a REST service and refresh the table/row. I know it is possible to add ajax call and refresh the table after the response is received. But I am not sure how I can dynamically include a pair of buttons on each row and have the access the data corresponding to the record when a particular button is clicked. I was not able to find such a feature using the help page. Can you please let me know if this is possible. Thanks in advance.
Below is the representation of how I need the page to look like.
Col 1
Col 2
Col 3
data 1
data 21
data 31
Button 1
Button 2
data 2
data 22
data 32
Button 1
Button 2
data 3
data 23
data 33
Button 1
Button 2
data 4
data 24
data 34
Button 1
Button 2
I should be able to access data 1, data21, data 31 from button 11 and button21 etc.select data1,
data2,
data3,
null button1,
null button2,
rowid r_id
from .....
If you edit the column for button1 and navigate to the Column Formatting region you can create your button here, several different ways. You will need to play around with how you prefer. See below:
<input class="button1" type="button" id="#R_ID#" value="label for the button" /> or <button id="#R_ID#">label for button</button> or you could use <a> and apply css of your theme.
You also create both buttons in a single column. From here you can reference any of the columns from your select by using the #COLUNMNAME# format (as I did with R_ID).
You will next need to something similar for all columns you want to be able to grab when you click the buttons. See below:
--- This would be for data1 column
<span id="D1-#R_ID#">#DATA1#</span>
You would do these for each column that you want access to when button clicked as mentioned above. You could bypass this step and use jquery to traverse the DOM using .closest() and .find() and give each column a distinct class. Is is your preference.
You would then create a dynamic action triggered when .button1 is clicked. Now that you have that object you can get the id of the triggering object which would be your r_id and from there you can access all your individual data points(all this done in a javascript in the dynamic action) and assign to hidden items on your page. The next step of that dynamic action you could execute pl/sql and pass those in page items.
Hope that all makes sense.
David
Message was edited by: DLittle
Just as a bit of clarification: the r_id column does not have to be rowid, but it does need to be unique for each row return. You could use your primary key or rownum. Whatever works for your scenario. -
How to create a dynamic form with bind variables :schema & :table_name
My application has two LOV's, one to select a schema, and the next to select a table within that schema. I then have a button which passes me to a report which displays the data in that table.schema.
I now want to create a link to a form where I can edit the record based on the rowid of that table.schema, but it doesn't appear that I can create a dynamic form where I pass the schema.table_name and rowid. Is this possible? Can anyone advise how I can do this? The form builder only wants a fixed schema/table name.
Thanks in advance.
Stuart.Hi Stuart,
In this sort of situation, you will need to be a bit creative.
I would suggest a pipeline function called as if it was a report.
Then you can pipe out the required fields.
Since you will have a variable number of fields, you could use two of the multi row field names for your field names and values.
Then after submit, you can create your own procedure to loop through the fields (stored for you in the Apex package) and update the table as required.
Not very specific I'm afraid, but it should work.
Regards
Michael -
How to create a dynamic action from link column in classic report
I Have an apex page that display a modal window utilizing jquery. In the modal window I have a classic report with a link column that I want to capture its click event.
I was thinking I could create a dynamic action with selection type=jquery selector. Not for sure if I need to do anything on link column and do not know the syntax
for jquery selector. Would appreciate any help or direction???Thank you for your response. I am very new to Jquery so don't understand all that well.
What I did:
I created a dynamic action
Event: Click
Selection Type: jQuery Selector
jQuery Selector: tdheaders
Created True Actions
I created an alert to see if this is being executed.
Alert 'I made it here'
What I have:
I created a report region with the following query:
Select empno, ename, 'SELECT' from emp
where (ename like '%'||ltrim(rtrim(:P2_SEARCHPU))||'%'
or :P2_SEARCHPU is null)
I created 'SELECT' column as Link Column
Report Attributes
Link Text Select
Target Page in this Application
Page 2
Region Header
<div id="ModalForm2" title="Employee List" style="display:none">
Region Footer
</div>
This report is displayed in a modal form when a button is clicked.
Code for modal window in Page Header
<script type="text/javascript">
$( function() {
$('#ModalForm2').dialog(
{ modal : true ,
autoOpen : false ,
buttons : {
Cancel : function() {
closeForm2();
function openForm2()
$('#ModalForm2').dialog('open');
function closeForm2()
$('#ModalForm2 input[type="text"]').val('');
$('#ModalForm2').dialog('close');
</script>
I am trying to capture the click event on the link column of the report in the modal form. I want to pass a couple of column values
back to the main form and close the modal window. I do not want to do the submit that happens if I click on the link column and link back to the main page(2)
If I let the submit to happen, all other entered fields are cleared on my main form.
Just don't understand the jQuery selector. I have no problem catching the button clicks on the modal form. -
To disable the horizontal scrollbar and to create a next button to navigate
To disable the horizontal scrollbar and to create a next button to navigate through the records. At present I create a JSF page and drag and drop my table view and then using the Tuning property I have limited the number of records to be shown. But I need to add a button and then code it to display the next few records. Can someone kindly suggest a suitable mechanism to get this accomplished.
Edited by: 888970 on Oct 2, 2011 10:15 PMHi Erp,
At present these are the entries that I have in my JSPX page.
I have a Table, Iterator and a Input List of Values. As per the scenario, I want a few rows to appear on the table for which I wanted to disable the horizontal scroll bar and then once I click on the list of values it must prompt me with the remaining page numbers.
Earlier there are about 150 records in the table. I want to show them as 15 per page.
For which I have added the Iterator and a LOV component code in my JSPX page.
<af:iterator id="i1"
value="#{bindings.NsEventDetailsView1.collectionModel}"
var="row"
binding="#{pageFlowScope.testPageBean.myIterator}"/>
<af:inputListOfValues label="Label 1"
popupTitle="Search and Result Dialog" id="ilov1"/>
Then I created the bean class as per the example.
Below is the bean class:
import javax.faces.event.ValueChangeEvent;
import oracle.adf.view.rich.context.AdfFacesContext;
import org.apache.myfaces.trinidad.component.UIXIterator;
import org.apache.myfaces.trinidad.event.AttributeChangeEvent;
public class TestPagebean {
public TestPagebean() {
public void i1ov1_valueChangeListener(ValueChangeEvent valueChangeEvent) {
// Add event code here...
private UIXIterator myiter;
public void setI1(UIXIterator myiter) {
this.myiter=myiter;
public UIXIterator getmyiter() {
this.myiter=myiter;
public UIXIterator setmyiter() {
return myiter;
UIXIterator valueIterator = getmyiter();
if (!valueChangeEvent.getNewValue().equals(valueChangeEvent.getOldValue())) {
int newPage =
Integer.parseInt(valueChangeEvent.getNewValue().toString());
int pageStart = (newPage) * valueIterator.getRows();
valueIterator.setFirst(pageStart);
AdfFacesContext.getCurrentInstance().addPartialTarget(valueIterator);
But i am getting errors in the bean class.
1. Block expecting }
2. public UIXIterator getmyiter() {
this.myiter=myiter;
Return Statement missing
3. Block expecting {
4. Type or variable 'valueChangeEvent' not found
5. Method 'getNewValue' not found
6. Method 'getOldValue' not found
7. Method 'toString' not found
Can you suggest a possible solution?
Maybe you are looking for
-
We have BW ver 2.1. Recently I have upgraded my Front end from Windows 2000 to Windows XP. Now not able to run BW from Business Analyzer short cut. When I click its hang up & show not responding in Task manager. What could be the reason. Kindly help
-
How to the find the Delete records/Statement used in Oracle 10g database?
Hi all, I am Using Oracle 10g Database release 2 on Windows 2003 Server Enterprise Edition... Last week One of my user has deleted important records from my database,i need to find who did this... is there any way to find out ...Please Advice me ....
-
Can't establish a wireless connection
Product: HP Photosmart C8180 Recent Changes: Purchased new wireless router and setup WPA security My printer is unable to see either of my two wireless networks within my home "springfield" nor "springfield_EXT" (a network extender). Both require a
-
BI-RFC problems after client copy
Hi all Client copy was done and after that when I tried to load data in BW, it ran for long time and finally showed cancelled in SM37. When I checked the source system in RSA1, it gave two messages. 1.Incorrect IDoc type ZSAC008 in the ALE definition
-
Issues with graphic card on Macbook Pro 2011
I just having problem with starting my Macboook. First, at start screen (gray background with the apple logo) appears pink/red horizontal lines over all the screen. Then, when i'm using my computer, screen goes black for no reason and i need to force