A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: [RESOLVED] Really stuck on this! Help needed.

  1. #1
    Junior Member
    Join Date
    Jul 2012
    Posts
    10

    resolved [RESOLVED] Really stuck on this! Help needed.

    Me again, still looking for a solution in vain. I just want a working slideshow for each project, but I made the projects using a for loop, making it more confusing (was following a tutorial). The thing is, in the tutorial, the guy only had one picture up per project, I want many.

    On my projects page(frame), I have Project Panels. Just regular blocks displaying a thumbnail image of the project, and when clicked, it opens up a "fullProjectPanel" from the main time line.

    This is the code for the fullProjectPanel:

    var fullProjectPanelMulti:FullProjectPanelMulti;





    // ADD FULL PROJECT PANEL ( runs when clicking on project panel(2nd frame of mainContainer, line 28))



    function addFullPanelMulti(o:Number):void {





    fullProjectPanelMulti = new FullProjectPanelMulti;



    fullProjectPanelMulti.title.text = projectTitleM[o]

    fullProjectPanelMulti.info.text = projectInfoM[o]

    fullProjectPanelMulti.content.text = projectContentM[o]

    fullProjectPanelMulti.client.text = projectClientM[o]

    fullProjectPanelMulti.media.text= projectMediaM[o]

    fullProjectPanelMulti.technology.text = projectTechnologyM[o]

    fullProjectPanelMulti.link.text = projectLinkM[o]

    fullProjectPanelMulti.loadImage(projectImageM2[o]);

    fullProjectPanelMulti.loadImage2(projectImageM3[o]);





    TweenLite.from(fullProjectPanelMulti, 0.6, {alpha:0, delay:1.2});

    addChild(fullProjectPanelMulti);



    // indicate state

    fullProjectPanelUpMulti=true;



    }

    Now, the loadImage and loadImage2 functions are present on the fullProjectPanelMulti movieclip itself, and the code is:

    function loadImage(imagePath:String):void

    {





    var ldr:Loader = new Loader();

    var url:String = imagePath;

    var urlReq:URLRequest = new URLRequest(url);



    ldr.x = -35;

    ldr.y = 67;



    ldr.load(urlReq);

    addChild(ldr);

    }

    function loadImage2(imagePath:String):void

    {





    var ldr:Loader = new Loader();

    var url:String = imagePath;

    var urlReq:URLRequest = new URLRequest(url);



    ldr.x = -35;

    ldr.y = 67;



    ldr.load(urlReq);

    addChild(ldr);

    }

    I have a couple of questions. First, how can there be two "ldr" with the same name? Both display the pictures they're supposed to, but they have the same name?

    Is it because they're confined to the function?

    Secondly, I cannot manipulate the "ldr"s at all, seeing as they only exist within the function; how can I make it so I can change them around with properties like "ldr.visible = false" not in the function.

    Also, I don't know if this is relevant or not, but the code for accessing the XML file is:

    var projectImageM:XMLList;

    var projectImageM2:XMLList;

    var xml:XMLLoader = new XMLLoader(this,"data.xml");



    // FUNCTION THAT GETS CALLED FROM CLASS WHEN XML IS LOADED

    function getXML(xmlData:XML):void {

    projectImageM = xmlData.projectsM.project.image_path;
    projectImageM2 = xmlData.projectsM.project.image_path2;



    }

    I'm sorry this is long, but I really have no idea what to do ._., any help at ALL would be appreciated. Thanks.

  2. #2
    Senior Member somlemeg's Avatar
    Join Date
    Aug 2000
    Posts
    171
    You'll probably get more response if you format your code and place it inside an PHP wrapper.

  3. #3
    Junior Member
    Join Date
    Jul 2012
    Posts
    10
    Thanks for taking the time to answer. Yeah I probably would have, but I changed the functionality completely anyways. This format was too convoluted, so I went with both an easier and more attractive method

  4. #4
    Senior Member somlemeg's Avatar
    Join Date
    Aug 2000
    Posts
    171
    Thats good nour.
    You may want to mark the treat as solved when you don't need help anymore, so that other that need help may get it quicker.

  5. #5
    Junior Member
    Join Date
    Jul 2012
    Posts
    10
    Ah, didn't know I could do that . Doneee.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center