Adobe Extending Flash Professional CS5 Manuel d'utilisateur Page 278

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 565
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 277
256
EXTENDING FLASH PROFESSIONAL
flash object (fl)
Last updated 5/2/2011
fl.selectElement()
Availability
Flash CS3 Professional.
Usage
fl.selectElement(elementObject, editMode)
Parameters
elementObject The Element object you want to select.
editMode A Boolean value that specifies whether you want to edit the element (true) or want only to select it (false).
Returns
A Boolean value of true if the element was successfully selected; false otherwise.
Description
Method; enables selection or editing of an element. Generally, you will use this method on objects returned by
fl.findObjectInDocByName() or fl.findObjectInDocByType().
Example
The following example selects an element named "second text field" if one is found in the document:
var nameToSearchFor = "second text field";
var doc = fl.getDocumentDOM();
// Start by viewing Scene 1 (index value of 0).
document.editScene(0);
// Search for element by name.
var results = fl.findObjectInDocByName(nameToSearchFor, doc);
if (results.length > 0) {
// Select the first element found.
// Pass false, so the symbolInstance you are searching for is selected.
// If you pass true, the symbol instance will switch to edit mode.
fl.selectElement(results[0], false);
alert("success, found " + results.length + " objects")
}
else {
alert("failed, no objects with name "" + nameToSearchFor + "" found");
}
See also
fl.findObjectInDocByName(), fl.findObjectInDocByType()
fl.selectTool()
Availability
Flash CS3 Professional.
Vue de la page 277
1 2 ... 273 274 275 276 277 278 279 280 281 282 283 ... 564 565

Commentaires sur ces manuels

Pas de commentaire