1 Attachment(s)
Insert selected info to database
Hi guys. I'm sorry for asking I'm just running out of time. :(
So i'm trying to make something like this: http://www.bakedbymelissa.com/checko...erCreator.aspx
For now, I have this: Attachment 75189
the square represents the cupcake base. the circles are movieclips too. The as layer has the code to tween what square appears. My problem is, if i click the circle beside chocolate, a text/string "chocolate" must be saved in a database field..same goes if the others are clicked but only one. Assuming there is a submit button. I use mysql. Can you show me how?
The code so far:
Hi guys I'm making something like this: [Cupcake Creator][1]
For now, I have this: ![window][2]
I'm going to put this in a php page. I have 4 squares and 4 circles.all movieclips.the flavors are just static texts.the as layer contains the code to tween what square should appear.that was solved in my previous question here.
Here's what I want to achieve:
If I click chocolate or vanilla, or any of those four, it should be saved in a database when the button submit is clicked(assuming there is already a button).I use mysql. I don't know how to get those strings I'm in a rush so i don't have time to try everything on google. Please help. noob here.
[1]: http://www.bakedbymelissa.com/checko...erCreator.aspx
[2]: http://i.stack.imgur.com/I6MLq.png
The as code so far:
Code:
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.MouseEvent;
import fl.transitions.Tween;
import fl.transitions.TweenEvent;
import fl.transitions.easing.*;
// to indicate the index of current active circle/square
var current:int = 0;
var fadeIn:Tween, fadeOut:Tween;
var thisCircle:MovieClip;
var thisSquare:MovieClip;
var circles:Array = new Array(circle1, circle2, circle3, circle4);
var squares:Array = new Array(square1, square2, square3, square4);
for(var i:Number = 0; i < circles.length; i++)
{
thisCircle = circles[i];
thisCircle.buttonMode = true;
thisCircle.id = i;
thisCircle.addEventListener(MouseEvent.CLICK, doFadeIn);
// keep the first square as visible
if(i != current){
thisSquare = squares[i];
thisSquare.alpha = 0;
}
}
function doFadeIn(e:MouseEvent):void
{
// if our button is the active one, exit
if(current == e.currentTarget.id) return;
// fade out current square
fadeOut = new Tween(squares[current], "alpha", None.easeNone, 1, 0, 2.5, true);
// fade in the new active square
fadeIn = new Tween(squares[e.currentTarget.id], "alpha", None.easeNone, 0, 1, 2.5, true);
current = e.currentTarget.id;
}