QR Code Generator... 2

QR Code Generator ..................................................................................................................... 2 Known Issue...
Author: Liliana Marsh
2 downloads 0 Views 1023KB Size
QR Code Generator ..................................................................................................................... 2 Known Issues ....................................................................................................................................... 3 QR Code Generator Services .............................................................................................................. 3 QRcode API .......................................................................................................................................... 3 QRcode () Constructor...................................................................................................................... 4 Implementing the Block ....................................................................................................................... 5 Configuring in Flash ......................................................................................................................... 5 Configuring the QR Code Generator Plain Text .............................................................................. 5 Configuring the QR Code Generator Phone Number ...................................................................... 7 Configuring the QR Code Generator URL ....................................................................................... 9 Configuring the QR Code Generator Email Message .................................................................... 11 Configuring the QR Code Generator SMS .................................................................................... 13 Configuring the QR Code Generator Geo Location ....................................................................... 15 Configuring the QR Code Generator Contact Info ......................................................................... 17 Configuring the QR Code Generator Calendar Event .................................................................... 20

QR Code Generator The QR Code Generator Block allows you to generate a QR code image into the Flash asset. The user then scans the code with their mobile phone and can directly access the data from the ad to their phone. QR code, otherwise known as Quick Response, allows you to take a piece of information from a transitory media and put in your cell phone. QR codes can store and digitally present data, including URLs, geo coordinates text and more. You can use QR codes in a number of ways. You can auto generate a QR code next to every product on your web site that contains all the product details, including the number to call and the URL link to the page. Your users can then show their friends these ads directly from their cell phone. You can also add a QR code to your business card containing your contact details so someone can easily add you to their contacts on their cell phone. The list of possibilities is endless. All your users need to do to view the QR code is to download a free card reader software on their Smart phone and they are ready to go. The QR Code Generator Block comes with eight most-common scenario templates: 1. Plain Text – allows you to enter free text in the code. 2. Phone Number – Allows you to enter a phone number in the code. For example enter the store’s phone number. 3. URL – Allows you to enter a URL address in the code. For example, enter the URL address of your website. 4. SMS – Allows you to enter an SMS message in the code. For example, enter a message "Send an SMS to number 5555 to win a free prize." 5. Email Message – Allows you to enter an email message in the code. 6. Geo Location – Allows you to enter geo coordinates in the code. For example, enter the coordinates of your store. 7. Contact Info – Allows you to enter your contact information. For example, enter your contact details so that you can be added automatically to the recipients contacts. 8. Calendar Event – Allows you to enter a calendar event details, including date, time, place, etc.

Demos/Downloads

To view a technical demo, click here ( http://demo.mediamind.com/blocks/qrcode/ http://creativezone.mediamind.com/blocks.aspx#ItemName=QR Code Generator).

To download this block and start using it now:  

Note: The user must scan the QR code with a mobile device. It is recommended to add a short explanation to the user in the ad, for example: "scan with mobile device to send SMS".

Known Issues  If you receive this error when publishing the FLA, you need to update your Workshop™ for Flash (MXP). Click here (http://demo.mediamind.com/Training_Zone/workshop/download.asp) to download the latest MXP.

QR Code Generator Services The QR Code Generator Block uses a web service in order to generate the QR code image. This block uses the Google API or the QR-SERVER API. You can decide which service to use, when implementing the block.

QRcode API Usage var QRobj:QRcode = new QRcode(qrContainerMC,200,QRcode.googleAPI,generatIconMC);

Public Methods Properties

Defined By

QRcode(containerMC:MovieClip,size:Number,service:String,generatIcon:Mo vieClip)

QRcode

Creates an instance of the QRcode class. generatText(txt:String):void

QRcode

Call to generate a simple text QR code image. generatTel(phoneNum:String):void

QRcode

Call to generate a phone number QR code image. generatURL(urlAddress:String):void Call to generate a URL QR code image.

QRcode

Properties

Defined By

generatSMS(phoneNum:String,message:String):void

QRcode

Call to generate an SMS message QR code image. generatEmail(emailAddress:String, emailSubject:String, emailContent:String):void

QRcode

Call to generate an email message QR code image. generatGeoLocation(latitude:String, longitude:String):void

QRcode

Call to generate a geo location QR code image. generatMECARD(Name:String, phoneNumber:String,emailAddress:String ,url:String, address:String, note:String):void

QRcode

Call to generate a contact info QR code image. generatCalendarEvent(eventTitle:String, sDate:String,sTime:String, eDate:String,eTime:String,GMTtimeZone:Number,daylightSavings:Boolean,l ocation:String, description:String):void

QRcode

Call to generate a calendar event QR code image. Public Events Events

Defined By

generateError

QRcode

Dispatched when there is an Error when calling to generate the QR code. generateComplete

QRcode

Dispatched when the QR code image is loaded.

QRcode () Constructor Public function QRcode(containerMC:MovieClip,size:Number,service:String,generatIcon:MovieC lip)

Parameters containerMC: MovieClip - The Movie clip that will contain the QR code image. size: Number – The size of the QR code image in pixels . service: String – The API service.[ QRcode.googleAPI or QRcode.qrServerAPI] generatIcon: MovieClip – The progress movie clip. Will be displayed when there is a call to generate a QR code image and will be hidden if the QR code image was loaded.

Implementing the Block Before you Begin Make sure you have the following resources available:   Note: This Block is compatible with both AS2 and AS3.

Configuring in Flash The QR Code Generator Block is accompanied with eight templates:        

Configuring the QR Code Generator Plain Text The ‘QRcode_Plain_Text_AS3.eba’ and ‘QRcode_Plain_Text_AS2.eba’ templates allow you to generate simple text QR code, coupons, details, etc. QR Code Generator Plain Text API

Public function generatText(txt:String):void

Parameters txt: String –The text that will be generated. Usage QRobj.generatText("simple Text");

AS3 Implementation 1. In the Sizmek Workshop ™ for Flash, open the ‘QRcode_Plain_Text_AS3.eba’ file using the Open Existing Ad option. 2. Select the second frame in the ‘actions’ layer and open the Actions panel. 3. Import the ‘QRcode’ class:

//import QRcode class import com.sizmek.QRcode.* 4. Create an QRcode instance as follows:

//Create an QRcode instance using the Google API var QRobj:QRcode = new QRcode(qrContainerMC,170,QRcode.googleAPI,generatIconMC); 5. Register to the events as follows:

//register to events QRobj.addEventListener("generateError", generateErrorFunc); QRobj.addEventListener("generateComplete", generateCompleteFunc); 6. Call to generate a QR code image as follows:

//call to generate QR QRobj.generatText(contentValue.text); 7. Retrieve the error and complete Events as follows:

function generateCompleteFunc(e:Event):void{ //handle complete event //add animation/transition/text and etc. trace("generateCompleteFunc"); } function generateErrorFunc(e:Event):void{ //handle Errors trace("generateErrorFun"); }

AS2 Implementation 1. In the Sizmek Workshop ™ for Flash, open the ‘QRcode_Plain_Text_AS2.eba’ file using the Open Existing Ad option. 2. Select the second frame in the ‘actions’ layer and open the Actions panel. 3. Import the ‘QRcode’ class:

//import QRcode class import com.sizmek.QRcode.* 4. Create an QRcode instance as follows:

//Create an QRcode instance using the Google API var QRobj:QRcode = new QRcode(qrContainerMC,170,QRcode.googleAPI,generatIconMC);

5. Register to the events as follows:

//register to events QRobj.addEventListener("generateError", generateErrorFunc); QRobj.addEventListener("generateComplete", generateCompleteFunc); 6. Call to generate a QR code image as follows:

//call to generate QR QRobj.generatText(contentValue.text); 7. Retrieve the error and complete Events as follows:

function generateCompleteFunc(evt):Void{ //handle complete event //add animation/transition/text and etc. trace("generateCompleteFunc"); } function generateErrorFunc(evt):Void{ //handle Errors trace("generateErrorFun"); }

Configuring the QR Code Generator Phone Number The ‘QRcode_Phone_Number_AS3.eba’ and ‘QRcode_Phone_Number_AS2.eba’ templates allow you to generate QR code with a phone number.

QR Code Generator Phone Number API

Public function generatTel(phoneNum:String):void

Parameters phoneNumber: String –The phone number that will be generated. Usage QRobj.generatTel("6462021320");

AS3 Implementation 1. In the Sizmek Workshop ™ for Flash, open the ‘QRcode_Plain_Text_AS3.eba’ file using the Open Existing Ad option. 2. Select the second frame in the ‘actions’ layer and open the Actions panel. 3. Import the ‘QRcode’ class:

//import QRcode class import com.sizmek.QRcode.* 4. Create an QRcode instance as follows:

//Create an QRcode instance using the Google API var QRobj:QRcode = new QRcode(qrContainerMC,170,QRcode.googleAPI,generatIconMC); 5. Register to the events as follows:

//register to events QRobj.addEventListener("generateError", generateErrorFunc); QRobj.addEventListener("generateComplete", generateCompleteFunc); 6. Call to generate a QR code image as follows:

//call to generate QR QRobj.generatText(contentValue.text); 7. Retrieve the error and complete Events as follows:

function generateCompleteFunc(e:Event):void{ //handle complete event //add animation/transition/text and etc. trace("generateCompleteFunc"); } function generateErrorFunc(e:Event):void{ //handle Errors trace("generateErrorFun"); }

AS2 Implementation 1. In the Sizmek Workshop ™ for Flash, open the ‘QRcode_Plain_Text_AS2.eba’ file using the Open Existing Ad option. 2. Select the second frame in the ‘actions’ layer and open the Actions panel. 3. Import the ‘QRcode’ class:

//import QRcode class import com.sizmek.QRcode.* 4. Create an QRcode instance as follows:

//Create an QRcode instance using the Google API var QRobj:QRcode = new QRcode(qrContainerMC,170,QRcode.googleAPI,generatIconMC); 5. Register to the events as follows:

//register to events QRobj.addEventListener("generateError", generateErrorFunc); QRobj.addEventListener("generateComplete", generateCompleteFunc); 6. Call to generate a QR code image as follows:

//call to generate QR QRobj.generatText(contentValue.text); 7. Retrieve the error and complete Events as follows:

function generateCompleteFunc(evt):Void{ //handle complete event //add animation/transition/text and etc. trace("generateCompleteFunc"); } function generateErrorFunc(evt):Void{ //handle Errors trace("generateErrorFun"); }

Configuring the QR Code Generator URL The ‘QRcode_URL_AS3.eba’ and ‘QRcode_URL_AS2.eba’ templates allow you to generate QR code with a URL address. This can be used for example, if you want to advertise the URL of a website.

QR Code Generator URL API

Public function generatURL(urlAddress:String):void

Parameters urlAddress: String – The URL address that will be generated. Usage QRobj.generatURL("http://www.sizmek.com");

AS3 Implementation 1. In the Sizmek Workshop ™ for Flash, open the ‘QRcode_URL_AS3.eba’ file using the Open Existing Ad option. 2. Select the second frame in the ‘actions’ layer and open the Actions panel. 3. Import the ‘QRcode’ class:

//import QRcode class import com.sizmek.QRcode.* 4. Create an QRcode instance as follows:

//Create an QRcode instance using the Google API var QRobj:QRcode = new QRcode(qrContainerMC,170,QRcode.googleAPI,generatIconMC); 5. Register to the events as follows:

//register to events QRobj.addEventListener("generateError", generateErrorFunc); QRobj.addEventListener("generateComplete", generateCompleteFunc); 6. Call to generate a QR code image as follows:

//the url address that will be generated var siteURL:String = "http://www.sizmek.com"; //call to generate QR QRobj.generatURL(siteURL); 7. Retrieve the error and complete Events as follows:

function generateCompleteFunc(e:Event):void{ //handle complete event //add animation/transition/text and etc. trace("generateCompleteFunc"); } function generateErrorFunc(e:Event):void{ //handle Errors trace("generateErrorFun"); }

AS2 Implementation 1. In the Sizmek Workshop ™ for Flash, open the ‘QRcode_URL_AS2.eba’ file using the Open Existing Ad option. 2. Select the second frame in the ‘actions’ layer and open the Actions panel. 3. Import the ‘QRcode’ class:

//import QRcode class import com.sizmek.QRcode.* 4. Create an QRcode instance as follows:

//Create an QRcode instance using the Google API var QRobj:QRcode = new QRcode(qrContainerMC,170,QRcode.googleAPI,generatIconMC); 5. Register to the events as follows:

//register to events QRobj.addEventListener("generateError", generateErrorFunc); QRobj.addEventListener("generateComplete", generateCompleteFunc); 6. Call to generate a QR code image as follows:

//the url address that will be generated var siteURL:String = "http://www.sizmek.com"; //call to generate QR QRobj.generatURL(siteURL);

7. Retrieve the error and complete Events as follows:

function generateCompleteFunc(evt):Void{ //handle complete event //add animation/transition/text and etc. trace("generateCompleteFunc"); } function generateErrorFunc(evt):Void{ //handle Errors trace("generateErrorFun"); }

Configuring the QR Code Generator Email Message The ‘QRcode_Email_Message_AS3.eba’ and ‘QRcode_Email_Message_AS2.eba’ templates allow you to generate QR code with an Email message. This can be useful, for example, when you want to send an email with your contact information. After scanning the QR code, the user automatically receives the email to their inbox.

QR Code Generator Email Message API

Public function generatEmail(emailAddress:String, emailSubject:String, emailContent:String):void

Parameters emailAddress: String – The email address. emailSubject: String – The subject of the email. emailContent: String – The content of the email. Usage QRobj.generatEmail("[email protected]", "Email Subject", "Content --- *For demo purposes only.");

AS3 Implementation 1. In the Sizmek Workshop ™ for Flash, open the ‘QRcode_Email_Message_AS3.eba’ file using the Open Existing Ad option. 2. Select the second frame in the ‘actions’ layer and open the Actions panel. 3. Import the ‘QRcode’ class:

//import QRcode class import com.sizmek.QRcode.* 4. Create an QRcode instance as follows:

//Create an QRcode instance using the Google API var QRobj:QRcode = new QRcode(qrContainerMC,170,QRcode.googleAPI,generatIconMC); 5. Register to the events as follows:

//register to events QRobj.addEventListener("generateError", generateErrorFunc); QRobj.addEventListener("generateComplete", generateCompleteFunc); 6. Call to generate QR code image as follows:

//call to generate QR var emailAddress:String = "[email protected]"; var emailSubject:String = "Email Subject"; var emailContent:String = "Content --- *For demo purposes only."; QRobj.generatEmail(emailAddress,emailSubject,emailContent); 7. Retrieve the error and complete Events as follows:

function generateCompleteFunc(e:Event):void{ //handle complete event //add animation/transition/text and etc. trace("generateCompleteFunc"); } function generateErrorFunc(e:Event):void{ //handle Errors trace("generateErrorFun"); }

AS2 Implementation 1. In the Sizmek Workshop ™ for Flash, open the ‘QRcode_Email_Message_AS2.eba’ file using the Open Existing Ad option. 2. Select the second frame in the ‘actions’ layer and open the Actions panel. 3. Import the ‘QRcode’ class:

//import QRcode class import com.sizmek.QRcode.* 4. Create an QRcode instance as follows:

//Create an QRcode instance using the Google API var QRobj:QRcode = new QRcode(qrContainerMC,170,QRcode.googleAPI,generatIconMC); 5. Register to the events as follows:

//register to events QRobj.addEventListener("generateError", generateErrorFunc); QRobj.addEventListener("generateComplete", generateCompleteFunc);

6. Call to generate a QR code image as follows:

//call to generate QR var emailAddress:String = "[email protected]"; var emailSubject:String = "Email Subject"; var emailContent:String = "Content --- *For demo purposes only."; QRobj.generatEmail(emailAddress,emailSubject,emailContent); 7. Retrieve the error and complete Events as follows:

function generateCompleteFunc(evt):Void{ //handle complete event //add animation/transition/text and etc. trace("generateCompleteFunc"); } function generateErrorFunc(evt):Void{ //handle Errors trace("generateErrorFun"); }

Configuring the QR Code Generator SMS The ‘QRcode_SMS_AS3.eba’ and ‘QRcode_SMS_AS2.eba’ templates allow you to generate QR code with an SMS text message. You can use this for example, when you want to send an SMS with a message like: "Text your name to this number to win a free prize."

QR Code Generator SMS API

Public function generatSMS(phoneNum:String,message:String):void

Parameters phoneNumber: String – The phone number that will be generated and will be received by the SMS message. message: String – The SMS message content that will be generated. Usage QRobj.generatSMS("*5555","message content");

AS3 Implementation 1. In the Sizmek Workshop ™ for Flash, open the ‘QRcode_SMS_AS3.eba’ file using the Open Existing Ad option. 2. Select the second frame in the ‘actions’ layer and open the Actions panel. 3. Import the ‘QRcode’ class:

//import QRcode class import com.sizmek.QRcode.*

4. Create an QRcode instance as follows:

//Create an QRcode instance using the Google API var QRobj:QRcode = new QRcode(qrContainerMC,170,QRcode.googleAPI,generatIconMC); 5. Register to the events as follows:

//register to events QRobj.addEventListener("generateError", generateErrorFunc); QRobj.addEventListener("generateComplete", generateCompleteFunc); 6. Call to generate a QR code image as follows:

//the phone number that will be generated var phoneNumber:String = "*5555"; //the message content var messageContent :String = "acme \n *For demo purposes only." //call to generate QR QRobj.generatSMS(phoneNumber,messageContent); 7. Retrieve the error and complete Events as follows:

function generateCompleteFunc(e:Event):void{ //handle complete event //add animation/transition/text and etc. trace("generateCompleteFunc"); } function generateErrorFunc(e:Event):void{ //handle Errors trace("generateErrorFun"); }

AS2 Implementation 1. In the Sizmek Workshop ™ for Flash open, the ‘MMBlock_QRcode_generator_SMS_AS2.eba’ file using the Open Existing Ad option. 2. Select the second frame in the ‘actions’ layer and open the Actions panel. 3. Import the ‘QRcode’ class:

//import QRcode class import com.sizmek.QRcode.* 4. Create an QRcode instance as follows:

//Create an QRcode instance using the Google API var QRobj:QRcode = new QRcode(qrContainerMC,170,QRcode.googleAPI,generatIconMC); 5. Register to the events as follows:

//register to events QRobj.addEventListener("generateError", generateErrorFunc); QRobj.addEventListener("generateComplete", generateCompleteFunc); 6. Call to generate a QR code image as follows:

//the phone number that will be generated var phoneNumber:String = "*5555"; //the message content var messageContent :String = "acme \n *For demo purposes only." //call to generate QR QRobj.generatSMS(phoneNumber,messageContent); 7. Retrieve the error and complete Events as follows:

function generateCompleteFunc(evt):Void{ //handle complete event //add animation/transition/text and etc. trace("generateCompleteFunc"); } function generateErrorFunc(evt):Void{ //handle Errors trace("generateErrorFun"); }

Configuring the QR Code Generator Geo Location The ‘QRcode_GeoLocation_AS3.eba’ and ‘QRcode_GeoLocation_AS2.eba’ templates allow you to generate QR code with geo location. This can be useful when you want to show coordinates on a map or when you want to retrieve directions to a specific location.

QR Code Generator Geo Location API

Public function generatGeoLocation(latitude:String, longitude:String):void

Parameters latitude: String – The latitude coordinate. longitude: String – The longitude coordinate. Usage QRobj.generatGeoLocation("40.739","-73.993");

AS3 Implementation 1. In the Sizmek Workshop ™ for Flash, open the ‘QRcode_GeoLocation_AS3.eba’ file using the Open Existing Ad option. 2. Select the second frame in the ‘actions’ layer and open the Actions panel.

3. Import the ‘QRcode’ class:

//import QRcode class import com.sizmek.QRcode.* 4. Create an QRcode instance as follows:

//Create an QRcode instance using the Google API var QRobj:QRcode = new QRcode(qrContainerMC,170,QRcode.googleAPI,generatIconMC); 5. Register to the events as follows:

//register to events QRobj.addEventListener("generateError", generateErrorFunc); QRobj.addEventListener("generateComplete", generateCompleteFunc); 6. Call to generate a QR code image as follows:

//call to generate QR var Latitude:String = "40.739"; var Longitude:String = "-73.993"; QRobj.generatGeoLocation(Latitude,Longitude); 7. Retrieve the error and complete Events as follows::

function generateCompleteFunc(e:Event):void{ //handle complete event //add animation/transition/text and etc. trace("generateCompleteFunc"); } function generateErrorFunc(e:Event):void{ //handle Errors trace("generateErrorFun"); }

AS2 Implementation 1. In the Sizmek Workshop ™ for Flash, open the ‘QRcode_GeoLocation_AS2.eba’ file using the Open Existing Ad option. 2. Select the second frame in the ‘actions’ layer and open the Actions panel. 3. Import the ‘QRcode’ class:

//import QRcode class import com.sizmek.QRcode.* 4. Create an QRcode instance as follows:

//Create an QRcode instance using the Google API var QRobj:QRcode = new QRcode(qrContainerMC,170,QRcode.googleAPI,generatIconMC); 5. Register to the events as follows:

//register to events QRobj.addEventListener("generateError", generateErrorFunc); QRobj.addEventListener("generateComplete", generateCompleteFunc); 6. Call to generate a QR code image as follows:

//call to generate QR var Latitude:String = "40.739"; var Longitude:String = "-73.993"; QRobj.generatGeoLocation(Latitude,Longitude); 7. Retrieve the error and complete Events as follows:

function generateCompleteFunc(evt):Void{ //handle complete event //add animation/transition/text and etc. trace("generateCompleteFunc"); } function generateErrorFunc(evt):Void{ //handle Errors trace("generateErrorFun"); }

Configuring the QR Code Generator Contact Info The ‘QRcode_Contact_Info_AS3.eba’ and ‘QRcode_Contact_Info_AS2.eba’ templates allow you to generate QR code with contact information. This can be useful for example, when you want to send your contact information so that it goes directly to the user’s Contacts menu.

QR Code Generator MECARD API

Public function generatMECARD(Name:String, phoneNumber:String,emailAddress:String ,url:String, address:String, note:String):void

Parameters Name: String – The contact’s name. phoneNumber: String – The contact’s phone number. emailAddress: String – The contact’s email address. url: String – The contact’s website address. address: String – The contact’s postal address. note: String – A note for more information. Usage

var fullName:String = "Sizmek Headquraters"; var phoneNumber:String = "6462021320"; var email:String = "[email protected]"; var siteURL:String = "http://www.sizmek.com"; var address:String = "135 West 18th St., 5th Floor New York, NY 10011"; var note:String = "insert your note here"; QRobj.generatMECARD(fullName,phoneNumber,email,siteURL,address,note);

AS3 Implementation 1. In the Sizmek Workshop ™ for Flash, open the ‘QRcode_Contact_Info_AS3.eba’ file using the Open Existing Ad option. 2. Select the second frame in the ‘actions’ layer and open the Actions panel. 3. Import the ‘QRcode’ class:

//import QRcode class import com.sizmek.QRcode.* 4. Create an QRcode instance as follows:

//Create an QRcode instance using the Google API var QRobj:QRcode = new QRcode(qrContainerMC,170,QRcode.googleAPI,generatIconMC); 5. Register to the events as follows:

//register to events QRobj.addEventListener("generateError", generateErrorFunc); QRobj.addEventListener("generateComplete", generateCompleteFunc); 6. Call to generate a QR code image as follows:

//call to generate QR var fullName:String = "Sizmek Headquarters"; var phoneNumber:String = "6462021320"; var email:String = "[email protected]"; var siteURL:String = "http://www.sizmek.com"; var address:String = "135 West 18th St., 5th Floor New York, NY 10011"; var note:String = "insert your note here"; QRobj.generatMECARD(fullName,phoneNumber,email,siteURL,address,note ); 7. Retrieve the error and complete Events as follows::

function generateCompleteFunc(e:Event):void{ //handle complete event //add animation/transition/text and etc. trace("generateCompleteFunc"); } function generateErrorFunc(e:Event):void{ //handle Errors trace("generateErrorFun"); }

AS2 Implementation 1. In the Sizmek Workshop ™ for Flash, open the ‘QRcode_Contact_Info_AS2.eba’ file using the Open Existing Ad option. 2. Select the second frame in the ‘actions’ layer and open the Actions panel. 3. Import the ‘QRcode’ class:

//import QRcode class import com.sizmek.QRcode.* 4. Create an QRcode instance as follows:

//Create an QRcode instance using the Google API var QRobj:QRcode = new QRcode(qrContainerMC,170,QRcode.googleAPI,generatIconMC); 5. Register to the events as follows:

//register to events QRobj.addEventListener("generateError", generateErrorFunc); QRobj.addEventListener("generateComplete", generateCompleteFunc); 6. Call to generate a QR code image as follows:

//call to generate QR var fullName:String = "Sizmek Headquarters"; var phoneNumber:String = "6462021320"; var email:String = "[email protected]"; var siteURL:String = "http://www.sizmek.com"; var address:String = "135 West 18th St., 5th Floor New York, NY 10011"; var note:String = "insert your note here"; QRobj.generatMECARD(fullName,phoneNumber,email,siteURL,address,note); 7. Retrieve the error and complete Events as follows:

function generateCompleteFunc(evt):Void{ //handle complete event //add animation/transition/text and etc. trace("generateCompleteFunc"); } function generateErrorFunc(evt):Void{ //handle Errors trace("generateErrorFun"); }

Configuring the QR Code Generator Calendar Event The ‘QRcode_Calendar_Event_AS3.eba’ and ‘QRcode_Calendar_Event_AS2.eba’ templates allow you to generate QR code with event details. This can be used, for example, when you want to send details to a calendar event including the date, time and place. Once the user scans the code, the event details will be automatically added to their Calendar application in their phone. QR Code Calendar Event API

Public function generatCalendarEvent(eventTitle:String, sDate:String,sTime:String, eDate:String,eTime:String,GMTtimeZone:Number,daylightSavings:Boolean,locat ion:String, description:String):void

Parameters eventTitle: String – The title of the event. sDate: String – The start date of the event. Date format: date/month/year - 4/11/2021 sTime: String – The start time of the event. Time format: hours:minutes - 20:00 eDate: String – The end date of the event. Date format: date/month/year - 4/11/2021 eTime: String – The end time of the event. Time format: hours:minutes - 23:00 GMTtimeZone: Number – The GMT time zone. For example, New York GMT (-5) daylightSavings: Boolean – If the event date is going to take place during daylight savings time, set as true.If not, set as false. location: String – The address where the event is going to take place. description: String – A description of the event. Note: The QR code contains the date and time in UTC time (GMT) When the user scans the QR code, the time will update according to the user’s time zone. To make sure that the user receives the correct information, set the GMTtimeZone and daylightSaving parameters. To set the UTC time, set the parameters as follows: GMTtimeZone =0, daylightSaving = true/false according to the date.It is recommended to add the date and time and GMT details in the event description for example: "The event will take place in New York 4/11/2021 20:00-23:00 GMT-5".

Example var eventTitle:String = "20th Annual Sizmek Rich Media Awards"; var startDate:String = "4/11/2021"; // date/month/year var startTime:String = "20:00"; // hours:minutes var endDate:String = "4/11/2021"; // date/month/year var endTime:String = "23:00"; var GMTtimeZone:Number = -5; var daylightSavings = true; var eventLocation:String = "New York City"; var eventDescription:String = "The event will take place in New York on 4/11/2021 from 20:00-23:00 GMT-5 daylight Savings (GMT-4) *For demo purposes only." QRobj.generatCalendarEvent(eventTitle, startDate,startTime, endDate,endTime,GMTtimeZone,daylightSavings,eventLocation,eventDescription);

AS3 Implementation 1. In the Sizmek Workshop ™ for Flash, open the ‘QRcode_Calendar_Event_AS3.eba’ file using the Open Existing Ad option. 2. Select the second frame in the ‘actions’ layer and open the Actions panel. 3. Import the ‘QRcode’ class:

//import QRcode class import com.sizmek.QRcode.* 4. Create an QRcode instance as follows:

// Create an QRcode instance using the Google API var QRobj:QRcode = new QRcode(qrContainerMC,170,QRcode.googleAPI,generatIconMC); 5. Register to the events as follows:

//register to events QRobj.addEventListener("generateError", generateErrorFunc); QRobj.addEventListener("generateComplete", generateCompleteFunc); 6. Call to generate a QR code image as follows:

//call to generate QR var eventTitle:String = "20th Annual Sizmek Rich Media Awards"; var startDate:String = "4/11/2021"; // date/month/year var startTime:String = "20:00"; // hours:minutes var endDate:String = "4/11/2021"; // date/month/year var endTime:String = "23:00"; var GMTtimeZone:Number = -5; var daylightSavings = true; var eventLocation:String = "New York City"; var eventDescription:String = "The event will take place in New York on 4/11/2021 from 20:00-23:00 GMT-5 daylight Savings (GMT-4) *For demo purposes only." QRobj.generatCalendarEvent(eventTitle, startDate,startTime, endDate,endTime,GMTtimeZone,daylightSavings,eventLocation,eventDescr iption); 7. Retrieve the error and complete Events as follows:

function generateCompleteFunc(e:Event):void{ //handle complete event //add animation/transition/text and etc. trace("generateCompleteFunc"); } function generateErrorFunc(e:Event):void{ //handle Errors trace("generateErrorFun"); }

AS2 Implementation 1. In the Sizmek Workshop ™ for Flash, open the ‘QRcode_Calendar_Event_AS2.eba’ file using the Open Existing Ad option. 2. Select the second frame in the ‘actions’ layer and open the Actions panel. 3. Import the ‘QRcode’ class:

//import QRcode class import com.sizmek.QRcode.* 4. Create an QRcode instance as follows:

//Create an QRcode instance using the Google API var QRobj:QRcode = new QRcode(qrContainerMC,170,QRcode.googleAPI,generatIconMC); 5. Register to the events as follows:

//register to events QRobj.addEventListener("generateError", generateErrorFunc); QRobj.addEventListener("generateComplete", generateCompleteFunc);

6. Call to generate a QR code image as follows:

//call to generate QR var eventTitle:String = "20th Annual Sizmek Rich Media Awards"; var startDate:String = "4/11/2021"; // date/month/year var startTime:String = "20:00"; // hours:minutes var endDate:String = "4/11/2021"; // date/month/year var endTime:String = "23:00"; var GMTtimeZone:Number = -5; var daylightSavings = true; var eventLocation:String = "New York City"; var eventDescription:String = "The event will take place in New York on 4/11/2021 from 20:00-23:00 GMT-5 daylight Savings (GMT-4) *For demo purposes only." QRobj.generatCalendarEvent(eventTitle, startDate,startTime, endDate,endTime,GMTtimeZone,daylightSavings,eventLocation,eventDescri ption); 7. Retrieve the error and complete Events as follows:

function generateCompleteFunc(evt):Void{ //handle complete event //add animation/transition/text and etc. trace("generateCompleteFunc"); } function generateErrorFunc(evt):Void{ //handle Errors trace("generateErrorFun"); }

Suggest Documents