Controlling Variable Movieclips (within Variable Movieclips...)

okay, so i have a really complicated question, but hopefully it's just complicated for me and not for you brainiacs out there. ;)
on my main timeline there is a movieclip ("sampleMc") which contains a number of labeled frames containing movieclips of gallery images (for example "dyerBikiniMc"). in turn, each of THESE movieclips contain a number of frames of detail shots of the main image (for example "dyerBikini00Mc, dyerBikini01Mc, dyerBikini02Mc, etc.").
on the main timeline i have a gallery navigation bar with thumbnail buttons determining which image will be displayed. there's also a right arrow shaped button "detailsBtn" that i'd like to allow the user to click frame-by-frame through the detail shots of the image. i also have a before/after toggle button on the main timeline that needs to control the movieclip one level below that, where the before/after images of that particular detail shot are stored!
so the question is, how do i program a button to do something inside a movieclip, if the movieclip (and even its immediate parent and grandparent, for that matter) are variable?
i hope that makes sense (it only barely does to me). i would be very grateful to get some suggestions on this!
robin

Yeah, I switched to the webforums too after getting to much garbage from 'rich' formatting and what not.
Personally I would try to make updating a little as a hassle as possible. This sadly usually means doing more work to get the whole thing initially up and running. The updating and the imagesize (will the be zoomable?) you require all data to be external I suppose.
I think I'd go for an XML file with a structure looking like:
<samples>
    <!-- title & thumbnail for the toplevel menu -->
    <sample title="dyerBikiniMc" src="thumb_dyerBikiniMc.jpg">
        <!-- detail info, thumb, before and after -->
        <detail src="thumb_dyerBikiniMc001.jpg">
            <before src="dyerBikiniMc001B.jpg" />
            <after src="dyerBikiniMc001A.jpg" />
        </detail>       
        <!-- detail info, thumb, before and after -->
        <detail src="thumb_dyerBikiniMc002.jpg">
            <before src="dyerBikiniMc002B.jpg" />
            <after src="dyerBikiniMc002A.jpg" />
        </detail>
        <!-- etc. -->
    </sample>
</samples>
The main menu should filter out all the src attributes from the sample nodes and display those images.
Once an item is shown, the submenu should filter all the src attributes from the detail nodes that belong to that particular sample.
Once a detail is choosen, the before and after images would be loaded and shown. The last maybe just on top of each other with a button toggeling the visibility of the topmost.
All objects below the top level menu displaying images should be made so that if they show new images, the old ones are removed/unloaded.
It does require some code though but with the proper self defined classes it would not need to be really much.
Alternative could be to make a self contained clip for each sample including all navigation and have the main menu load such a container as needed and unloading it when an other sample is requested.
All loading, except for the xml loading, would be done with the Loader class.
hth,
Manno

Similar Messages

  • Button functionality in a movieclip within another movieclip for another movieclip

    Ok so i have this looping thumbnails bar that goes like this:
    Scene1-imagebar-imagebarinside
    The buttons symbols are in the "imagebarinside" movieclip and i am using this code:
    ss1.addEventListener(MouseEvent.CLICK, play1);
    function play1(event:MouseEvent):void
    gotoAndStop("ssbox1");
    ...in this movieclip to play another labeled frame in another movieclip (Scene1-Bara)
    Problem is it wont work :-< if anyone has a better ideea i'll really apreciate it

    Hey!
    So, trying to understand the distribution of your MovieClips inside the flash file, this is what I understand:
    Scene1 contains a movieclip with the instance name "imagebar" and another movieclip with the instance name "bara".
    "imagebar" contains a movieclip with the instance name "imagebarinside". If that is the case (And the code being on the first frame of "imagebarinside"), I would use something like:
    function play1(event:MouseEvent):void
         Object(this.parent).parent.bara.gotoAndStop("ssbox1");
    Hope this works!

  • Getting frame number of movieclip within movieclip

    Hey guys, really simple question--how do I get the frame number of a movieclip within a movieclip? Say I have mc2 nested within mc1. Whenever i try to say mc1.mc2.currentFrame, I get
    TypeError: Error #1010: A term is undefined and has no properties.
    at blobgame2_fla::MainTimeline/loop()
    I would attach my fla if this forum would let me.

    You shouldn't be doing this. For one thing, you're likely to wind up with race conditions that mean you can never be sure what exists yet and what doesn't. For another, if you need to change the way mc1 is built, then everything with a "hard" reference to mc2 will break until you dig around and fix it. You should build mc1 to do whatever needs to be done or generate an event (depending on your real end goal).
    What are you trying to do that you need the frame number for?

  • Passing a variable to set a movieclip location

    In frame 1 of the the movie I have defined the following:
    var cl_y=502.0;
    Elsewhere, I am running the following script:
    -- seaty is the original position of the movie clip as
    defined in frame 1
    var seaty = this+"_y";
    -- resets the position of the movie clip to the original
    position
    this._y = seaty;
    (note - I am just setting the _y position in this code in
    order to simplify the forum post)
    I expected that this._y = seaty; would reset the position of
    the movie clip to the original position as defined in frame 1.
    However, nothing happens.
    I have used a trace () to discover the value of seaty:
    Running trace(seaty) produces _level0.cl_y
    Please note that trace(seaty) does not equal the value of
    _level0.cl_y (which is what I am wanting to achieve)
    I then tried replacing:
    this._y = seaty;
    with the following:
    this._y = level0.cl_y;
    And this produces the desired result (moving the movieclip to
    the original position)
    Even though seaty = level0.cl_y
    why does this work:
    this._y = level0.cl_y;
    and yet this doesn't work:
    this._y = seaty;
    (I need it to work because I need to use the same function to
    reset the position of numerous movieclips, all with different
    original positions)
    Many thanks in expectation

    Pulcinella2uk, it tells me you have elected not to receive
    private messages.....so i'll put my reply here for now....
    what version of flash are you using? if you're using an old
    version, something like this might work:
    onClipEvent(load){
    var seatx = this._x
    var seaty = this._y
    onClipEvent(mouseUp){ //or whichever event you're using
    this._x = seatx
    this._y = seaty
    if you're using 7 or later though, then actionscript really
    ought to go on a frame instead of on a clip. so the above code
    would reside on frame 1 of your movie, and look like:
    var seatx = this._x
    var seaty = this._y
    onRelease = function(){ //or whichever event you're using
    this._x = seatx
    this._y = seaty
    all that aside, if i understand your last question correctly,
    you're looking to establish these variables on the _root timeline,
    and access them later. the second code snippet above will produce
    the same result, but if you ever do want to access a variable based
    on a movieclips name in this way, you could do it like this:
    on frame 1of _root timeline:
    var c1_x=15;
    var c1_y=502.0;
    on frame 1 of clip:
    this._x = _root[this._name+"_x"]
    this._y = _root[this._name+"_y"]
    i hope that all made sense. let me know, and if you need to,
    send me a copy of your file so that i have a btter idea of what
    you're trying to accomplish

  • Variable code within code

    I was wondering how you can make variable code within code, for example, normally, you can use this["blabla"+variable]; to make the code say blablavariable.
    But now i want to make new variables by using this code, within a for loop [using teller1 as the increasing value]
    this["var ringsegment_mc:Ring_"+teller1+"=new [Ring_"+teller1+"]()"];
    which i basically want to have say:
    var ringsegment_mc:Ring_1=new Ring_1();
    but this doesnt work, it doesnt make a variable called ringsegment_mc.
    why I want to do this, is because i need to make an add child which makes 16 parts, from 16 different movieclips.
    here is the code for that for loop:
    for(var teller1=0; teller1<16; teller1++) {
        kernplaats += Number(Math.random()*200+300);
        this["var ringsegment_mc:Ring_"+teller1+"=new [Ring_"+teller1+"]()"];
        ringsegment_mc.x=xco[teller1]+kernplaats;
        ringsegment_mc.y=yco[teller1]+kernplaats;
        ringsegment_mc.geklikt = Number(0);
        ringsegment_mc.score = Number(ringscore);
        ringsegment_mc.speedmodded = Number(0);
        ringsegment_mc.kerngroep = Number(1);
        ringsegment_mc.addEventListener(Event.ENTER_FRAME,vernietig);
        addChild(ringsegment_mc);

    Hmm, i already fixed it, though im still not really sure why it happened:
    i have a for loop adding the addchilds 16 times, using a different movieclip for each instance
    loading the x and y coordinates from an array, containing 16 values [which ive changed to 17 now, to make it work]
    the arrays:
    var xco:Array = [121,180,233,271,292,292,270,231,179,124,74,34,11,9,30,70,121];
    var yco:Array = [11,11,33,73,124,181,232,270,290,291,271,234,183,125,72,33,11];
    the part of the for loop and positioning:
    for(var teller1=1; teller1<17; teller1++) {
        //var ringsegment_mc:Ring_1=new Ring_1();
        var ClassReference:Class = getDefinitionByName("Ring_"+teller1) as Class;
        var ringsegment_mc:MovieClip=new ClassReference();
        ringsegment_mc.x=xco[teller1]+kernplaatsx;
        ringsegment_mc.y=yco[teller1]+kernplaatsy;
    i traced the x and y coordinates, and it appeared that Ring_16 got 0.0 as coordinates.
    so i added the first coordinate to the end, and it works fine now.
    and while typing i realise that the first value in an array is number 0 and not 1
    DOH!
    Thanks for the help guys!
    Especially you, Hakan!

  • Control references vs. global variables

    I guess my question centers on the appropriate application of control references.
    I am writing a complex program that has a state machine at the top level, and, for one frame of the state machine, a while loop containing a couple subVIs, each of which contains many subVIs. The lower-level subVIs are affected by buttons on the top-level VI. Information from the lower-level VIs must be shown on the top-level front panel within the loop. My question is: what is the best way to do this?
    (I have a previous version of the program that I wrote that keeps just about everything on the top level so that I can update the front panel, but this is not at all modular.
    In addition, I considered breaking things up into more than on
    e front panel, but this doesn't seem to be a good option for this section of this program.)
    Last week I read about control references, and decided that this could be the way to deal with this issue. I have not worked with them before, so I want to know: Are control references an appropriate solution for this issue? Is it good programming practice to use them, especially to update data on charts and graphs? How do they compare programming-wise and efficiency-wise to global variables?
    Global variables are another solution, I think, but I would have way too many variables to update. I think the advantage with global variables is that one could just insert a global variable in a subVI and not have to wire it up through the different subVI levels, which one would have to do (I think) with control references.
    Can you offer any advice?
    Thanks!

    Paul,
    The actual implementation of the solution is up to you. This is indeed a complex question.
    I would offer the following advice:
    On globals:
    Try to avoid them. I try to restrict the use of globals to unidirectional. If you have ever dealt with a race condition, you will know why. Mistakes are often made with globals, and they are quite apt to become the biggest source of bugs in a program, especially in one as large and/or complex as your appears to be. If you must use globals, try using a shift register, or LabVIEW 2 style global instead. Basically, you use an unitialized shift register with two (or more) cases: Read and Write. This prevents race conditions, but only if the VI is non reentrant. However, implementation is still difficult.
    Control References:
    I also have read and heard about control references. I have had much use for them, for controlling the appearance of controls and indicators (and decoratiopns too, I guess...). However, I would caution you on using them to pass data around. This violates dataflow in a big way, as you are passing around pointers, instead of data. I believe this is difficult to implement, and even more difficult to keep straight. I personally recommend using them only for attributes of FP components, not for passing data.
    So, what do I believe is the most elegant solution? I think a data server is your best bet. This is close to a LabVIEW 2 style global, but a little more active. Simply write all of your data into a subVI in any manner, a queue, a FIFO, LIFO, etc. Then, retrieve the data as desired. Buffering, queuing, etc are all handled by the data storage and retrieval subVI. It becomes sort of a small active database. The two sides (storage and retrieval) are independent of each other, and the code is all handled in the function. A basic version is a LIFO, Last In First Out, wherein the data is overwritten constantly. The data is then read by the reading VI, the front panel VI in your case, at any time, and the data is always the latest. You can add complexity as you need, such as making it a FIFO. This is done by simply writing the data to an array, then reading back the oldest value (by reversing the array and reading index 0.)
    I believe this is an elegant solution to your problem. It does maintain dataflow, except that time is taken out of the equation, depending on how you look at it. It simplifies your program because you only need to do three things. Write the data handler, then drop in the function into the VI that writes, and the one that reads. It is also flexible in handling the data.
    Good luck, and let us all know how you do.

  • How do I use a button within a movieclip to go to the root?

    Hi there, I am new to flash and AS3 and need some help
    getting my buttons to work.
    I made a script for the file that i am working with that has
    buttons located within 2 movieclips. I want that button to load and
    image into a UILoader (problemLoader_mc) that I placed on the stage
    on the main timeline (the timeline that contains WeekBar_mc). The
    problem is that I don't know how to get to the root of the file to
    start a new directory to tell my function to load the image i want.
    I have tried multiple approaches including:
    MovieClip(root).problemLoader_mc.source = problemArray[0]
    MovieClip(parent).problemLoader_mc.source = problemArray[0]
    root.problemLoader_mc.source = problemArray[0]
    parent.problemLoader_mc.source = problemArray[0]
    (root as MovieClip).problemLoader_mc.source = problemArray[0]
    If anyone can help me out with this, I would greatly
    appreciate it, I am banging my head against a wall at the moment.
    (Also, please excuse my vague descriptions, I am still learning the
    official terms.)
    Here is the code that I have written that pertains to this
    problem:

    I have a mental block for reasoning things out as far as
    assigning the listener to an object two mc's away from the main
    timeline while having the function in the main timeline, so I may
    play with that on my own for awhile. One thing you didn't do
    though, was to pay the same attention to the problemArray[0]
    assignment in that function, which I assume also lives in the root.
    But here's what I'd do for the moment.
    Take all that code except the array and plant it in the
    timeline where WEEK1btn lives, modifying it as follows....
    WEEK1_btn.addEventListener(MouseEvent.CLICK, pload1);
    function pload1(event:Event)
    MovieClip(this.parent.parent).problemLoader_mc.source =
    MovieClip(this.parent.parent).problemArray[0];
    I haven't utlized root myself yet, so I am not comfortable
    offering you a solution that attempts it.

  • Variable scope within an interface and some questions

    I am creating a DataStorage interface with a member variable (can I call it a member variable when it is in an interface?) called dataObject. From what I remember, and what the compiler is telling me, the scope declarations "private," or "protected" can not be used on either methods or member variables in an interface.
    Now I have another class DataInput that implements DataStorage and I want to make the dataObject private and put in accessor methods to get to the dataObject. But I also remember reading something that said, during inheritance you can not make the scope of the method (and variable?) more narrow. Meaning if a method was defined as default in the parent class, the subclass can not override that method to give it private access all of a sudden.
    Now a couple of questions with this...does that rule only apply to subclassing (that is with extends) or does it also apply to implementing interfaces. Second question, I am pretty sure that rule applies to methods that are being overriden, but does it also apply to variables in an interface...because if that is the case, I can't re-declare the variable in the class that implements the interface to be private...and then there is no way to protect that variable.
    By the way I did re-declare the variable in the subclass (implementing class) and declared it as a private, and it works...but I'm still trying to figure out the general rule.

    well if the interface variables are implicitly public static final, how come I am able to re-declare the variable name within the class that implemented the interface.
    If for example in interface Car there is a variable color, how come in class Honda implements Car, I can redeclare the variable color, and give it public access. I thought final meant final, no redeclaring...but does that not hold for static variables?

  • Calling a function from within a movieclip

    How do I do this, and Is it wrong to do it this way?
    I have a movieclip on the timeline and within that movieclip
    it has buttons which I've placed listeners. I'm doing it this way
    rather than putting the code in the document class because the
    buttons don't appear right away in the movieclip (not until around
    frame 10). The function is defined in the document class because it
    is used with other movieclips.
    Anyone have an idea on how to properly do this?

    Well, I'm at least not getting an error - however, nothing is
    happening when I click the button to call the function (which is
    indeed public). Inside the function is a simple trace. I've even
    added a param to the function just for fun, and there's no error
    when calling the function from the button.

  • Remove child on the root timeline from within a movieclip

    Hi
    How do I remove a child from the root timeline from within a separate movieclip?
    I've tried
    MovieClip(parent).removeChild(mc1);
    But I get this error
    1120: Access of undefined property mc1.
    I could write a function in the root timeline that just removes child and then run that from within the movieclip but is there a better way?
    Thanks in advance.

    Thanks for replying.
    I asked on Kirupa but I couldn't access the site so I asked here.
    I guy answered with this
    MovieClip(parent).removeChild(MovieClip(parent).getChildByName("mc1"));
    It works fine, is this the best way to do it?
    Not sure if I understand what you meant?
    Just to be clear I have to movie clips on the stage mc1 and mc2 and i want to remove mc1 from within mc2's timeline.
    Thanks again

  • View of variables declared within a package/procedure

    Does anyone know of a view which holds all the variables declared within a package/function/procedure?
    I can see that _arguments holds the parameters defined.
    PLSQL Developer displays these things in their drop downs, so I assume they are either getting it from a view or have written something which parses the _source view?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Do you mean this ?
    SCOTT@db102 SQL> desc dbms_output
    PROCEDURE DISABLE
    PROCEDURE ENABLE
    Argument Name                  Type                    In/Out Default?
    BUFFER_SIZE                    NUMBER(38)              IN     DEFAULT
    PROCEDURE GET_LINE
    Argument Name                  Type                    In/Out Default?
    LINE                           VARCHAR2                OUT
    STATUS                         NUMBER(38)              OUT
    PROCEDURE GET_LINES
    Argument Name                  Type                    In/Out Default?
    LINES                          TABLE OF VARCHAR2(32767) OUT
    NUMLINES                       NUMBER(38)              IN/OUT
    PROCEDURE GET_LINES
    Argument Name                  Type                    In/Out Default?
    LINES                          DBMSOUTPUT_LINESARRAY   OUT
    NUMLINES                       NUMBER(38)              IN/OUT
    PROCEDURE NEW_LINE
    PROCEDURE PUT
    Argument Name                  Type                    In/Out Default?
    A                              VARCHAR2                IN
    PROCEDURE PUT_LINE
    Argument Name                  Type                    In/Out Default?
    A                              VARCHAR2                IN
    SCOTT@db102 SQL>                                         

  • JSFL - Refreshing a Textfield within a Movieclip?

    I'm making a script that updates text within several movieclips in a Flash document. Loading object names and new copy from a text file is working, opening those objects and replacing their embedded textfields' text is working, and everything looks great when you publish the SWF.
    However - the IDE only sometimes updates the text that appears in the textfield from the main timeline. So if a title is supposed to say 'New Title' instead of 'Title', it will read as 'Title' when I'm looking at the project from the root level. When I double-click on the symbol instance to view its embedded textfield, it changes to 'New Title'. Then when I return to the root, it reverts to 'Title'. It's only a cosmetic problem, but it makes it appear as though the tool does not work.

    quote:
    Originally posted by:
    kglad
    you must wait until the contents of that frame are rendered
    before trying to reference the contents. flash has a render event
    you can use for that purpose.
    Thanks for the reply. I did a little googling and it looks
    like I'm screwed:
    http://www.actionscript.org/forums/showthread.php3?t=143158
    Because my attached MC uses different frames for different
    dialog boxes (that share elements, hence on the different frames)
    there is no guarantee that it'll work.
    I did a test on my own and the Event.RENDER wasn't even
    firing at all :(

  • VariableView ActiveX Control for a single variable

    This may be an odd request, but is it possible to limit the scope for the VariablesView ActiveX control to a single variable? 
    I was thinking of adding a pseudo-watch window and the VariablesView control is perfect if I could just limit its scope.  Building my own hybrid treeview/gridview is my other option.
    Any language will work; I am working in C#. 

    I wonder what would happen if you called NewEditContext, used the PropertyObject API to delete all the subproperties, and then called context.AsPropertyObject.SetPropertyObject("MyVariableName", PropOption_InsertIfMissing | PropOption_NotOwning, myVariable)?
    The context would probably be completely broken as a context, but it might work in the variables view..... well, probably not, but maybe worth a quick try if you've already got your control and variable ready to go....

  • To compare control name with a variable

      Hi all
    I want to compare the name of a control with a variable inside a loop. Is there any function for it in Labview? Please let me know if it is.
    Thanks in advance
    Solved!
    Go to Solution.

    Hi ghighuphu,
    I am attaching an example VI for our objective. 
    In the VI we are giving 5 'Variable names', 5 'Variable values' as inputs. And also we are giving an array consisting of the 3 required  'control names'(These 3 controls are on the right side of block diagram). First we are getting only the 3 required values from available 5 values. Now we want to pass these 3 values to their corresponding controls named a,b and c on the right side of the block diagram. So that they can be added and give the output.
    I want a generalised solution so that it works for varying number of controls.
    Attachments:
    Linking1.vi ‏11 KB

  • Reference Variable Set Within CFDIV

    I've got a .cfm page in which a CFDIV is called near the top.
    Variables are set within the CFDIV file that I then want to
    reference further down the calling .cfm page.
    Does anyone know a way to reference the values of the
    variables set within the CFDIV without using javascript? I'd like
    to reference the variables within a CFIF tags.

    Thanks Gordon,  it seems my syntax was correct but my logic failing.  My filterFunction was (item[fieldName]!="" || item[fieldName]!=null) instead of &&  I had no confidence in the syntax. Hate it when I doubt myself
    Thanks again. This is going to be a pretty slick SQL generator for reporting once complete. Here we are selecting the WHERE criteria for the fields included in the report.  My previous question (unanswered) instead of rendering ComboBox for each row, only fields with lookup tables would have had a ComboBox and these other potentially null fields were going to render TextInputs - but never could get that working with dynamic dataProviders.  This may be a better solution, just need to make the non-lookup ComboBoxes editable.
    Thanks again.

Maybe you are looking for

  • Acrobat X: Option to hide the dotted line in between pages when viewing in 2 page view?

    Acrobat X: Anyone know if there is an option to hide the dotted line in between pages when viewing in 2 page view?  So that the 2 pages can look seemlessly joined, with no gap and no dotted line?  This would be useful when viewing PDF magazines or bo

  • No payment mediums created (FPY1)

    Hi All, I have been trying to run FPY1 and i am facing some issues. where as after i run FPY1 i have items cleared. Log after i run FPY1 is as follows: Job started Step 001 started (program SAPFKPY3, variant &0000000000063, user ID F24494A) Format ZE

  • Playing JPEGS On A DVD Player

    I have a Panasonic PVR (DMR-EH50). It will not play a CD of JPEG's which I have edited with Photoshop on my iMac. The sales people at my store say that there is software for the Mac which will reformat the CD to allow it to play on DVD Players which

  • Error log in LSMW

    Hi all, Can anybody tell me how can i find the error log and warning log after the conversion has been done? Thanks

  • Web App problem

    I have a fairly simple web application running on Websphere, that connects to a DB2 database. I am getting the following error: Error Message: ERROR: Cannot forward. Writer or Stream already obtained. Error Code: 500 Target Servlet: null Error Stack: