Replace code in timeline of a symbol

My question is:
I built a symbol and name it videoholder. Inside the symbol i draw a Rectangel and
named it: Rectangel.
Iput the following code on the first frame/millisecond:
var video_path = sym.$("Rectangel");
video_path.html('<video width= "750" height= "421" src = "example.mp4" type = "video/mp4" controls= "controls" </video>');
Then I delete the symbol from the stage.
Now I placed different images as symbols on the stage.
When I click on these images i get the videoholder_image on the stage via createChildSymbol from the library.
What I want is to put a code on each image_symbol which allows me to change the code
inside the videoholder Rectangel:
var video_path = sym.$("Rectangel");
video_path.html('<video width= "750" height= "421" src = "example_new.mp4" type = "video/mp4" controls= "controls" </video>');
I appreciate any hlep

1) Your project is difficult to decipher with elements named Rectangle or TextCopy. Give descriptive names, or yourself will get lost when opening your own project in a few months
It's more legible when instance names correspond to the name of the symbol. For example videoHolder_1 instance of videoHolder (and if there is a second instance, you name it videoHolder_2).
2) Do not use a trigger sym.stop() at 0 ms. Instead uncheck the autoplay property of the symbol (may be the stage symbol).
3) In your symbol videoholder, you used a trigger at 0 ms. A good place for initialization is the creationComplete event handler of the symbol.
But for now this code should be commented out as it will be replaced by the execution of function chooseVideo.
4) Why are you using Tweenmax ? The primary interest of Edge Animate is to easily tween in the timeline.
5) work-all > work01 : looks like useless, a second work-all.
6) First error. In your videoholder > trigger at 0 ms : sym.$("Rectangel")
But in the function chooseVideo : sym.$("Holder"); // should be "Rectangel"
7) Second error. you define the global function but nowhere it is called !
So, tabula rasa. A works symbol nests two symbols w_01 and w_02, the access buttons to each of the two videos.
A videoHolder symbol contains
- a headline element, text that will receive the title ;
- a videoFrame element, rectangle that will hold the <video> tag ;
- a back_btn symbol.
The stage has its autoplay property set to false. Clicking on either of the buttons plays at label video where videoHolder_1 slides up (and works has its display property set to none). A sym.stop() trigger at the end position.
document.compositionready event handler :
sym.chooseVideo = function( numChoice)
  var radical = "";
  var title = "";
  switch( numChoice)
    case 1:
      radical = "video1";
      title = "This is video 1";
      break;
    case 2:
      radical = "video2";
      title = "And this one is video 2";
      break;
  // build the <video> tag by concatenation
  var video_tag = '<video width="750" height="421" src="video/';
  video_tag += radical;
  video_tag += '.mp4" poster="video/';
  video_tag += radical;
  video_tag += '.png" type="video/mp4" controls="controls" </video>';
  var video_H = sym.getSymbol( 'videoHolder_1');
  video_H.$('videoFrame').html( video_tag);
  video_H.$('headline').html( title);
  sym.play( 'video');
works > w_01.click event handler :
sym.getComposition().getStage().chooseVideo( 1);
works > w_02.click event handler :
sym.getComposition().getStage().chooseVideo( 2);
Download the example here : https://app.box.com/s/ykrvwvy3fclrdbwbwxff
Gil

Similar Messages

  • Replacement code for Translate statement in latest version

    Replacement code for
    TABLES XXXX  USING <r> LIKE <r>
    TRANSLATE <r>-<fieldname> TO UPPER CASE.
    <r> is a structure

    Hi,
    TRANSLATE ... TO UPPER/LOWER CASE
    TRANSLATE ... USING
    The arguments of these instructions must be single fields of type C, N, D, T or STRING or purely character-type structures. There is a syntax or runtime error if arguments of a different type are passed. A subset of this function is provided with the addition IN BYTE MODE for processing byte strings – that is, operands of type X or XSTRING. A statement such as CONCATENATE a x b INTO c is thus no longer possible when a, b, and c are all character-type, but x is of type X.
    TRANSLATE ... CODEPAGE ...
    TRANSLATE ... NUMBER FORMAT ...
    The above statements are not allowed in Unicode programs
    <b>Reward points</b>
    Regards

  • Tell a child gotoAndPlay(X) from a code in timeline of another child.

    Hi there!
    I have tried to simplify my bigger question in the following example.
    (Also you may download this FLA if needed)
    what do I have:
    - an EMPTY scene.
    - 2 movieclips in library (m1mc , m2mc)
    I use addChild method to add them to stage (m1=m1mc , m2=m2mc). this is the code in Frame 1 of empty scene:
    var m1:m1mc = new m1mc();
    var m2:m2mc = new m2mc();
    addChild(m1);
    addChild(m2);
    m1.x = 100;
    m2.x = 300;
    "m1mc" contains some frames that in frame 1 I have asked it to stop:
    stop();
    And finally my questions is:
    HOW to write a code in frame 1 of "m2mc" (that is in library) to tell "m1mc" gotoAndStop frame 2 (in this example)??
    I CAN access and change the alpha of "m1mc" from the timeline of "m2mc" with this code:
    parent.getChildAt(0).alpha = 0.5; //works fine
    but I CAN'T use the same method to tell "m1mc" gotoAndStop(someFrame)
    parent.getChildAt(0).gotoAndStop(2);
    //Error Symbol 'm2mc', Layer 'Layer 2', Frame 1, Line 2 1119: Access of possibly undefined property gotoAndStop through a reference with static type flash.display:DisplayObject.
    Any help would be highly appreciated 

    WOW kglad, the whole night I was searching for this formula you just offered!! WELLDONE man!!
    Wish you all the best and take care

  • Control a symbol timeline from another symbol timeline on specific condition

    Hi! I have 8 animated symbol that plays on clicking over them on the main stage and i want, for example, that if symbol 1 animation is complete and i click on symbol 3, symbol 3 plays forward and symbol 1 plays on reverse and vice versa just like this: http://www.framefarm.net/eugenio/edge/example/example.html
    please help!

    I put together a Composition that I think does what you're asking. it's not elegant, but it works.
    in the timeline of Symbol_1
    place stop() triggers at the start and end
    in the same triggers, set a Symbol variable that states whether the animation has finished i.e. sym.setVariable("isDone", "false");
    place a trigger on the rectangle to play() or playReverse() depending on an if() statement about the variable
    in the timeline of Symbol_3
    place stop() triggers at the start and end
    in the same triggers, set a Symbol variable that states whether the animation has finished i.e. sym.setVariable("isDone2", "false");
    place a trigger on the rectangle to:
    declare 2 new variables, which use sym.getVariable() to get isDone and isDone2 as above,
    play() or playReverse() depending on an if() else if() else if() statement about both variables
    I used the relative string to get the local variable and absolute string to get the variable from the other Symbol, i.e.
    var myVariable = sym.getComposition().getStage().getSymbol("Symbol_1").getVariable("isDone");
    var myVariable2 = sym.getVariable("isDone2");
    I can send you the entire code if that helps.

  • Play timeline from inside symbol

    I saw a post on this issue but was not sure where to put the code I read there. I would appreciate if you can tell me how exactly to edit this code line to work
    I am inside a symbol "oneAnimation". At the end of the animation "backBtn1" appears. Inside this button, I have added an event on click. I want the stage timeline to play from the label "startNumber" when this button inside the symbol is clicked.
    So far it's not jumping back to the main time line.
    sym.getComposition().getStage().play("startNumber");

    The label seems to be in that symbol, so all you need is sym.play('startNumber');
    You code is to play a label on the same timeline.
    See my blog on edgehero.com
    http://www.edgehero.com/articles/scope

  • How do I return playback to the main stage timeline from a symbol?

    In trying to learn Edge, is there a way to return playback (play from) once an animation is complete within a symbol?
    For instance, I have the main timeline that shows a symbol animation on creationcomplete, but when the animation is finished in the symbol and I hide the symbol, the main timeline is no longer playing. What would I need to do to return playback control to resume playback of the main timeline? I have a label I would like to play from on the main timeline, but I have not found a way to call the main timeline from within the symbol.
    This was something common in Flash.
    Thanks for your help!

    Hi escargo,
    Say we use two symbols object1 and object2.
    The main timeline has an interpolation on object2 from label “mainAnim“. Its autoplay property is set to false : the playhead stops at 0 ms.
    A third symbol nested contains the interpolation on object1. Its autoplay property is set to true, so it plays directly.
    At the end of this transition, there is a trigger (pseudo-track just below the timeline)
    sym = the current symbol nested
    sym.getComposition().getStage() = the main timeline (in Edge the stage is a symbol)
    sym.getComposition().getStage().play(‘mainAnim’); = play the main timeline from the given label.
    You can download the example here : https://app.box.com/s/6svvskydh952dfxbr3xb
    Gil
    PS : threads with examples for neigboring problems
    http://forums.adobe.com/message/5410456#5410456
    http://forums.adobe.com/message/5192205#5192205

  • Used "Merge clip" after rough cut, need to replace clips in timeline

    I made a rough cut for a sequence I'm working on using just the embedded camera audio from the takes.  Now that the roughcut is done I've started Merging the external audio source with the clips.
    What I need to know is if it is possible to replace the clips currently in my timeline with the new merged clips without having to go through and re-assemble the  entire timeline.
    I read somewhere that alt-dragging should give me a green plus sign which I can use to replace the old clip with the new one but I am having no luck with that.

    In the Project Panel, click the flyout menu; that's the little stack o' pancakes thing in the upper right corner of the panel. Select "Metadata Display." In the search box, type "usage"--this will reveal the Video Usage and Audio Usage metadata labels. Check those to add them, and hit OK; they'll now be added to the columns in the Project Panel. Now, you can sort on those columns to filter by usage--the unused clips won't have a number associated with that column. Select them all, and if you really want to purge them from the drive, hit Ctrl/Cmd+Delete--that will remove the media from the drive.
    If you just want to get rid of the clips, Project > Remove Unused will do that.

  • How to replace event file AND replace edits in timeline

    Is it possible to replace a video/file in an event, and in turn replace what it was used for in the timeline? For example, if I used some footage from an event and I cut i up 3 times in a project and added transitions and effects, is it possible to replace the file in the event with a new file (same length) and have the same cuts/transitions/effects applied to the new file in the timeline?
    I hope my question is clear. I've been trying to do this in the original media folder but with no luck.
    Thanks!

    Karsten Schlüter wrote:
    Jetemadi wrote:
    … , is it possible to replace the file in the event with a new file (same length) and have the same cuts/transitions/effects applied to the new file in the timeline?…
    hit cmd-c in the Project to copy the clip('s settings)
    select the new clip in the Event
    drag on old clip, select one of the replace-options
    select replaced clip, cmd-alt-v, apply effects/colors/…
    I would NEVER dare to 'fumble' with the internal file-structure of a data-base (=FCPX)
    Yeah I've learned that the hard way. I'll probably never do that again. Anyways, I didn't think about copying the clips settings. That definently works. I guess what I was looking for (or dreaming of) was some kind of automatic way. In After Effects and I believe premiere, you can right-click on a file in the "Event" folder and it will replace it the project as well automatically. I don't think anything like this exists for FCP however. I'm pretty sure the only way would to wait for apple to add something like this, or create some kind of script/plugin/automater. Any ideas?

  • Replacing media in timeline with Photoshop layer...

    In AE, I can option drag & drop an element into a keyframed clip in the timeline and all attributes & clip length are maintained. In Motion, there doesn't seem to be a way to do this. In the media tab, the layer shows up as a comp of all layers in the psd file, not the one I imported. I would just like to use the same animation with different media rather than recreate it with every new object I add to the timeline. Anyone find this shortcut ????

    Apologies for the confusion...
    When I use the import function from the File>import menu it allows me to import an indivdual layer, but it appears as a merge under the media tab. So when I attempt to copy a keyframed layer to reproduce the same animation with different media, the exchange results in the merged file as the replacement rather than the individual layer. I've tried this twenty different ways, no luck. In short, I would like to take a layer with keyframed animation and duplicate it as a new layer and relplace it with new media i.e. individual photoshop layers. This is a basic funtion in AE. Sorry if this still isn't clear...

  • DDTS-100 Remote Control Replacement / Codes

    I have the DDTS-100 I use it for everything in my home theater, I know maybe it isnt a real amp/reciever, but it does what i need.
    The remote however is a piece of crap, small buttons, and very unresponsive even with new batteries. Is there a way to program a different remote, or a known replacement add on remote? All i want the remote to do is mute, volume, and input. It is annoying to be 5 feet away and have to press mute 25 times for it to respond.
    Ideally I could combine it with my DVRs remote, one less remote needed.

    AMRivlin,
    Unfortunately, the codes used in most universal remote controls are made specificly to each different remote brand. The code number programmed into the remotes are not something the individual component manufacturers determine.
    In your case, my best suggestion would be to pick up one of the "learning" remotes. With that, you enter the programming mode on the remote, aim the two remotes at each other, and the "learning" remote records and stores the IR signal being sent by the original. While this is a bit time consuming, it is the best and only way that I am aware of at this time.
    Daniel

  • My firefox symbol has been replaced by a paper and pencil symbol on the doc

    normally I have a fox round the globe symbol. This has been replaced by a couple of sheets of paper and two pens and a ruler symbol.

    Hi lmmillard,
    I've seen this happen periodically, but it's pretty easy to fix. Just delete the icon from your dock. Then recreate it by dragging the Firefox icon into the doc from the applications folder.
    Hopefully this helps!

  • I want to replace code between 2 comments on many files Just can't figure out to do it.

    There is code between 2 comments I want to replace. For example <!-- #header --> CODE <!-- #/header -->
    The problem is that there is some discrepancy in the code in each and every file. Its a header I wanted to change on a html website I thought the best way would to to use the replace function
    But each file is a little different in the code. So Its just not working. All the code between these two comments have to be changed to the same block of code.
    I tried using regular expression I just can't understand it.
    I tried you /w /W but it just wont work.
    Why is there not simpler option. Like <!-- #header --> * <!-- #/header --> and it replaces everything in between The help file should have atleast given an example of various possibilities.

    ((\s|.)*?)
    (...) - Locigal grouping of the expression
      \s  - Matches any white-space character
      |   - Logical OR
      .   - Any character (except \n newline)
      *   - Match at least 1
      ?   - Forces minimal matching
    See this cheat sheet http://www.cheatography.com/davechild/cheat-sheets/regular-expressions/

  • Code causes timeline to stop

    I am makine my first attempt at coding a site with Actionscript 3. I have coded two buttons, both directing to another scene. The first one works. The second one stops the timeline and never gets read. Here is the code on frame 65:
    function goPortfolio(evt:Event):void{
        this.gotoAndPlay (1, "portfolioScene");
    bPortfolio.addEventListener(MouseEvent.CLICK,goPortfolio);
    here is the code on frame 80:
    function contactFA(evt:Event):void {
      this.gotoAndPlay(1, "contactScene");
    bContact.addEventListener(MouseEvent.CLICK, contactFA);
    Please tell me what I need to do.

    I've always considered it a bug of Flash, but it's always been the case.  If you have the same object in adjacent frames, the last one acquires some of the properties of the one preceding it... such a s its name, or lack of one.  So even though you named it at the last frame, the one in the frame before it ruled it out.
    Email link: Many people use a shorthand version which combines the following into one line, but I figure if you're seeing it for the first time, it's best to realize the parts involved.  It's the same for regular links to web pages as well.
    var url:String = "mailto:[email protected]";
    var req:URLRequest =  new URLRequest(url);
    navigateToURL(req);

  • Playing an animation on the timeline within a symbol from another symbol

              Hi all
    First post, good to be here
    I have the following
    STAGE
              SYMBOL_1
                   DIV_PLAY
                        MOUSEUP(COMMAND)
                   DIV_STOP
                        MOUSEUP (COMMAND)
              SYMBOL_2
                   DIV_ANIMATION_1
                        ANIMATION_1_START (TIMELINE POSITION)
                   DIV_ANIMATION_2
                        ANIMATION_2_START (TIMELINE POSITION)
    I would like to do the following:
    play "SYMBOL_2" - "DIV_ANIMATION_1" - "ANIMATION_1_START" from within "SYMBOL1" - "DIV_PLAY" with the mouseup command
    I have tried doing this with the help of this post http://forums.adobe.com/thread/964882 but i cant crack it!!
    I know that i can sym.getComposition().getStage().getSymbol("div_animation_1").play();  from within "div_play" but how do i access a point on the timeline and play from there...
    many thanks!!

    Answered my own question,
    sym.getComposition().getStage().getSymbol("div_animation_1").play("animation1_start");

  • Using regular expressions to find and replace code.

    Hi! Semi-newbie coder here.
    I'm trying to strip out code from multiple pages, I've tried regular expressions but I'm struggling to understand them. I also need to do it across a LOT of pages, so I need an automated way of doing it.
    The best way I can explain is with an analogy:
    I want to delete any string of characters that start with c, ends with t and includes anything inbetween, so it would pick up "cat, cut, chat, coconut, can do it" whatever appears in the middle of those.
    Except, instead of c and t, I want it to find strings of code starting with <div class="advert" and ending with Vote<br> while picking up everything in between, (including spaces, code, comments, etc.). Then, deletes that whole string including the starting and ending.Is there a regular expression I could use in dreamweaver that could do this? Is there a way to do this at all?

    Let me begin by saying I'm a complete idiot with DW's Reg Ex.   I use Search Specific Tag whenever possible.  See screenshot below.
    Try this on your Current Document to see if it works. Then make a back-up copy of site before attempting it on Entire Local Site as you cannot "Undo" this process.
    Good luck,
    Nancy O.

Maybe you are looking for