A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: As2 books catalog, multiple movieclips, search engine

  1. #1
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971

    As2 books catalog, multiple movieclips, search engine

    Hi, i know someone can help me with this because there are a few flash masters over here hehe.

    In the flash website i'm developing for my church's library, now i need to create a books catalog. This consists in a main movieclip for the catalog section, then inside of it will be the movieclip thumbnails of all the books. I know I will be using a lot of FOR LOOPS, arrays and XML load vars, etc. to achive this.

    I need to be able to have the books info and the books front cover as an external .jpg and name them cover1.jpg, cover2.jpg, etc. also I need to create a search engine to search for a specific book, by name or by category and force the search input textbox to be small letters only (so I don't have to work with the case sensitive thing).

    This is the main feature of my church's library website and they are thinking about launching the site on february-march aproximately.

    If I don't manage to make this possible, i would have to create all the movieclips manually inside the main flash file, then put all the books movieclips into frames from 1 to 1,000 or much more (a lot of books heh?) then creating a function to detect if the word typed in the input textbox is equal to "apple" then myBooks.gotoAndStop("appleFrame");,
    if the word typed in the input textbox is equal to "how to pray" then myBooks.gotoAndStop("howtoPrayFrame"); and that's a really HARD WORK.

    So if someone is touched by this project, i know God will bless him/her a lot. Any help welcome thanks have a nice day
    Last edited by angelhdz; 12-11-2012 at 09:23 AM.
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  2. #2
    Senior Member
    Join Date
    Jan 2011
    Posts
    171
    Hope you get someone how will do all the work for you.

    Why don't you hire someone to make your life better for this type of projects?

    That will be your benefit in both learning and get the site done.

    Usually this will take two nested for loops to display the products in grid, and an if else statement for a pagination or at least a next previous page navigation to navigate n number of products.

    Manual set-up will not work for these kind of projects. You have to make it more dynamic so that it will come really flexible to search and to load also.

    You can PM me if you need to know anything else for this project.


    Regards



    arkitx

  3. #3
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Thanks for the reply. I dont like people make things for me, I like to learn and put that in practice. I only want someone to throw a light on me so I know what way I will take to achieving this. I already know How to create the multiple movieclips dynamically, and how to assign it a number
    PHP Code:
    for (var i=0i<=400i++){
        
    mc+[i].loadMovie(myClips);
        
    trace(mc+[i]+".jpg")
    }
    var 
    myClips="thumb"+[i]+".jpg"
    And also I can search in this forum how to load content from XML with loadvars (i've done this with a textfile).

    But I need some light to know how to make this, in a way that can be easier for the search engine.

    Also, how to create the empty clips, so there is a space/gap between each one like 10 or 15px. forming a grid as you said.
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  4. #4
    Senior Member
    Join Date
    Jan 2011
    Posts
    171
    PHP Code:
    var h_pad:Number 10;
    var 
    v_pad:Number 15;

    var 
    container:MovieClip;

    for (var 
    0i<4i++) {
        for (var 
    0j<3j++) {
            
    container attachMovie("empty_container""product_container"this.getNextHighestDepth());
            
    container._x h_pad+(container._width+h_pad)*i;
            
    container._y v_pad+(container._height+v_pad)*j;
        }

    Try this...



    arkitx

  5. #5
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Ok that works. But why I use a trace ( trace(container); and i get only
    _level0.mc0
    _level0.mc1
    _level0.mc2
    _level0.mc3

    if there are 12 movieclips created?
    Last edited by angelhdz; 12-11-2012 at 11:34 AM.
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  6. #6
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Ok! Fixed it!
    container = attachMovie("mc", "container"+[j], this.getNextHighestDepth());

    added the
    PHP Code:
     "container"+[j
    and added the less than or equal to sign
    PHP Code:
     for (var 0j<[B]=[/B]400[B]+1[/B]; j++) { 
    and now i can trace my 400 movieclips.

    Thanks for the help! The hard work comes later, when I load the .jpg's into each container with the XML loadVars...
    Last edited by angelhdz; 12-11-2012 at 11:48 AM.
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  7. #7
    Senior Member
    Join Date
    Jan 2011
    Posts
    171
    PHP Code:
    var h_pad:Number 10;
    var 
    v_pad:Number 15;

    var 
    container:MovieClip;

    for (var 
    0i<4i++) {
        for (var 
    0j<3j++) {
            
    container attachMovie("empty_container""product_container"this.getNextHighestDepth());
            
    container._x h_pad+(container._width+h_pad)*i;
            
    container._y v_pad+(container._height+v_pad)*j;
            
    trace(container);
        }


    Always post your code before asking. That will help others to understand the problem.



    arkitx

  8. #8
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Yeah i know i must post the code before asking, i have always done that way, but this thread clearly has no Initial code to post, i was asking for help, then i tried the for loop script and no success, then you successfully helped. It is a huge project that will be step by step scripted. The first step of the project has completed thanks to you. The movieclip containers are created, now the second step: load data into them with XML loadvars (book information, cover image/thumbnails .jpg's/, etc.)
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  9. #9
    Senior Member
    Join Date
    Jan 2011
    Posts
    171
    You might need this in the next ..

    PHP Code:
    var h_pad:Number 10;
    var 
    v_pad:Number 15;

    var 
    container:MovieClip;

    for (var 
    0i<3i++) {
        for (var 
    0j<4j++) {
            
    container attachMovie("empty_container""product_container"this.getNextHighestDepth());
            
    container._x h_pad+(container._width+h_pad)*j;
            
    container._y v_pad+(container._height+v_pad)*i;
            
    container.name=i+":"+j;
            
    container.onRelease=show_details;
            
    trace(container);
        }
    }
    function 
    show_details () {
        
    trace(this.name);



    arkitx

  10. #10
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Thanks. The details will be on the external .xml as a string, and it will be loaded into the show_details() function, so I don't have to edit the flash file each time I add a book. Everything will be specified in the XML and flash will load it from there and create the needed movieclips and dynamic textboxes
    to load the content for each book.
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  11. #11
    Senior Member
    Join Date
    Jan 2011
    Posts
    171
    PHP Code:
    Stage.scaleMode "noScale";

    var 
    h_pad:Number 10;
    var 
    v_pad:Number 25;

    var 
    container:MovieClip;
    var 
    label:TextField;
    for (var 
    0i<3i++) {
        for (var 
    0j<2j++) {
            
    container attachMovie("empty_container""product_container"this.getNextHighestDepth());
            
    container._x h_pad+(container._width+h_pad)*j;
            
    container._y v_pad+(container._height+v_pad)*i;
            
    container._name "Product "+String(container.getDepth());
            
    label container.createTextField("label"00container._height+2container._width20);
            
    label.text container._name;
            
    container.onRelease show_details;
            
    trace(container);
        }
    }
    function 
    show_details() {
        
    trace(this._name);



    arkitx

  12. #12
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Thank you! That will help a lot.
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

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