Welcome, Guest
  • Author Topic: The Store Challenge  (Read 1435 times)

    Tiauguinho

    • Server what's that
    • *
    • Posts: 4
      • View Profile
    The Store Challenge
    « on: 04/26/05, 07:12 »
    Dear Jorge and all the Flash-DB users,


    The Tutorial of your store was a god bless for me... Even though still didnt try it on my case, just seeing that a flash store is more then doable almost left me crazy with happiness! Been trying to do it for an year already, always failing on the last step!

    I've been trying to develop a store with my medium flash/coding skills for my own business and I've always hit on the wall. Although my approach was slightly different. I've put my problem on Kirupa, please check: http://www.kirupa.com/forum/showthread.php?t=93963

    So I got a question... I already have all the product categories done, all the individual product pages done, the only thing missing is the cart that doesnt work. Currently I add products to the cart via a loadVariables (loadVariables("http://www.sanum.com.pt/addcart.php?ref="+ref+"&desc="+desc+"&price="+price,this);)attached to each button. It seems that I will have to convert most of my stuff to the way you do it, but before i start messing around with all the code i got to ask you if this would be correct:

    Can I change the way you display the products? That is, can I easily apply my external movie clips to your store? This wouldnt require any conversion, just a change on code and of course adjusting the interface. Please check my www.sanum.com.pt so you can see how I've got things done until now :)

    Many thanks in advance for your attention! And sorry if my post is all confused, but writting it at work currently :D

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: The Store Challenge
    « Reply #1 on: 04/26/05, 09:15 »
    Hi Tiauguinho, bem-vindo to Flash-db Boards!

    You're loading products in a scrollPane or similar, so could adapt your store. How far you can go with this is upon your coding skills. Loading/or passing data to PHP just for a Shopping Cart seems quite inefficient. Anyway, give a try.

    Jorge

    Tiauguinho

    • Server what's that
    • *
    • Posts: 4
      • View Profile
    Re: The Store Challenge
    « Reply #2 on: 04/26/05, 09:53 »
    Obrigado Jorge!


    It was my intention initially to make the store full on Flash. But I was never able to do it. I looked around and seemed that my current PHP situation was the solution. Of course that i bumped on it as soon as i needed to indentify which user was buying what. If i had flash doing this instantly i wouldnt even worry with it...

    I'm gonna try to integrate my categories on your source files. I already use a scrollPane to do the same on my current situation. I got the categories files and the invidual products files (geral.swf and appe.swf for example)If i pass to your solution 100% is it hard to change your store to work with this outside files? So the scroll pane loads geral.swf and when a product is clicked it loads its individual page? Is this done on AS or on the .php files? How and where exactly shall I start applying this change?

    I'm really sorry if i might be making some seriously dumb questions or if I'm asking for the impossible, but my coding skill is pretty low... I took the challenge of doing the webpage for my own business, and coding is not part of my professional life. Flash is just a hobby. I got to confess that the code that you've written is pretty intimidating to me. But nonetheless I'm decided not to give up on this. I just hope that i can make this to work... I've been fighting with it for a long time.

    Thanks in advance for your attention.

    Regards,

    Tiago

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: The Store Challenge
    « Reply #3 on: 04/26/05, 10:17 »
    If you press on "Read full documentation" in the newstore page, you will have some explanation about the store. Anyway If you're not familiar with code, probably is not an easy way to addapt it to your structure. If you're not in a hurry, just give a look a the store to understand how it works and them try to use the principles in yours.

    Jorge

    Tiauguinho

    • Server what's that
    • *
    • Posts: 4
      • View Profile
    Re: The Store Challenge
    « Reply #4 on: 04/27/05, 06:32 »
    Jorge,


    I've seen the whole article about the store. Thats why I was intimidated by the code... It's too advanced for me. I'll still try to implement your solution, but dont have the slightest idea on even where to start changing your code. I'm currently trying to make mine work as well using session_id, I already have most of it done, so its just a tiny little step.

    I'm starting with a basic flash file that tries to play with session_id, just to see if it can work on flash. Can you give me a tip on this? I have this .php file:

    <?php

    session_start();
    if( isset($_SESSION['$randomVariable']) ){
        $_SESSION['$randomVariable']++;
    } else {
        $_SESSION['$randomVariable']=0;
    }

    echo "randomVariable=".$_SESSION['$randomVariable'];


    ?>

    And I have a flash file with a dynamic text field with Var: randomVariable inside a Movie Clip called TextHolder. I created a button that attaches this movie clip and another button that removes it.

    I use loadVariables("http://www.sanum.com.pt/test.php",this); when the button is clicked.

    When I publish it, I get 0 as expected when i click the "attach button". If i drag it to the browser and use flash inside the browser, I get a 0 initially. If i click on remove and then attach, it will still get a 0 instead of a 1. Shouldn't flash refresh the information? If I refresh the browser I get a 1 next time i click the button and so on.

    What am I doing wrong? Is there a way to force flash to refresh itself?

    Thank you for your help, specially since im taking things a bit off topic.

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: The Store Challenge
    « Reply #5 on: 04/27/05, 07:00 »
    To avoid cache use

    loadVariables("http://www.sanum.com.pt/test.php?"+Math.random(),this)

    Jorge

    Tiauguinho

    • Server what's that
    • *
    • Posts: 4
      • View Profile
    Re: The Store Challenge
    « Reply #6 on: 04/27/05, 07:20 »
    OMG! :D It works!


    Thank you Jorge!!! session_id works! So simple!