Visualizzazione dei risultati da 1 a 5 su 5
  1. #1

    Utilizzo di replaceText

    ragazzi avrei bisogno di utilizzare un replaceText in flash per intenderci come lo utilizzo in asp.

    Ad esempio vorrei in una stringa di testo, sostituire una parola con un'altra.

    hop provato in diversi modi...ma non ottengo il risultato...consigli?
    Despite of my rage i'm still just a rat in a cage

  2. #2

  3. #3
    Utente di HTML.it
    Registrato dal
    Mar 2002
    Messaggi
    20
    Anch'io ho la stessa necessità e da quel link di Andreass non mi è così chiaro...
    Consigli anche per me, grazie!

  4. #4
    Utente di HTML.it L'avatar di and80
    Registrato dal
    Mar 2003
    Messaggi
    15,182
    il link di Andreass era una prototype che faceva quello che fà dal flash7 proprio il replaceText

    codice:
    TextField.replaceText()
    Availability
    
    Flash Player 7.
    Usage
    
    my_txt.replaceText(beginIndex:Number, endIndex:Number, text:String) : Void
    
    Description
    
    Method; replaces a range of characters, specified by the beginIndex and endIndex parameters, in the specified text field with the contents of the text parameter.
    Example
    
    The following example creates a text field called my_txt and assigns the text dog@house.net to the field. The indexOf() method is used to find the first occurrence of the specified symbol (@). If the symbol is found, the specified text (between the index of 0 and the symbol) replaces with the string bird. If the symbol is not found, an error message is displayed in the Output panel.
    
    this.createTextField("my_txt", this.getNextHighestDepth(), 10, 10, 320, 22);
    my_txt.autoSize = true;
    my_txt.text = "dog@house.net";
    
    var symbol:String = "@";
    var symbolPos:Number = my_txt.text.indexOf(symbol);
    if (symbolPos>-1) {
       my_txt.replaceText(0, symbolPos, "bird");
    } else {
       trace("symbol '"+symbol+"' not found.");
    }
    questo è quello che dice la macromedia riguardo al replaceText

  5. #5
    Utente di HTML.it
    Registrato dal
    Mar 2002
    Messaggi
    20
    Avevo già risolto intervenendo sull'ASP prima ancora di passarlo a Flash via XML.
    Comunque ti ringrazio dell'indicazione che sicuramente mi tornerà utile in futuro!
    raffaello

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.