Calling function from html tag in dynamic textfield

Hi!
Tried several approaches for making this happen, but can't seem to do it. I could really use an example of how to do this in my particular case, since I'm not exactly a code - guru.....
I have a sprite menu which populates a dynamic textfield  with textlabels as users click individual items in the menu in addition to ordinary actions(gotoAndStop).
As these labels appear in the textfield, I want to be able to link them to the frames assosciated with the menu - item frames. As you can understand from this, I am working with the timeline.
By enabling  html rendering of text in the textfield, I have been able to link these output labels via a  a href - tag, but I am not able to call a function from this html. The function I am trying to call uses a switch statement to take the appropriate actions according to which label is being clicked, but the only effect I get is the html opening a browser window...... Unfortunately I do not know how to explain this any better, but here is my code for the following:
Main Timeline, frame 1, actions layer:
[AS]import flash.display.*;
import flash.events.*;
import flash.display.Stage;
var buttonTrace:TextField;
var sectionNames:Array = new Array("Frontpage","Introduction",
"Designparadigm", "Tooling", "Maya & c++ API", "Geometric Vectors","Lindenmayer systems","Artificial Life",
"Projects","Litterature","Disclaimer","Site credits","Newsletter & Rss",
"Blogging","Plugins","LINKS");
var sectionCount: int = sectionNames.length;
var menu:Sprite = new Sprite();
menu.x = 452;
menu.y = 172;
this.addChild(menu);
buildMenu();
function buildMenu():void {
for(var i:int=0; i < sectionCount ; i++){
var item:MovieClip = new MenuItem();
item.labelName = sectionNames[i];
item.targetClip = this;
if(i<4){
item.y = i*125
menu.addChild(item)}
else if (i>3 && i<8){
item.y = (i-4)*125
item.x = 125
menu.addChild(item)}
else if (i>7 && i<12){
item.y = (i-8)*125
item.x = 250;
menu.addChild(item)}
else if (i>11 && i<16){
item.y = (i-12)*125
item.x = 375
menu.addChild(item)}
}[\A]
Then, for the movieclip called MenuItem, I have button placed on the first frame of the timeline, and this code in the actions layer:
[AS]import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.display.Stage;
import flash.text.TextField;
import flash.events.Event;
import flash.events.TextEvent;
var buttonTrace:TextField;
var labelName:String;
var targetClip:MovieClip;
clickButton.addEventListener(MouseEvent.CLICK, onClick);
function onClick(evt:MouseEvent):void {
trace(labelName);
targetClip.gotoAndStop(labelName);
MovieClip(root).buttonTrace.appendText("\n" + labelName);
MovieClip(root).buttonTrace.addEventListener(TextEvent.LINK,linkHandler);
  function linkHandler(linkEvent:TextEvent):void {
  switch (linkEvent.text) {
  case"Introduction":
  var text= "Introduction";
  text.addEventListener(TextEvent.LINK,"Introduction");
  trace("Listening");
   Intro();
   break;
  case "Designparadigm":
   DP();
   break;
  case"Tooling":
   Tooling();
   break;
  case "Maya & c++ API":
   MayaAPI();
   break;
  case "Geometric Vectors":
   GeometricVectors();
   break;
  case "Lindenmayer systems":
   Lsystems();
   break;
  case "Artificial Life":
      AL();
   break;
  case "Projects":
      Projects();
   break;
  case "Litterature":
      Litterature();
   break;
  case "Disclaimer":
      Disclaimer();
   break;
  case "Site credits":
      Sitecredits();
   break;
  case "Newsletter & Rss":
      Rss();
   break;
  case "Blogging":
      Blogging();
   break;
   case "Plugins":
      Plugins();
   break;
  case "LINKS":
      LINKS();
function Intro():void {
targetClip.gotoAndStop(2);
function DP():void {
targetClip.gotoAndStop(3);
function Tooling():void {
targetClip.gotoAndStop(4);
function MayaAPI():void {
targetClip.gotoAndStop(5);
function GeometricVectors():void {
targetClip.gotoAndStop(6);
function Lsystems():void {
targetClip.gotoAndStop(7);
    function AL():void {
targetClip.gotoAndStop(8);
function Projects():void {
targetClip.gotoAndStop(9);
function Litterature():void {
targetClip.gotoAndStop(10);
function Disclaimer():void {
targetClip.gotoAndStop(11);
function Sitecredits():void {
targetClip.gotoAndStop(12);
function Rss():void {
targetClip.gotoAndStop(13);
function Blogging():void {
targetClip.gotoAndStop(14);
function Plugins():void {
targetClip.gotoAndStop(15);
function LINKS():void {
targetClip.gotoAndStop(16);
MovieClip(root).buttonTrace.htmlText="<a href=\'function:linkHandler,?????'>History</a>";
[\A]

as3 textfields have a TextEvent.LINK you can use.

Similar Messages

  • Problem while calling java function from html

    when i tried to call a java function from html i'm getting an error
    object don't support this property.
    what could be the reason.
    This is my html.
    I got this from this forum only.
    My applet is accessing the system property "user.home".
    I ran it in IE
    <DIV id="dvObjectHolder">Applet comes here</DIV>
    <br><br>
    <script>
    if(window.navigator.appName.toLowerCase().indexOf("netscape")!=-1){ // set object for Netscape:
         document.getElementById('dvObjectHolder').innerHTML = " <object ID='appletTest1' classid=\"java:test.class\"" +
    "height=\"0\" width=\"0\" onError=\"changeObject();\"" +
              ">" +
    "<param name=\"mayscript\" value=\"Y\">" +
    "<param name=\"archive\" value=\"sTest.jar\">" +
    "</object>";
    }else if(window.navigator.appName.toLowerCase().indexOf('internet explorer')!=-1){ //set object for IE
         document.getElementById('dvObjectHolder').innerHTML = "<object ID='appletTest1' classid=\"clsid:8AD9C840-044E-11D1-B3E9-00805F499D93\"" +
              " height=\"0\" width=\"0\" >" +
              " <param name=\"code\" value=\"test.class\" />" +
         "<param name=\"archive\" value=\"sTest.jar\">" +
              " </object>"
    </script>
    <LABEL id="lblOutputText">This text will be replaced by the applet</LABEL>
    <BR>
    <input value="Javascript to java" type=button onClick="document.appletTest1.fromJavaScript()">

    I tried this example using the repy given to an earlier post.
    But its not working with me.
    What i did in addition was adding plugin.jar to classpath to import netscape.javascript.*;
    Let me add some more details
    1) I'll add the stack trace
    2) my java progrma
    3) batch file to sign the applet.
    1) This is the stack trace i don't know whether u will undertand this
    load: class test.class not found.
    java.lang.ClassNotFoundException: test.class
         at sun.applet.AppletClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadCode(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.FileNotFoundException: C:\FastranJava\AppletObject\bin\test\class.class (The system cannot find the path specified)
         at java.io.FileInputStream.open(Native Method)
         at java.io.FileInputStream.<init>(Unknown Source)
         at java.io.FileInputStream.<init>(Unknown Source)
         at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
         at sun.applet.AppletClassLoader.getBytes(Unknown Source)
         at sun.applet.AppletClassLoader.access$100(Unknown Source)
         at sun.applet.AppletClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         ... 10 more
    Exception in thread "Thread-5" java.lang.NullPointerException
         at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
         at sun.plugin.AppletViewer.showAppletException(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    2) Java Program
    import netscape.javascript.*;
    import java.applet.*;
    public class test extends Applet
         private JSObject win;
         private JSObject outputLabel;
         private boolean buttonFromJavaClicked=false;
         checkJavaScriptEvent evt=new checkJavaScriptEvent();
         public void init()
              try
                   evt.start();
                   win=JSObject.getWindow(this);
                   outputLabel=(JSObject)win.eval("document.getElementById('lblOutputText')");
                   outputLabel.setMember("innerHTML", "<center><h1>From Init<br>Your Home directory" + System.getProperty("user.home") + "</h1></center>");
              catch(Exception e)
                   e.printStackTrace();
         public void fromJavaScript()
              buttonFromJavaClicked=true;          
         public void fromJavaScript2()
              System.out.println("Started Form JavaScript2");
              try
                   String strLbl="<center><h1>From JavaScript<br>Your Homedir:" + System.getProperty("user.home") + "</h1></center>";
                   outputLabel.setMember("innerHTML", strLbl);
              catch(Exception e)
                   e.printStackTrace();
         class checkJavaScriptEvent extends Thread
              public void run()
                   while(true)
                        if(test.this.buttonFromJavaClicked)
                             System.out.println("OK buttonfromjava is true");
                             test.this.buttonFromJavaClicked=false;
                             fromJavaScript2();
                        try
                             Thread.sleep(3000);
                        catch(Exception e)
                             e.printStackTrace();
    3) Batch file
    del *.cer
    del *.com
    del *.jar
    del *.class
    javac -classpath ".;C:\Program Files\Java\jre1.5.0_06\lib\plugin.jar" test.java
    keytool -genkey -keystore harm.com -keyalg rsa -dname "CN=Harm Meijer, OU=Technology, O=org, L=Amsterdam, ST=, C=NL" -alias harm -validity 3600 -keypass password -storepass password
    jar cf0 test.jar *.class
    jarsigner -keystore harm.com -storepass password -keypass password -signedjar sTest.jar test.jar harm
    del *.class

  • How to Call Function from SAPSCRIPT

    I want to Call a function from my SAPSCRIPT to get some data and print the same in the form , Can I get an example for this

    Hi Nandan,
    U cannot directly call function from SAPScript... For that u have to create one include in which u need to write the code. Using Perform... EndPerform u can call the same from SAPScript. See the below example
    u need to write this code in SAPScript
    PERFORM formname IN PROGRAM includename
    USING &field1&                                      
    USING &field2&                                      
    CHANGING &field3&                                     
    ENDPERFORM                                               
    Here includename is your include type program.
    u need to write this code in your include type program..
    FORM formname TABLES in_par STRUCTURE itcsy
                            out_par STRUCTURE itcsy.
    data : var1 like field1,
           var2 like field2,
           var3 like field3.
      READ TABLE in_par WITH KEY 'field1'.
      CHECK sy-subrc = 0.
      var1 = in_par-value.
      READ TABLE in_par WITH KEY 'field2'.
      CHECK sy-subrc = 0.
      var2 = in_par-value.
    now u can call corresponding function using local VAR1 and VAR2. Here u can pass N no of USING parameters.
    After processing on VAR3...
      READ TABLE out_par WITH KEY 'field3'.
      out_par-value = VAR3.
      MODIFY out_par INDEX sy-tabix.
    EndForm.
    Here in_par and out_par are the structures which will be used to communicate with SAPScript. And this is the only way as per my view.
    I m sure this code will work fine. Here i have used dummy variables that u need to change as per your requirement. If u have more queries write me back.
    And yes if this works than dont forget to give the points.
    Regards,
    Sagar

  • Call function from data base with clob input parameter.

    Hello,
    In this project I use Jdev 11g.
    I call function from database.
    create or replace function get_fa_list (
    p_fa_id_list in clob
    return sys_refcursor
    is
    vCursor sys_refcursor;
    begin
    put_msg ('begin');
    if p_fa_id_list is null then
    put_msg ('CLOB is null!');
    else
    put_msg ('size CLOB: ' || dbms_lob.getlength (p_fa_id_list));
    end if;
    put_msg ('Save');
    open vCursor for
    select rownum as id, s.*
    from (
    select f.latitude, f.longitude, count (distinct f.res_id) as res_count, count (*) as fa_count, 16711680 as color, res_concat_distinct (f.res_id) as station_list
    from mv_frequency_assignment f, table (SplitClob (p_fa_id_list, ',')) l
    where f.ext_system = 'BI' and
    f.ext_sys_id = l.column_value
    group by f.latitude, f.longitude
    ) s;
    put_msg ('Open and End');
    return vCursor;
    end get_fa_list;
    I use TopLink in ejb.
    i use follow code for call function and get result.
    public List<TmpResPoints> findAllPointsBI(String p_id){
    UnitOfWork uow = getSessionFactory().acquireUnitOfWork();
    uow.beginEarlyTransaction();
    StoredFunctionCall call = new StoredFunctionCall();
    call.setProcedureName("get_fa_list");
    call.useUnnamedCursorOutputAsResultSet();
    ClobDomain c = new ClobDomain(p_id);
    //System.out.println(c.toString());
    call.addNamedArgumentValue("p_fa_id_list", c);
    ReadAllQuery query = new ReadAllQuery();
    query.setReferenceClass(TmpResPoints.class);
    query.setCall(call);
    List<TmpResPoints> result = (List<TmpResPoints>)uow.executeQuery(query);
    uow.commit();
    uow.release();
    return result;
    But size parameter "p_fa_id_list" is 0. (geting from temp table in Data base). this code in function >>
    if p_fa_id_list is null then
    put_msg ('CLOB is null!');
    else
    put_msg ('size CLOB: ' || dbms_lob.getlength (p_fa_id_list));
    end if;)
    How I can call this function from dataBase and get result?
    thx,
    Demka.

    What is the SQL generated?
    The argument should just be the Clob value (a String) not the domain object.
    Also try addNamedArgument, and then pass the named argument to the query.
    James : http://www.eclipselink.org

  • Calling Ajax from ADF tags

    Hi,
    I posted a problem on calling ajax from ADF tag.
    The link is
    Calling Ajax from ADF tags
    please can any body look into the issue and help me out.
    thanks
    Manjunath
    Edited by: user10568495 on Feb 11, 2009 1:22 AM

    Thanks for the suggestion, i will be following up the original thread.
    thnx
    Manjunath
    Edited by: user10568495 on Feb 11, 2009 1:58 AM

  • Send data to ECC table through RFC Call function from SAP B1 via  b1if

    Hi,
    I have created scenario in B1if which triggers from SAP B1, now I have to send this data in to ECC table, so I have created scenario for that with inbound SAP B1, outbound void and in process RFC Call atom is there but I am not getting data in receiver and also how to write xml to send data in RFC function. Function for RFC has configured from ECC end and have access of that function.
    So please help me to send data to ECC table through RFC Call function from SAP B1 (9.0) via b1if
    Thanks

    Solved by my own.

  • HTML tags in Dynamic Text

    I am planning on building a website in flash with 90 percent
    of the site in dynamic text. Will flash read the html tags in a
    text file as text or html and code it as a browser would.

    yes, Flash will accept HTML tags, and there are a couple of
    different methods to make this work. But in my limited experience,
    it's a little tricky, and both require a little extra Actionscript
    to make them function. I read some info about this in some of the
    tutorials, but I can't point to them at the moment.
    First, one can use use the ' yourtext_txt.htmlText =
    yoursource_txt; ' method to read a plain text line that contains
    HTML tags. However there are some parameters that need to be set up
    before it will function properly, and there are several optionals
    to choose from, but it seems most importantly to set the HTML
    property to true as in ' yourtext_txt.html = true; ' but there
    still are several different things requried, especially if your
    looking for dynamic on-the-fly changes to different sections of
    text. here's a snipit I'd been working on that uses a similar
    system with arrays:
    did that work, huh? thought I was adding code.
    Another method is to use a CSS or by defining your own
    stylesheet tags within Flash Actionscript. This method seems to
    work better when using LoadVars, where you would define the
    ContentStyle. First you define the StyleSheet, then apply it to the
    dynamic text area (I'll try this again), here's a snipit: (OK I
    think i get it the code will attach to the end of this post, so I
    post the second set in a following post)
    These are just some examples though, from my own
    experimentations, and of course onw would define thier own
    variables. I'm no expert, but I hope this gets you going, just a
    few ideas.

  • What is the syntax for calling function from class file by jsp

    does anyone here knows what is the syntax of how to call a function from java class file by javascript code or any way to call it?
    and where should i put the calling function code? because the function is called depend on the user click.
    for example
    <%=pc.functionName(a,b)%>
    for the variable a and b, how can i get the value from html textbox and put it in a and b...
    urgent needed...
    thx

    Jsp's are executed before the Html forms are created and loaded. Dont try to use a java code function calling on a javascript click. You'll have to explicitly redirect it into a servlet where in you can call the function you want.
    Well! another way could be using AJAX. That seems to be powerfull enough and it might also serve your purpose.
    Hope this helps

  • Replace function for HTML tags

    Hie Guys,
    I would like to get rid of the HTML tags from a column/object in my report using the "Replace" function. Basically, I want to replace whatever the content is between "<" & ">" i.e. the opening and closing tags. I know I can use the "Pos" function to identify the position of "<" & ">", but I am not sure exactly how to achieve this in Webi. FYI -  "Read content as HTML" & "Read content as Hyperlink" did not resolve the issue. Can anyone please help? Thanks.

    Hi Jeewan,
    It will be very tedious to do this at Webi level.
    I have tried below example. It might help you to work around your issue; however, not completely:
    1. Created an Excel and inserted single value in first column as:
    <html><b>this is yuvraj</b></html>
    2. Used it as source and created a Webi report in Rich client.
    3. Applied SubStr recursively using Pos function and created below variables:
    test : =Substr([column_1]; Pos([column_1];">")+1;Length([column_1]))
    test1: =Substr([test]; Pos([test];">")+1;Length([test]))
    test2 : =Substr([test1]; 0;Pos([test1];"<")-1)
    The output has been attached.

  • Calling function from Backing Bean or JSP page

    We are on Jdeveloper 10.1.3.3.0, ADF Faces, JSF Faces .., Currently there is a function call from Javascript event (onmouseover) in the JSP page. I want to call this function from a backing bean or JSP page, as I have to pass some values to this function.
    For Ex., I have a function call like return submit('A','B','Test'); on the Javascript event (onmouseover) in jsp page. I want to remove this function from the javascript event and call from backing bean or jsp page to pass some values into the submit() function. I appreciate if anyone can give some example of how to call this function from backing bean or jsp page in the <SCRIPT> or <SCRIPTLET>
    Thanks,
    Ram

    A use case would be helpful so that we can get a better idea of what you want to do.
    As a general rule, there is no way to call a client side Javascript function from a backing bean, which is server side. However, there are ways to inject information from a backing bean into your Javascript call. For instance, I have an application that uses Google Maps API. It has an onload call to a Javascript function that builds the map and designates it's center point. The center point comes from a backing bean as latitude and longitude properties. So here is my body tag:
    <afh:body onload="initialize(#{backing_searchResults.latitude},#{backing_searchResults.longitude},#{searchCriteria.distance})"
              onunload="GUnload()">onload calls the Javascript function called initialize, and passes the latitude, longitude, and distance from the bean. Is the function really being called from my backing bean? No - the parameters are hard coded into the onload event code when the page is rendered. Does it do the job? Sure it does.

  • Call Function From MXML Component

    I am using MXML to create components that I use within my
    application. I have one MXML file that contains a list with a
    custom itemRenderer that is in another MXML file. I have an
    actionscript file with a function that I want to call from the
    itemRenderer.
    If I call the function from my main application, everything
    works fine. If I try to call it from one of the other MXML files, I
    get a 1180 Call to a possibly undefined function error.
    Is there a special way that I need to use to call the
    function?
    The main MXML file is in the root directory, the actionscript
    file is in a folder called functions, and the MXML files are in a
    folder called components.
    Thank you for any help.

    I was able to figure out my problem. It was just a simple
    typo of including the wrong file in a Script tag. However, this
    caused more issues and I ended up having to rewrite a large section
    of code to get everything working.
    Thank you for your help.

  • Calling function from list of values section?

    can i call a function from list of values(LOV) section as well? I know we can sql query but udf is supported?

    See this recent thread: Display as Text (LOV) or join
    Scott

  • Calling function from PL/SQL block

    Hi,
    A very simple question.
    A have a function called "test1" in my database. It is there i double chekked.
    I would like to call this function from a block:
    DECLARE
    BEGIN
    TEST1(1202);
    END;
    This gives me an error.
    Why is this?

    user610868 wrote:
    Hi,
    A very simple question.
    A have a function called "test1" in my database. It is there i double chekked.
    I would like to call this function from a block:
    DECLARE
    BEGIN
    TEST1(1202);
    END;
    This gives me an error.
    Why is this?Hello
    A very very basic thing to do when you get an error is to include details of it. That helps narrow it down from one of the 1000s of potential Oracle errors it could be.
    Anyway, a function returns a value, and in PL/SQL you need to capture that otherwise you'll get "an error". Modify your code like so
    DECLARE
       l_Test1Val     VARCHAR2(4000); --CHANGE THIS TO BE THE SAME AS THE RETURN TYPE FOR YOUR FUNCTION
    BEGIN
       l_Test1Val :=  TEST1(1202);
    END;HTH
    David
    Edited by: Bravid on Oct 25, 2011 3:57 PM
    removed a ;

  • Calling Functions From Import Integration Script

    I've got an import integration script that runs fine, however I also have several DataPump scripts that are used in FDM to change specific columns as they come in. I can take the code from the scripts and add to the Import Integration script, but I would rather just call those other functions from the VBScript. I don't see any docs on this, and I'm just wondering if anyone has done this or can describe how I can do it.
    Is it possible? Since the standard import scripts reference the strField and the strRecord, can these functions be called from the import integration script?

    strField and strRecord are arguments passed by the application to the import function. The represent the field as defined by the import format and the record that is being processed during the import.
    Given that, I'm not sure how to answer your question.

  • Calling function from sql folder vs report

    Hi,
    A report based on a custom sql folder is taking a long time to run. One of the things that I noticed is that when I run the sql in plsql it takes a long time, but if I remove the row where I call a function, it runs pretty quickly.
    In general, is there a difference between running a function from the sql custom folder and calling it from the report itself?
    Thanks.
    Leah

    Hi Tamir,
    I might check out the execution plans, but truthfully, understanding the plans and the meaning of the differences is not my strong point.
    I thought that maybe there was some general rule that, for instance, it is better to keep functions out of the sql folder and use them in a condition in the report itself, or the opposite, or that maybe it makes no difference at all.
    I appreciate the response.
    Thanks.
    Leah

Maybe you are looking for

  • Voice memo icon

    The voice memo icon on my nano seems to disappear and reappear at will. It's weird, I'm not too worried about it cuz I seldom use voice memo. I think it might be a glitch, I've restored and it still happens. This happening to anyone else?

  • IMac G4 as monitor for Mac Mini

    Is it possible to use an older G4 or G5 iMac as the screen for a new Mac Mini? It works great for my Grandson, except for some newer games.

  • How to create a stock purchase order ?

    Hi, I would like to create a stock PO to replenish stock and thus without any account information. What Account Assignment category and Item Category do i have to select to create my stock PO ? Thanks for your help, Kind regards, Yann

  • Traces are not being generated

    hi, I have 9.1.0.8 database on windows 2003 (32 bit). I am suing following statement to start system wide tracing but i don't see any tarces being generated at user_dump_dest location. any idea what is going wrong and what thing i am missing? ALTER S

  • Why  ipod displays do not disconnect and wont sync but can be restored?

    why  ipod displays do not disconnect and wont sync but can be restored?