Dynamically create movieclips

I want to be able to dynamically create movieclips in flash based on a midi file.
So I converted the midi file to an .xml file first. I traced the number of events going on and the time of when an event starts or ends.
So to keep track of those times, I put them in an array.(keytimer[i])
The timer goes up 1microsecond at a time, for as long as the song is; in this case 190080 microseconds.
The thing I want is when the timer equals a number in this array(keytimer[i]), and only when the attribute is 'NoteOn', then it should create a movieclip.
I tried doing it like this; but he doesnt recognise the array:
if (current==keytimer[i]) {
trace("yes");
Any help is more than welcome
Flash file:
var xmlLoader:URLLoader = new URLLoader();xmlLoader.addEventListener(Event.COMPLETE, showXML);xmlLoader.load(new URLRequest("for_elise_by_beethoven.xml"));function showXML(e:Event):void { XML.ignoreWhitespace=true; var songs:XML=new XML(e.target.data); trace(songs.Track.Event.length()); var i:Number; var keytimer:Array = new Array(); for (i=0; i < songs.Track.Event.length(); i++) { keytimer[i] =(" Time of the key: "+ songs.Track.Event[i].Absolute.text()); if (current==keytimer[i]) { trace("yes"); } //trace(keytimer[i]); //trace(" NoteOn: "+ songs.Track.Event[i].NoteOn.@Note); //trace(" NoteOff: "+ songs.Track.Event[i].NoteOff.@Note); //trace(" "); } var myTimer:Timer=new Timer(1,190000); myTimer.addEventListener(TimerEvent.TIMER,doStuff); var current:Number=0; myTimer.start(); function doStuff(event:TimerEvent):void { current++; trace("current: "+ current); trace("keytimer: "+ keytimer[i]); //trace("keytimer: "+ keytimer[i]); /*if (current==keytimer[i]) { trace("yes"); }*/  }}
The current xml file: (name: for_elise_by_beethoven.xml)
<?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE MIDIFile PUBLIC  "-//Recordare//DTD MusicXML 0.9 MIDI//EN"  "http://www.musicxml.org/dtds/midixml.dtd"><MIDIFile><Format>1</Format><TrackCount>4</TrackCount><TicksPerBeat>960</TicksPerBeat><TimestampType>Absolute</TimestampType><Track Number="0">  <Event>    <Absolute>0</Absolute>    <SequencerSpecific>05 0f 12 00 00 7f 7f 00</SequencerSpecific>  </Event>  <Event>    <Absolute>0</Absolute>    <SequencerSpecific>05 0f 1c 32 30 30 35 2e 31 32 2e 30 32</SequencerSpecific>  </Event>  <Event>    <Absolute>0</Absolute>    <TrackName>Track 0</TrackName>  </Event>  <Event>    <Absolute>0</Absolute>    <SetTempo Value="857143"/>  </Event>  <Event>    <Absolute>0</Absolute>    <EndOfTrack/>  </Event></Track><Track Number="1">  <Event>    <Absolute>0</Absolute>    <ProgramChange Channel="1" Number="0"/>  </Event>  <Event>    <Absolute>0</Absolute>    <SequencerSpecific>05 0f 09 40 48</SequencerSpecific>  </Event>  <Event>    <Absolute>0</Absolute>    <CopyrightNotice>2006 by forelise.com</CopyrightNotice>  </Event>  <Event>    <Absolute>0</Absolute>    <InstrumentName>Piano</InstrumentName>  </Event>  <Event>    <Absolute>0</Absolute>    <TrackName>Für Elise</TrackName>  </Event>  <Event>    <Absolute>0</Absolute>    <SequencerSpecific>05 0f 06 47 65 6e 65 72 61 6c 20 4d 49 44 49</SequencerSpecific>  </Event>  <Event>    <Absolute>0</Absolute>    <TimeSignature Numerator="3" LogDenominator="3" MIDIClocksPerMetronomeClick="12" ThirtySecondsPer24Clocks="8"/>  </Event>  <Event>    <Absolute>0</Absolute>    <MIDIChannelPrefix Value="00"/>  </Event>  <Event>    <Absolute>960</Absolute>    <NoteOn Channel="1" Note="76" Velocity="71"/>  </Event>  <Event>    <Absolute>1200</Absolute>    <NoteOff Channel="1" Note="76" Velocity="0"/>  </Event>  <Event>    <Absolute>1200</Absolute>    <NoteOn Channel="1" Note="75" Velocity="38"/>  </Event>  <Event>    <Absolute>1440</Absolute>    <NoteOff Channel="1" Note="75" Velocity="0"/>  </Event>  <Event>    <Absolute>1440</Absolute>    <NoteOn Channel="1" Note="76" Velocity="57"/>  </Event>  <Event>    <Absolute>1680</Absolute>    <NoteOff Channel="1" Note="76" Velocity="0"/>  </Event>  <Event>    <Absolute>1680</Absolute>    <NoteOn Channel="1" Note="75" Velocity="70"/>  </Event>  <Event>    <Absolute>1920</Absolute>    <NoteOff Channel="1" Note="75" Velocity="0"/>  </Event>  <Event>    <Absolute>1920</Absolute>    <NoteOn Channel="1" Note="76" Velocity="76"/>  </Event>  <Event>    <Absolute>2160</Absolute>    <NoteOff Channel="1" Note="76" Velocity="0"/>  </Event>  <Event>    <Absolute>2160</Absolute>    <NoteOn Channel="1" Note="71" Velocity="76"/>  </Event>  <Event>    <Absolute>2400</Absolute>    <NoteOff Channel="1" Note="71" Velocity="0"/>  </Event>  <Event>    <Absolute>2400</Absolute>    <NoteOn Channel="1" Note="74" Velocity="76"/>  </Event>  <Event>    <Absolute>2640</Absolute>    <NoteOff Channel="1" Note="74" Velocity="0"/>  </Event>  <Event>    <Absolute>2640</Absolute>    <NoteOn Channel="1" Note="72" Velocity="83"/>  </Event>  <Event>    <Absolute>2880</Absolute>    <NoteOff Channel="1" Note="72" Velocity="0"/>  </Event>  <Event>    <Absolute>2880</Absolute>    <NoteOn Channel="1" Note="69" Velocity="89"/>  </Event>  <Event>    <Absolute>2880</Absolute>    <SequencerSpecific>05 0f 0f 02</SequencerSpecific>  </Event>  <Event>    <Absolute>2880</Absolute>    <NoteOn Channel="1" Note="45" Velocity="64"/>  </Event>  <Event>    <Absolute>3120</Absolute>    <NoteOff Channel="1" Note="45" Velocity="0"/>  </Event>  <Event>    <Absolute>3120</Absolute>    <NoteOn Channel="1" Note="52" Velocity="64"/>  </Event>  <Event>    <Absolute>3360</Absolute>    <NoteOff Channel="1" Note="52" Velocity="0"/>  </Event>  <Event>    <Absolute>3360</Absolute>    <NoteOn Channel="1" Note="57" Velocity="70"/>  </Event>  <Event>    <Absolute>3600</Absolute>    <NoteOff Channel="1" Note="69" Velocity="0"/>  </Event>  <Event>    <Absolute>3600</Absolute>    <NoteOff Channel="1" Note="57" Velocity="0"/>  </Event>  <Event>    <Absolute>3600</Absolute>    <NoteOn Channel="1" Note="60" Velocity="76"/>  </Event>  <Event>    <Absolute>3840</Absolute>    <NoteOff Channel="1" Note="60" Velocity="0"/>  </Event>  <Event>    <Absolute>3840</Absolute>    <NoteOn Channel="1" Note="64" Velocity="76"/>  </Event>  <Event>    <Absolute>4080</Absolute>    <NoteOff Channel="1" Note="64" Velocity="0"/>  </Event>  <Event>    <Absolute>4080</Absolute>    <NoteOn Channel="1" Note="69" Velocity="76"/>  </Event>  <Event>    <Absolute>4320</Absolute>    <NoteOff Channel="1" Note="69" Velocity="0"/>  </Event>  <Event>    <Absolute>4320</Absolute>    <NoteOn Channel="1" Note="71" Velocity="83"/>  </Event>  <Event>    <Absolute>4320</Absolute>    <SequencerSpecific>05 0f 0f 02</SequencerSpecific>  </Event>  <Event>    <Absolute>4320</Absolute>    <NoteOn Channel="1" Note="40" Velocity="64"/>  </Event>  <Event>    <Absolute>4560</Absolute>    <NoteOff Channel="1" Note="40" Velocity="0"/>  </Event>  <Event>    <Absolute>4560</Absolute>    <NoteOn Channel="1" Note="52" Velocity="64"/>  </Event>  <Event>    <Absolute>4800</Absolute>    <NoteOff Channel="1" Note="52" Velocity="0"/>  </Event>  <Event>    <Absolute>4800</Absolute>    <NoteOn Channel="1" Note="56" Velocity="70"/>  </Event>  <Event>    <Absolute>5040</Absolute>    <NoteOff Channel="1" Note="71" Velocity="0"/>  </Event>  <Event>    <Absolute>5040</Absolute>    <NoteOff Channel="1" Note="56" Velocity="0"/>  </Event>  <Event>    <Absolute>5040</Absolute>    <NoteOn Channel="1" Note="64" Velocity="76"/>  </Event>  <Event>    <Absolute>5280</Absolute>    <NoteOff Channel="1" Note="64" Velocity="0"/>  </Event>  <Event>    <Absolute>5280</Absolute>    <NoteOn Channel="1" Note="68" Velocity="76"/>  </Event>  <Event>    <Absolute>5520</Absolute>    <NoteOff Channel="1" Note="68" Velocity="0"/>  </Event>  <Event>    <Absolute>5520</Absolute>    <NoteOn Channel="1" Note="71" Velocity="76"/>  </Event>  <Event>    <Absolute>5760</Absolute>    <NoteOff Channel="1" Note="71" Velocity="0"/>  </Event>  <Event>    <Absolute>5760</Absolute>    <NoteOn Channel="1" Note="72" Velocity="83"/>  </Event>  <Event>    <Absolute>5760</Absolute>    <NoteOn Channel="1" Note="45" Velocity="64"/>  </Event>  <Event>    <Absolute>6000</Absolute>    <NoteOff Channel="1" Note="45" Velocity="0"/>  </Event>  <Event>    <Absolute>6000</Absolute>    <NoteOn Channel="1" Note="52" Velocity="70"/>  </Event>  <Event>    <Absolute>6240</Absolute>    <NoteOff Channel="1" Note="52" Velocity="0"/>  </Event>  <Event>    <Absolute>6240</Absolute>    <NoteOn Channel="1" Note="57" Velocity="76"/>  </Event>  <Event>    <Absolute>6480</Absolute>    <NoteOff Channel="1" Note="72" Velocity="0"/>  </Event>  <Event>    <Absolute>6480</Absolute>    <NoteOff Channel="1" Note="57" Velocity="0"/>  </Event>  <Event>    <Absolute>6480</Absolute>    <NoteOn Channel="1" Note="64" Velocity="76"/>  </Event>  <Event>    <Absolute>6720</Absolute>    <NoteOff Channel="1" Note="64" Velocity="0"/>  </Event>  <Event>    <Absolute>6720</Absolute>    <NoteOn Channel="1" Note="76" Velocity="76"/>  </Event>  <Event>    <Absolute>6960</Absolute>    <NoteOff Channel="1" Note="76" Velocity="0"/>  </Event>  <Event>    <Absolute>6960</Absolute>    <NoteOn Channel="1" Note="75" Velocity="64"/>  </Event>  <Event>    <Absolute>7200</Absolute>    <NoteOff Channel="1" Note="75" Velocity="0"/>  </Event>  <Event>    <Absolute>7200</Absolute>    <NoteOn Channel="1" Note="76" Velocity="76"/>  </Event>  <Event>    <Absolute>7440</Absolute>    <NoteOff Channel="1" Note="76" Velocity="0"/>  </Event>  <Event>    <Absolute>7440</Absolute>    <NoteOn Channel="1" Note="75" Velocity="70"/>  </Event>  <Event>    <Absolute>7680</Absolute>    <NoteOff Channel="1" Note="75" Velocity="0"/>  </Event>  <Event>    <Absolute>7680</Absolute>    <NoteOn Channel="1" Note="76" Velocity="76"/>  </Event>  <Event>    <Absolute>7920</Absolute>    <NoteOff Channel="1" Note="76" Velocity="0"/>  </Event>  <Event>    <Absolute>7920</Absolute>    <NoteOn Channel="1" Note="71" Velocity="76"/>  </Event>  <Event>    <Absolute>8160</Absolute>    <NoteOff Channel="1" Note="71" Velocity="0"/>  </Event>  <Event>    <Absolute>8160</Absolute>    <NoteOn Channel="1" Note="74" Velocity="76"/>  </Event>  <Event>    <Absolute>8400</Absolute>    <NoteOff Channel="1" Note="74" Velocity="0"/>  </Event>  <Event>    <Absolute>8400</Absolute>    <NoteOn Channel="1" Note="72" Velocity="76"/>  </Event>  <Event>    <Absolute>8640</Absolute>    <NoteOff Channel="1" Note="72" Velocity="0"/>  </Event>  <Event>    <Absolute>8640</Absolute>    <NoteOn Channel="1" Note="69" Velocity="83"/>  </Event>  <Event>    <Absolute>8640</Absolute>    <SequencerSpecific>05 0f 0f 02</SequencerSpecific>  </Event>  <Event>    <Absolute>8640</Absolute>    <NoteOn Channel="1" Note="45" Velocity="57"/>  </Event>  <Event>    <Absolute>8880</Absolute>    <NoteOff Channel="1" Note="45" Velocity="0"/>  </Event>  <Event>    <Absolute>8880</Absolute>    <NoteOn Channel="1" Note="52" Velocity="64"/>  </Event>  <Event>    <Absolute>9120</Absolute>    <NoteOff Channel="1" Note="52" Velocity="0"/>  </Event>  <Event>    <Absolute>9120</Absolute>    <NoteOn Channel="1" Note="57" Velocity="70"/>  </Event>  <Event>    <Absolute>9360</Absolute>    <NoteOff Channel="1" Note="69" Velocity="0"/>  </Event>  <Event>    <Absolute>9360</Absolute>    <NoteOff Channel="1" Note="57" Velocity="0"/>  </Event>  <Event>    <Absolute>9360</Absolute>    <NoteOn Channel="1" Note="60" Velocity="76"/>  </Event>  <Event>    <Absolute>9600</Absolute>    <NoteOff Channel="1" Note="60" Velocity="0"/>  </Event>  <Event>    <Absolute>9600</Absolute>    <NoteOn Channel="1" Note="64" Velocity="76"/>  </Event>  <Event>    <Absolute>9840</Absolute>    <NoteOff Channel="1" Note="64" Velocity="0"/>  </Event>  <Event>    <Absolute>9840</Absolute>    <NoteOn Channel="1" Note="69" Velocity="76"/>  </Event>  <Event>    <Absolute>10080</Absolute>    <NoteOff Channel="1" Note="69" Velocity="0"/>  </Event>  <Event>    <Absolute>10080</Absolute>    <NoteOn Channel="1" Note="71" Velocity="83"/>  </Event> 
          ...ETC...
  <Event>    <Absolute>185040</Absolute>    <NoteOff Channel="1" Note="56" Velocity="0"/>  </Event>  <Event>    <Absolute>185040</Absolute>    <NoteOn Channel="1" Note="64" Velocity="51"/>  </Event>  <Event>    <Absolute>185280</Absolute>    <NoteOff Channel="1" Note="64" Velocity="0"/>  </Event>  <Event>    <Absolute>185280</Absolute>    <NoteOn Channel="1" Note="72" Velocity="51"/>  </Event>  <Event>    <Absolute>185520</Absolute>    <NoteOff Channel="1" Note="72" Velocity="0"/>  </Event>  <Event>    <Absolute>185520</Absolute>    <NoteOn Channel="1" Note="71" Velocity="51"/>  </Event>  <Event>    <Absolute>185733</Absolute>    <ControlChange Channel="1" Control="64" Value="127"/>  </Event>  <Event>    <Absolute>185760</Absolute>    <NoteOff Channel="1" Note="71" Velocity="0"/>  </Event>  <Event>    <Absolute>185760</Absolute>    <SequencerSpecific>05 0f 0e</SequencerSpecific>  </Event>  <Event>    <Absolute>185760</Absolute>    <NoteOn Channel="1" Note="60" Velocity="45"/>  </Event>  <Event>    <Absolute>185760</Absolute>    <NoteOn Channel="1" Note="69" Velocity="45"/>  </Event>  <Event>    <Absolute>185760</Absolute>    <NoteOn Channel="1" Note="45" Velocity="45"/>  </Event>  <Event>    <Absolute>185760</Absolute>    <NoteOn Channel="1" Note="33" Velocity="45"/>  </Event>  <Event>    <Absolute>187200</Absolute>    <NoteOff Channel="1" Note="45" Velocity="0"/>  </Event>  <Event>    <Absolute>187200</Absolute>    <NoteOff Channel="1" Note="33" Velocity="0"/>  </Event>  <Event>    <Absolute>187200</Absolute>    <NoteOff Channel="1" Note="60" Velocity="0"/>  </Event>  <Event>    <Absolute>187200</Absolute>    <NoteOff Channel="1" Note="69" Velocity="0"/>  </Event>  <Event>    <Absolute>190048</Absolute>    <ControlChange Channel="1" Control="64" Value="0"/>  </Event>  <Event>    <Absolute>190080</Absolute>    <SequencerSpecific>05 0f 0a</SequencerSpecific>  </Event>  <Event>    <Absolute>190080</Absolute>    <EndOfTrack/>  </Event></Track><Track Number="2">  <Event>    <Absolute>0</Absolute>    <SequencerSpecific>05 0f 09 00 40</SequencerSpecific>  </Event>  <Event>    <Absolute>0</Absolute>    <SequencerSpecific>05 0f 06 47 65 6e 65 72 61 6c 20 4d 49 44 49</SequencerSpecific>  </Event>  <Event>    <Absolute>0</Absolute>    <TrackName>http://www.forelise.com/</TrackName>  </Event>  <Event>    <Absolute>0</Absolute>    <TimeSignature Numerator="3" LogDenominator="3" MIDIClocksPerMetronomeClick="12" ThirtySecondsPer24Clocks="8"/>  </Event>  <Event>    <Absolute>0</Absolute>    <ProgramChange Channel="2" Number="0"/>  </Event>  <Event>    <Absolute>0</Absolute>    <MIDIChannelPrefix Value="01"/>  </Event>  <Event>    <Absolute>0</Absolute>    <EndOfTrack/>  </Event></Track><Track Number="3">  <Event>    <Absolute>0</Absolute>    <SequencerSpecific>05 0f 09 00 40</SequencerSpecific>  </Event>  <Event>    <Absolute>0</Absolute>    <SequencerSpecific>05 0f 06 47 65 6e 65 72 61 6c 20 4d 49 44 49</SequencerSpecific>  </Event>  <Event>    <Absolute>0</Absolute>    <TrackName>Composed by Ludwig van Beethoven</TrackName>  </Event>  <Event>    <Absolute>0</Absolute>    <TimeSignature Numerator="3" LogDenominator="3" MIDIClocksPerMetronomeClick="12" ThirtySecondsPer24Clocks="8"/>  </Event>  <Event>    <Absolute>0</Absolute>    <ProgramChange Channel="3" Number="0"/>  </Event>  <Event>    <Absolute>0</Absolute>    <MIDIChannelPrefix Value="02"/>  </Event>  <Event>    <Absolute>0</Absolute>    <EndOfTrack/>  </Event></Track></MIDIFile>

var current:int=0;
myTimer.start();
function doStuff(event:TimerEvent):void {
current++;
trace("current: "+ current);
trace("keytimer: "+ keytimer[i]);
//trace("keytimer: "+ keytimer[i]);
if (current==int(keytimer[i)]) {
trace("yes");

Similar Messages

  • How do I reference a dynamically created MovieClip from another MovieClip?

    Hi,
    I'd be grateful for any pointers to the following problem:
         I'm having trouble referencing dynamically created MovieClips (links in a side panel on a Flash website, created from an XML file) from the current MovieClip (the currently selected link).
         I wish to freeze the the link/MovieClip in its mouseOver state once it has been clicked - this part works. When a new link/MovieClip is clicked on, I wish to release the previously clicked-on link from its mouseOver state, which is what I've so far been unable to do.
         My problem seems to be referencing the previous link/MoveClip. I've used the trace statement trace(MovieClip(this).name) to determine that the MovieClips are named item0, item1, item2 and so on. However, I've been unable thus far to reference the previous clip thus far. I've tried to trace the route to the MovieClip from the stage, and also tried MovieClip(parent).item0.gotoAndStop and lots of other different permutations, but to no avail. It's the fact they seem to be in a container called 'panel' which is defeating me.
         Here's a live version I've uploaded, which might explain the problem better. Click on "UBER UNS" in the top menu bar to get to the page in question. It's the links on the left-hand side (Historie, Unser Team, etc.) which are the problem. You'll see that once they've been clicked on they remain in their mouseOver state.
         This is the code in question on the fla file, which is a file I did not create myself. The parts in black work fine; it's the red parts where the problem lies:
    import flash.display.MovieClip;
    panel.buttonMode = true;
    var lang:uint = 1;
    var url_Link:String=MovieClip(root).program.websiteXML .language[lang].pages.titlePage[MovieClip(root).program.linkPage].texts.pageList.txt[numT XT].@link;
    var urlPage:Number=Number(MovieClip(root).program.webs iteXML.language[lang].pages.titlePage[MovieClip(root).program.linkPage].texts.pageList.tx t[numTXT].@linkPage);
    var request:URLRequest;
    var linkIndex:uint;
    var lastClickedLink:MovieClip;   //This is supposed to store the last link that has been clicked - it doesn't work
    panel.addEventListener(MouseEvent.CLICK, clicLink);
    panel.addEventListener(MouseEvent.ROLL_OVER, mouseOverLink);
    panel.addEventListener(MouseEvent.ROLL_OUT, mouseOutLink);
    function mouseOverLink(event:MouseEvent):void {
          MovieClip(this).gotoAndPlay('s1');
    function mouseOutLink(event:MouseEvent):void {
          if(numTXT !== (linkIndex - 1)/5){         //freezes mouseOver state if this is the link for the current page
               MovieClip(this).gotoAndPlay('s2');
    function clicLink(event:MouseEvent):void {
          var linkpage:uint = MovieClip(root).program.linkPage;
          if (url_Link) {
               request = new URLRequest(url_Link);
               navigateToURL(request);
          } else {
               linkIndex = numTXT * 5 + 1;
               if(linkpage == 1){
                   MovieClip(root).chPages.cont.page_about_mc.page3Tu  rner_mc.gotoAndStop([linkIndex]);
              } else if (linkpage == 2){
                   MovieClip(root).chPages.cont.page3_mc.page3Turner_  mc.gotoAndStop([linkIndex]);
         lastClickedLink.gotoAndPlay('s2');  // this is supposed to release the previous clicked-on link from it's mouseOver state - doesn't work
         lastClickedLink = MovieClip(this).name;    //this is supposed to set the new link as the last link clicked after the old one has been released from it's mouseOver state - doesn't work
    If anyone can help, that would be great.

    What you might be after for that line is to use:
    lastClickedLink = MovieClip(event.currentTarget);
    For what you show, the name property of an object is a String, so I would expect you to be getting an error regarding trying to get a String to act like a MovieClip when you try to tell it to gotoAndPlay('s2').

  • Accessing dynamically created movieclips

    I have an application that I am adding movieclips to a
    container movieclip through a for loop and repeatedly calling
    myClip.addChild(theNewClip). Now I have a dozen clips in my
    container and it seems like the only way to access the clip is to
    use the getChildByName() method and cast it into a temporary clip
    so I can get at the its properties.
    Is this the best and/or only way to do this? Does the old AS2
    myContainer["theName"].property not work with dynamically created
    movieclips? It doesn't seem to work for me anymore.
    Anyway I am getting the clips now, but I was hoping someone
    could show me a better way to access a dynamically created movie
    clip.

    In AS3, this is probably not much better, but you can
    generically loop through all movie clips:

  • Nesting dynamically created movieclip at runtime?

    Is it possible to nest a movieclip into another dynamically
    created movieclip at runtime? The commented line of code works, but
    I am trying to nest a movieclip after it is created into
    another.

    you can nest movieclips by using your commented code.
    however, you cannot change a movieclip's parentage after it's
    created.
    you can "fake" a parentage change by creating a movieclip
    with the parentage you want, copying its assets to the newly
    created movieclip with the desired parentage and finally removing
    the original movieclip.

  • Removing dynamically created movieclips

    The following dynamically creates a set of movieclips that
    I'm using instead of the list component. Each clip has an embedded
    text field(txt) that displays the title of an RSS feed. I have
    multiple RSS feeds that I want to load however, and when a seperate
    button is clicked, I want to delete the above mentioned mc's so
    that they can be replaced by new ones. I have tried loading the
    values into an array, then clearing the array when the button is
    clicked, but the mc's still remain.

    I thought about my methods this morning at breakfast.
    Eventually, the list will grow to a size too big for the
    stage. I'm going to need a container so that I can scroll through
    the items at some point.
    I may as well add a listener to each button created that will
    load a specific container to nest the lists. When a different
    button is clicked I can simply use the removedChild(container) and
    get rid of the movies in one fell swoop as opposed to identifying
    each one for removal. The container can easily be controlled and
    scrolled using its y value as well.
    I have yet to work with this but I can think of an issue
    already. If I register the container at the top, my dynamic mc
    lists will start there, each with an increase in y value. The top
    of that container will become the limit for scrolling upwards.
    How will I note a y value to indicate the bottom of the lists
    for scrolling purposes? Each button will load a container with a
    unique amount of mc lists.

  • Dynamically created Text field inside of empty Movieclip

    Hi there.
    My goal is to have a button that, when clicked, an empty
    movieclip is created and a text field is attached to it.
    I could write it easily if the newly created instance names
    where hard coded, the problem comes with the syntax to generate
    them dynamically.
    Here's the code i have so far:
    ActionScript Code:
    button.onRelease = function() {
    createText();
    var count:Number = 1;
    createText = function () {
    _root.createEmptyMovieClip("placeholder"+count,this.getNextHighestDepth());
    this["placeholder"+count].createTextField("my_txt"+count,
    this.getNextHighestDepth(), 100, 100, 100, 100); count++;
    After that's done i still need to assign a text value to the
    text field, which i have no clue on how to do it...
    In other words I want to accomplish something like:
    placeholder[count].my_txt[count].text = "my text";
    I hope it's not confusing... Any help would be greatly
    appreciated.
    Thanks in advance!

    if your createText() function isn't working the way you want
    check your use of "this" and "_root". if they're not the same,
    you're not referencing your newly created movieclip correctly. and
    your textfield depth isn't what you really want, but it should work
    ok.

  • Dynamically create varying number of buttons

    Hi.
    The website I'm currently working on has an object gallery.
    Whenever the user clicks one of the objects, it zooms in and
    displays a sub-gallery with other images of said object. The images
    that make up these galleries are loaded into dynamically created
    empty MovieClips inside a sub-gallery MovieClip. Each object has a
    varying number of images and they're loaded and unloaded when the
    zooming in/out of the object ends.
    When you click one of the sub-gallery images, the main image
    should change and display the clicked image. However, I'm having
    trouble telling the MovieClips containing the sub-gallery images to
    do anything when they're clicked. See attached code, please.
    I'm guessing this has to do with the onRelease being declared
    inside the onMotionFinished. The thing is I can't thing of a way to
    declare the onRelease for every sub-gallery image before they're
    loaded.
    Thanks in advance.

    Frank,
    Thank you for the response.
    On the page2 of the pdf link you provided there is a picture of the tree table and it shows the hierarchy of the first level(or root) parent (President, Steven King). If the data had n presidents (n first or root level ) then this will dispaly all data in the same tree table like
    King
    --Kochhar
    ----Greenberge
    King 2
    --report 1
    ----report 1.1
    King n
    --report n
    ----report n.1
    My requirement is pretty close to this but slighly different where these n first level should appear in n different tree tables like below:
    Treetable for: King
    King
    --Kochhar
    ----Greenberge
    Treetable for: King 2
    King 2
    --report 1
    ----report 1.1
    Treetable for: King n
    King n
    --report n
    ----report n.1
    That is the reason why I am playing with af:forEach and also have a separate VO which returns all the presidents(first level parents) and view linked that to EmployeesVO so that the AM looks like
    AllPresidentsVO
    -----EmployeesVO (with the view criteria wihch returns the first level parents)
    ---------reportingManagers
    forEach prints n instances for PresidentsVO King, King2.. King n but all these instances have the same children the tree for King (tree for King2 ... King n does not appear)
    May be it should be achieved in a different way?

  • Passing variables from a dynamically created textinput in AS2?

    Hey everyone,
    I have a contact form in my flash file with name/email/message fields which a user can fill out and then click send, which passes these to a php script which then emails the information that they entered. This works fine when the text inputs are manually placed on the stage and all the information is passed to the php script and emailed to me. I am just updating it so the textinputs are created via AS2 so that I can style them more easily etc. This is fine however when created via script they no longer get passed to my php file. I am creating the textinput using the following code (which works fine):
    var my_fmt:TextFormat = new TextFormat();
    my_fmt.bold = false;
    my_fmt.font = "Arial";
    my_fmt.color = inputcol;
    contact_form.createTextField("contact_name", getNextHighestDepth(),112.6, 27, 174, 20);
    contact_form.contact_name.wordWrap = true;
    contact_form.contact_name.multiline = false;
    contact_form.contact_name.border = true;
    contact_form.contact_name.borderColor = inputcol;
    contact_form.contact_name.type = "input";
    contact_form.contact_name.setNewTextFormat(my_fmt);
    contact_form.contact_name.text = "";
    FYI I am creating this outside the movieclip containing the form (called contact_form) and then adding it into that mc specifically because I thought this may be necessary as doing it within the mc itself (using this.createTextField....) didn't work, however both seem to have the same effect.
    I am then doing various checks on the input box contents (to make sure it's not empty etc), this also works fine and gives me the relevant error if it is empty so it's accessing it correctly. I then use the following code to submit the variables and check_status checks the success/failure of the php script and alerts the user accordingly:
    loadVariables("http://www.makeaportfolio.com/send_email.php?flashmo=" + random(1000), this, "POST");
    message_status.text = "sending....";
    var interval_id = setInterval(check_status, 400);
    This works fine however does not pick up the value of the dynamically created text input (however does pick up all the text inputs that are manually added to the stage). I am rather confused as to why it's not picking this up and am not sure how I set it to do so, i would be immensely grateful if someone could point me in the right direction?
    Thanks so much for your help as ever,
    Dave

    Hi kglad,
    I'm sorry but i still don't understand what you mean? They are all text inputs which are defined in AS2 (you can see the code in my first post), the values (inputtext.text) are surely set by the user when they enter information into the input boxes. Accessing these works fine within my flash file, they just don't get passed to my php file. I got round this by manually creating duplicate textinputs on the stage for each dynamically created textinput which are all hidden, then assigning the values of the dynamically created inputs to the manually created inputs before loading the php file. This works fine as it picks up the manually placed inputs as local. I assume it's something to do with the scope of the dynamically created inputs but I cannot work out how you would ensure they would be picked up as even when you explicitly create them within the relevant mc it doesn't pick them up. As I say i've managed to get it working in a rather convoluted way which is good but would be most interested to understand why the other method doesn't work.
    Thanks so much for your help,
    Dave

  • Trouble accessing a property of an instance inside a dynamically created MC.

    I’m dynamically creating an instance of a movieclip, call it a game piece. This game piece has 4 frames, each with a movieclip called “base” (although one is red, one blue, one green, one yellow). When the game piece is created I set the frame to indicate player color. I’m also changing the alpha of “base” to 1.0 when it’s being dragged, 0.5 when it’s dropped.
    Using the following code, everything works fine if the game piece color is set to the base in frame 1 (red). If the game piece is created and the timeline moved to a frame other than 1, I throw an error when trying to access base.alpha (this would be the second, third, and fourth instances of base in the game piece timeline). Here’s the strange part, this is only a problem when the game piece is first created and added to the display list. Once created, even after the error has been thrown, I can access the alpha of bases 2, 3, and 4 in the drag start/stop listeners. Here’s a link to the work in progress, and the relevant sections of code (shortened for brevity, t1 is the top left piece on the pallet, others just repeat the same code):
    http://www.appliedcd.com/stormbringergrey/cw/CW_Combat_Sim.html
    var gUnitArray:Array = new Array();
    function initUnitPallet():void {
         t1.addEventListener(MouseEvent.MOUSE_DOWN,popNewUnit);
         // other pieces the same as above
         clanSelect.addEventListener(Event.CHANGE,changeClan);
    function popNewUnit(e:MouseEvent):void {
         var isBase:String = e.target.name;
         var unitType:String = e.target.parent.name;
         if (isBase=="base") {
              var classRef:Class = getDefinitionByName(unitType + "master") as Class;
              var newUnit:MovieClip = new classRef();
              gUnitArray.push(newUnit);
              var newUnitIndex:uint = gUnitArray.length-1;
              this.addChild(gUnitArray[newUnitIndex]);
              gUnitArray[newUnitIndex].gotoAndPlay(clanSelect.selectedItem.data);
              // the following line is a problem if the above gotoAndPlay is anything other than frame 1
              gUnitArray[newUnitIndex].base.alpha = 1.0;
              gUnitArray[newUnitIndex].x = e.stageX;
              gUnitArray[newUnitIndex].y = e.stageY;
              gUnitArray[newUnitIndex].addEventListener(MouseEvent.MOUSE_DOWN,startUnitDrag);
              gUnitArray[newUnitIndex].addEventListener(MouseEvent.MOUSE_UP,stopUnitDrag);
              gUnitArray[newUnitIndex].startDrag();
    function startUnitDrag(e:MouseEvent):void {
         e.currentTarget.base.alpha = 1.0;
         e.currentTarget.startDrag();
    function stopUnitDrag(e:MouseEvent):void {
         e.currentTarget.base.alpha = 0.5;
         e.currentTarget.stopDrag();
    function changeClan(e:Event):void {
         var myClanColor:String = e.target.selectedItem.data
         t1.gotoAndPlay(myClanColor);
         // other pieces the same as above

    Thanks, pointed me in the right direction. I tried implementing a RENDER listener (see commented code below), and it worked, but unreliably. In my case the RENDER event fired before the entire frame was instantiated in about 1 out of 10 tries. I found a bunch of old posts (2007 or so) implying the RENDER event is buggy in Flash at best (apparently it has a better history in Flex). I couldn’t find more recent posts indicating better behavior, but I was unable to eliminate the residual errors in my project.
    Fortunately, while reading I was reminded of the EXIT_FRAME event which seems to work perfectly (but forces me to player 10, not a big deal). Final code below along with proper Z-order control.
    (BTW: I really miss the old forum's code box)
    function initUnitPallet():void {
         t1.addEventListener(MouseEvent.MOUSE_DOWN,popNewUnit);
         clanSelect.addEventListener(Event.CHANGE,changeClan);
    function changeClan(e:Event):void {
         var myClanColor:String = e.target.selectedItem.data
         t1.gotoAndPlay(myClanColor);
    function popNewUnit(e:MouseEvent):void {
         var isBase:String = e.target.name;
         var unitType:String = e.currentTarget.name;
         if (isBase=="base") {
              var classRef:Class = getDefinitionByName(unitType + "master") as Class;
              var newUnit:MovieClip = new classRef();
              gUnitArray.push(newUnit);
              var newUnitIndex:uint = gUnitArray.length-1;
              this.addChild(gUnitArray[newUnitIndex]);
              gUnitArray[newUnitIndex].gotoAndPlay(clanSelect.selectedItem.data);
              gUnitArray[newUnitIndex].x = e.stageX;
              gUnitArray[newUnitIndex].y = e.stageY;
              gUnitArray[newUnitIndex].addEventListener(MouseEvent.MOUSE_DOWN,startUnitDrag);
              gUnitArray[newUnitIndex].addEventListener(MouseEvent.MOUSE_UP,stopUnitDrag);
              gUnitArray[newUnitIndex].addEventListener(Event.EXIT_FRAME,renderUnit);
              // gUnitArray[newUnitIndex].addEventListener(Event.RENDER,renderUnit);
              // stage.invalidate();
              gUnitArray[newUnitIndex].startDrag();
    function renderUnit(e:Event):void {
         e.currentTarget.removeEventListener(Event.EXIT_FRAME,renderUnit);
         // e.currentTarget.removeEventListener(Event.RENDER,renderUnit);
         e.currentTarget.base.alpha = 1.0;
    function startUnitDrag(e:MouseEvent):void {
         if(this.numChildren > 1){
              e.currentTarget.parent.setChildIndex(e.currentTarget,this.numChildren-1);
         e.currentTarget.base.alpha = 1.0;
         e.currentTarget.startDrag();
    function stopUnitDrag(e:MouseEvent):void {
         e.currentTarget.base.alpha = 0.5;
         e.currentTarget.stopDrag();

  • Creating a Function logic for dynamically created XML buttons

    Hi!
    It's me...... again! Now I've dynamically created some buttons using XML. They're spread around the stage and I've modified a tooltip script to give each button a tooltip on Mouse_Over. But to se the logic and make it work using AS3 is hard (for me). I want a function that accept to parameters: Tooltip text and  Object to tooltip.
    In my code I get this error msg when initiating the function on dynamically created buttons:
    1118: Implicit coercion of a value with static type flash.display:Sprite to a possibly unrelated type flash.display:MovieClip.
    I beleive there are more than one thing here needing a fix.
    Can someone have a look and give me a pointer?
    Thanks
    function contentTooltip(ttt:String, ttclip:MovieClip):void {
        ttclip.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
        function mouseOverHandler(e:MouseEvent):void {
            ttip.descr.text=ttt;
            ttip.x=stage.mouseX;
            ttip.y=stage.mouseY-15;
            ttclip.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
            ttclip.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
            ttip.visible = true;
        function mouseOutHandler(e:MouseEvent):void {
            ttip.visible = false;
            ttclip.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
            ttclip.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
        function mouseMoveHandler(e:MouseEvent):void {
            ttip.x=stage.mouseX;
            ttip.y=stage.mouseY-15;
    contentTooltip("Scale button",scale_btn);
    contentTooltip("Hide button",hide_btn);

    I totally agree with what Ned says and suggests. Nevertheless, I would like to support your thinking process.
    From the way you wrote the tooltip functionality it is apparent to me that you conceptualize as a programmer. Again, as Ned said, nested functions are evil. BUT, in a way, what classes accomplish is encapsulation/nesting of properties and functions under the same umbrella. It actually feels that what timeline does in general is nesting named functions within a single function we have no access to.
    How you wrote the code is actually a blueprint for a class that could handle the functionality. You, perhaps, are very ready to start coding with classes - not on the timeline.
    With that said, for the sake of theory, here is how your functionality can be rewritten on timeline:
    scale_btn.toolTip = "Scale button";
    test_btn.toolTip = "Test button";
    hide_btn.toolTip = "Hide button";
    scale_btn.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
    test_btn.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
    hide_btn.addEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
    var overTarget:MovieClip;
    function mouseOverHandler(e:MouseEvent):void {
         overTarget = e.currentTarget;
         ttip.descr.text = overTarget.toolTip;
         ttip.x = stage.mouseX;
         ttip.y = stage.mouseY - 15;
         overTarget.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
         overTarget.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
         setChildIndex(ttip, numChildren - 1);
         ttip.visible = true;
    function mouseOutHandler(e:MouseEvent):void {
         ttip.visible = false;
         overTarget.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
         overTarget.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler); 
    function mouseMoveHandler(e:MouseEvent):void {
         TweenMax.to(ttip, .5, { x:stage.mouseX, ease:Quart.easeOut } );
         TweenMax.to(ttip, .5, { y:stage.mouseY - ttclip.height / 2, ease:Quart.easeOut } );
         //ttip.x=stage.mouseX;
         //ttip.y=stage.mouseY-ttclip.height/2;

  • Problem with embeding the same view in dynamically created view container

    Hello Experts,
                  I am getiing a dump when i try to embed the same view inside the dynamically created view container of
    dynamically created tabs of a tabstrip
    The requirement go like this, i have 2 views in which i have have to embed the 2nd view to view1 where i have an empty
    tabstrip without tabs. During runtime i create tabs as well as view containers accordingly and then try to embed view2 in tabs.
    I have put the below mentioned code in HANDLEIN,
      DATA: lref_vcntlr  TYPE REF TO if_wd_view_controller,
            lref_comp    TYPE REF TO if_wd_component_usage,
            lv_embed_pos TYPE string.
      lref_vcntlr = wd_this->wd_get_api( ).
      lv_embed_pos = 'FILE_PERS_EDIT/VC_GENERAL'.
      TRY.
          CALL METHOD lref_vcntlr->do_dynamic_navigation
            EXPORTING
              source_window_name        = 'FILE_PERSISTENCE_WND'          " Window
              source_vusage_name        = 'FILE_PERS_EDIT_USAGE_1'       " Source View usage
              source_plug_name          = 'TO_EDIT_LAYOUT'                       " Outbound plug
              target_view_name          = 'PERS_EDIT_LAYOUT'                  " Second view to be embedded
              target_plug_name          = 'IN'                                                  " Second view inboun plug
              target_embedding_position = lv_embed_pos
            RECEIVING
              component_usage           = lref_comp.
        CATCH cx_wd_runtime_repository .
      ENDTRY.
      wd_this->fire_to_edit_layout_plg( ).
    This works fine for the first time.
    However onaction tab select i change the embeding position( 'FILE_PERS_EDIT/view container name of different tab') of the view2 an try to embed view2 in a different tab.
    At this point i get a dump stating View2 already present in the window 'FILE_PERSISTENCE_WND' of component.
    I think, the view2 embediing has to be removed before i add the view2 in a different tab
    Kindly let me know how to remove view2 embedding from tab1 before i add a view2 to a different tab or is there any other
    means to handle this problem?
    Thanks & Best Regards,
    Srini.

    Hello Srini,
    I found a solution to your problem, because I had a similar task.
    In WDDOINIT I changed the method do_dynamic_navigation to if_wd_navigation_services_new~prepare_dynamic_navigation:
    DATA:
        l_view_controller_api TYPE REF TO if_wd_view_controller.
      l_view_controller_api = wd_this->wd_get_api( ).
      TRY.
          CALL METHOD l_view_controller_api->if_wd_navigation_services_new~prepare_dynamic_navigation
            EXPORTING
              source_window_name        = 'WDW_MAIN'
              source_vusage_name        = 'VW_SUB_USAGE_1'
              source_plug_name          = 'TO_VW_CONTENT'
              target_component_name     = 'ZTEST_DYNAMIC'
              target_view_name          = 'VW_CONTENT'
              target_plug_name          = 'DEFAULT'
              target_embedding_position = 'VW_MAIN/VC_TAB.VW_SUB/TAB1_VC'
            RECEIVING
              repository_handle         = wd_this->g_rep_handle.
        CATCH cx_wd_runtime_repository .
      ENDTRY.
      wd_this->fire_to_vw_content_plg( param1 = 'TAB1' ).
    In the action I first deleted the navigation targets, then navigated to the empty-view and last I called my target view:
      DATA:
        lv_position           TYPE string,
        l_view_controller_api TYPE REF TO if_wd_view_controller,
        lr_view_usage         TYPE REF TO if_wd_rr_view_usage,
        lr_view_***_t         TYPE wdrr_vca_objects,
        lr_view_***           LIKE LINE OF lr_view_***_t.
      l_view_controller_api = wd_this->wd_get_api( ).
      lr_view_usage = wd_this->g_view->get_view_usage( ).
      lr_view_usage->delete_all_navigation_targets( plug_name = 'TO_VW_CONTENT' ).
      CLEAR lv_position.
      CONCATENATE 'VW_MAIN/VC_TAB.VW_SUB/' old_tab '_VC' INTO lv_position.
      TRY.
          l_view_controller_api->if_wd_navigation_services_new~do_dynamic_navigation(
          source_window_name = 'WDW_MAIN'
          source_vusage_name = 'VW_SUB_USAGE_1'
          source_plug_name   = 'TO_EMPTYVIEW'
          target_component_name = 'ZTEST_DYNAMIC'
          target_view_name   = 'EMPTYVIEW'
          target_plug_name   = 'DEFAULT'
          target_embedding_position = lv_position ).
        CATCH cx_wd_runtime_repository.
      ENDTRY.
      CLEAR lv_position.
      CONCATENATE 'VW_MAIN/VC_TAB.VW_SUB/' tab '_VC' INTO lv_position.
      TRY.
          wd_this->g_rep_handle = l_view_controller_api->if_wd_navigation_services_new~prepare_dynamic_navigation(
            source_window_name = 'WDW_MAIN'
            source_vusage_name = 'VW_SUB_USAGE_1'
            source_plug_name   = 'TO_VW_CONTENT'
            target_component_name = 'ZTEST_DYNAMIC'
            target_view_name   = 'VW_CONTENT'
            target_plug_name   = 'DEFAULT'
            target_embedding_position = lv_position ).
        CATCH cx_wd_runtime_repository.
      ENDTRY.
      wd_this->fire_to_vw_content_plg( param1 = tab ).
    Ann.: I my example, I had 3 views: VW_MAIN which embedds VW_SUB. VW_SUB has the tabs in it and VW_SUB embedds VW_CONTENT.
    BR,
    Roland

  • Is there a way to use a statically defined appearance stream in a dynamically created annotation?

    Hello,
    I want to create a document with cascading 'popups'.  Not the built-in text-only popup, but an annotation containing an appearance stream that defines text and images.  I'm currently using widget annotations based on a pushbutton field.
    Each page in my document has many citations that refer to other pages in the document.  When a user hovers over the citation, I want a 'popup' to appear containing a depiction of the destination.  However, as the destination will itself have citations, I also want the 'popup' to contain citations that the user can hover over, triggering another popup, etc.  In this way, a user could navigate throughout the document without leaving the page or even clicking the mouse.
    Obviously, with even a modest number of citations per page, pre-calculating and statically defining all of these widgets causes a combinatorial explosion, making the document sluggish and very large.
    Instead, I'd like to statically define appearance streams once per document, and then dynamically create annotations and assign the appropriate appearance stream using JS as the user navigates.
    So far I've created a named AP in the names dictionary, but I haven't been able to use it to dynamically set an appearance stream of a dynamically created widget annotation.
    Also, I've called Doc.getIcon(), passing in the named AP, which returns an Icon object.  However, after field.buttonSetIcon() and passing in the named AP, the button does not display the icon.
    Is there a way to use a statically defined appearance stream in a dynamically created annotation?
    Thank you,
    Dave

    Hi George, I've gotten named APs to work, and I expect hidden buttons will follow.  Thank you very much!
    Quick follow-up - I will have many documents embedded within the same pdf file, and some of these documents will contain identical popups.  However, I don't want to store identical icons in each document on account of file size.
    Instead, I'd like to store one instance of each icon for all documents in the file.
    Can I store all of the icons in a single document, and then access them by calling <DocName>.getField().getIcon() from any document in the file?
    Thank you again,
    Dave

  • How to get the co-ordinates of a dynamically created input field

    Hello Frn's
    i have created a dynamic text view . but this text view is not appearing at proper position . I want palce it infront of a dynamically created input field . how can i do this ?
    as i am thinking ...i should first of all  get info about the co-ordinates of   dynamaclly creatd input field . and with respect to these co-ordinates ...set the position of  text View .
    Please suggest  your thoughts .
    Thanks and Regards
    Priyank Dixit

    Hi,
    There is no provision in WD for getting screen coordinates and then placing the UI element.
    You to add the UI element to layout editor and based on the layout type it will add the UI element to respective position.
    I would advice not to create dynamic UI elements( instead you can create them statically and then play with visibility status through context binding ). This will be more effective way and less error prone. This is also recommended practice.
    still,For dynamic creation you can refer to following wiki:
    http://wiki.sdn.sap.com/wiki/display/WDABAP/CreatingUIElementsDynamicallyinAbapWebdynpro+Application
    regards
    Manas Dua

  • How dynamically create connection pool and Datasource

    Hi
    How I can dynamically create a connection pool and Data source in Oracle 10g Application server. In our J2EE application the user will be login with db user name, password and database name. I want to create connection pool and data source on the fly while login the user with database name. I our application we have access approximate 80 Databases. so my approach is given bellow
    1) Planning to create 80 connection pools and 80 Data sources so when user logs in while selecting the db name i will call the appropriate data source and create the DB connection. Is there any limitation to create number of data sources in oracle app server?
    2) Create DB connection with out using connection pool and data source. But i am not prefer this approach coz we need to handle some transaction in our application.
    Kindly throw some light on managing connection pool programmatically or in application run time.
    I would really appreciate if any one can provide any links or any inormation on this issue.
    Thanks in advance.

    Kindly let me know is there any drawbacks to create 80 Data Sources to connect 80 database in Oracle 10G App server and each data sources should have one connection pool. so i need to create 80 connection pool. Please let me know is this right approach or any work around to create Data source on fly for each request for corresponding database.

  • Assigning a 'dynamically created sequence' value to a variable

    in my procedure i am creating a sequence on the fly, i am preparing the name with some passed parameters like below
    v_seq_name := 'seq_'||loadid||v_table_name;
    execute immediate 'CREATE SEQUENCE '||v_seq_name||' MINVALUE 1 MAXVALUE 999999999999999999999999999 START WITH 1 increment by 1 cache 20';
    and now after doing some operations i need to assign the current value of sequence to a number variable i tried following but not working
    1) v_curr_value : = v_seq_name.currval ;
    2) select v_seq_name||'.nextval' into v_curr_value from dual;
    can you please suggest me how i can get the value in plsql block.

    DIVI wrote:
    in my procedure i am creating a sequence on the fly, i am preparing the name with some passed parameters like below
    v_seq_name := 'seq_'||loadid||v_table_name;
    execute immediate 'CREATE SEQUENCE '||v_seq_name||' MINVALUE 1 MAXVALUE 999999999999999999999999999 START WITH 1 increment by 1 cache 20';
    and now after doing some operations i need to assign the current value of sequence to a number variable i tried following but not working
    1) v_curr_value : = v_seq_name.currval ;
    2) select v_seq_name||'.nextval' into v_curr_value from dual;
    can you please suggest me how i can get the value in plsql block.Well, you haven't given the error you are getting but I guess the procedure isn't compiling? You need to execute immediate any reference to the sequence.
    Having said that, your architecture is probably wrong if you are dynamically creating things in a procedure.
    Why do you need to create them dynamically?

Maybe you are looking for

  • Budget report in sap CO

    Dear Expert, I need report that can show this information : cost element, cost center, description, proposed budget in year xxxx, approved budget in year xxxx. Is there any SAP standard report which suitable with this requirement? Thank you.

  • On Upgrade (from Office 2010) don't create new .ost file

    Hi there, hope someone can help me. Here is my Problem: I'm runninng Office 2010 (32Bit Version) on Windows 7 Enterprise x64. I've started Office 2010 with Exchange CacheMode activated. The ost-file is located under D:\Data\outlook\%username% Now I'm

  • How can I get 'sync' signals for sine wave out? [FPGA USB 7856R]

    Hello, I'm Sean Ahn using NI 7856R, USB FPGA with LabVIEW 2014. I'm trying to make 'sync' signals for sine wave of adjustable frequency, like general function generator's sync out. I use sine waves whose frequency is feedback-congtrolled between 25~3

  • Communication between a web app and a desktop app

    Hi, I would like to know how i can make a web application communicate with a desktop application (protocols,technologies, patterns�). And if I'm using a jsp web app and a java se app? Indeed, i have a desktop app. which use some information provided

  • Edge Animate CC - parallel animation

    How make two animations? First animation when i click is stopped, second animation dont stop? I don't understand, it turns only the linear animation. the problem is that it is impossible to make a smooth transition, since I don `t know in what period