---
title: Modifying atoms
framework: QuickTime File Format
role: article
role_heading: Article
path: quicktime-file-format/modifying_atoms
---

# Modifying atoms

Modify attributes or data associated with an atom in an atom container.

## Overview

Overview TextQuickTime provides functions that you can call to modify attributes or data associated with an atom in an atom container. To modify an atom’s ID, you call the function QTSetAtomID. You use the QTSetAtomData function to update the data associated with a leaf atom in an atom container. The QTSetAtomData function replaces a leaf atom’s data with new data. The code sample in the following listing calls QTFindChildByIndex to determine whether an atom container contains a sprite’s visible property. If so, the sample calls QTSetAtomData to replace the atom’s data with a new visible property. QTAtom propertyAtom;   // if the atom isn’t in the container, add it if ((propertyAtom = QTFindChildByIndex (sprite, kParentAtomIsContainer,     kSpritePropertyVisible, 1, nil)) == 0)     FailOSErr (QTInsertChild (sprite, kParentAtomIsContainer,         kSpritePropertyVisible, 1, 0, sizeof(short), visible, nil))   // if the atom is in the container, replace its data else     FailOSErr (QTSetAtomData (sprite, propertyAtom, sizeof(short),         visible));

## See Also

### Managing atoms

- [Creating new atoms](quicktime-file-format/creating_new_atoms.md)
- [Copying existing atoms](quicktime-file-format/copying_existing_atoms.md)
- [Retrieving atoms from an atom container](quicktime-file-format/retrieving_atoms_from_an_atom_container.md)
- [Removing atoms from an atom container](quicktime-file-format/removing_atoms_from_an_atom_container.md)
