ActiveDen

Smart Social Buttons AS3

  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Macedonia
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars

Great animation :)

CodePower

Thanks a lot DaDog :)

  • Exclusive Author
  • Has been a member for 2-3 years
  • India
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars

Nice Design !

CodePower

Thanks a lot, ravi_allam.

  • Exclusive Author
  • Has been a member for 1-2 years
  • Referred between 1 and 9 users
  • Sold between 1 and 100 dollars
  • Turkey

Nice work :)

CodePower

Thanks ,byharby ;)

  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Italy
  • Sold between 1 and 100 dollars

Hello, i added the FB button into my project.

The animation doesn’t start, and i also need to add the facebook page url. Can you give me your support?

Thanks

CodePower

Hi gigiolamassa, Here is the support that you asked for :

  • 1 : Open Your Project.
  • 2 : In the first scenario create a new layer in the main timeline call it “Actions”.
  • 3 : Create another layer below it and call it “facebook button”.
  • 4 : Open the « Smart Social Buttons AS3 .fla » file.
  • 5 : Locate The layer called “Facebook”, select the first frame:
    • 5-A : Right click and hit “copy frames”.
    • OR
    • 5-B : Hit CTRL + C.
  • 6 : Go back to your project select the first frame of the layer called “facebook button” :
    • 6-A : Right click and hit “paste frames”.
    • OR
    • 6-B : Hit CTRL + V.
  • 7 : Open up the “Actions” panel , for that: select the first frame of the layer called “Actions” and :
    • 7-A : Right click and hit “Actions”.
    • OR
    • 7-B : Hit F9
  • 8 : A new window appears, you have just to paste this code :
//////////////////////       Facebook Button
facebook_mc.coloredBG_mc.gotoAndStop(2);
facebook_mc.blackBG_mc.gotoAndStop(2);
facebook_mc.bMode_btn.addEventListener(MouseEvent.MOUSE_OVER, facebookOver);
function facebookOver(e:MouseEvent):void{
    facebook_mc.gotoAndPlay("s1");
    facebook_mc.coloredBG_mc.gotoAndStop(2);
    facebook_mc.shadowBG_mc.gotoAndStop(2);
}

facebook_mc.bMode_btn.addEventListener(MouseEvent.MOUSE_OUT, facebookOut);
function facebookOut(e:MouseEvent):void{
    facebook_mc.gotoAndPlay("s2");
    facebook_mc.icon02_mc.gotoAndStop(1);
}

facebook_mc.bMode_btn.addEventListener(MouseEvent.CLICK, facebookClick);
function facebookClick(e:MouseEvent):void{
    navigateToURL(new URLRequest("http://www.facebook.com"));
}
  • 9 : Now you can put your own URL , Just change the “Facebook” web address.
  • 10 : Run your file. Enjoy. Done.
  • - If you have any questions, just contact me, I’ll be glad to answer you.

    - Don’t forget to rate my item if you like it, it’s highly appreciated. Thank You.

    • Exclusive Author
    • Has been a member for 1-2 years
    • Referred between 10 and 49 users
    • Sold between 1 000 and 5 000 dollars

    Don’t forget to share my item. Thank you.

    • Bought between 10 and 49 items
    • Exclusive Author
    • Has been a member for 3-4 years
    • Italy
    • Sold between 1 and 100 dollars

    Nothing’s done. I think it is very complex to insert this Button into Synch template…

    Thank you very much anyway.

    CodePower

    Hi gigiolamassa, Ii think that I find a solution that it will definitely work. You have to make two steps:

    STEP 01 :

    The same as the first one with a little change (the change here is to create a new blank project), I’ve re-wrote all the steps with the changes:
    • 1 : create a new blank project and save it with the name “face.fla”.
    • 2 : In the first scenario create a new layer in the main timeline call it “Actions”.
    • 3 : Create another layer below it and call it “facebook button”.
    • 4 : Open the « Smart Social Buttons AS3 .fla » file.
    • 5 : Locate The layer called “Facebook”, select the first frame:
      • 5-A : Right click and hit “copy frames”.
      • OR
      • 5-B : Hit CTRL + C.
    • 6 : Go back to the new project select the first frame of the layer called “facebook button” (after you import the button you can resize it: just hit the “Q” key to select the free transform tool, hold the “Shift” key to make a perfect resizing and RESIZE ):
      • 6-A : Right click and hit “paste frames”.
      • OR
      • 6-B : Hit CTRL + V.
    • 7 : Open up the “Actions” panel , for that: select the first frame of the layer called “Actions” and :
      • 7-A : Right click and hit “Actions”.
      • OR
      • 7-B : Hit F9
    • 8 : A new window appears, you have just to paste this code :
    //////////////////////       Facebook Button
    facebook_mc.coloredBG_mc.gotoAndStop(2);
    facebook_mc.blackBG_mc.gotoAndStop(2);
    facebook_mc.bMode_btn.addEventListener(MouseEvent.MOUSE_OVER, facebookOver);
    function facebookOver(e:MouseEvent):void{
        facebook_mc.gotoAndPlay("s1");
        facebook_mc.coloredBG_mc.gotoAndStop(2);
        facebook_mc.shadowBG_mc.gotoAndStop(2);
    }
    
    facebook_mc.bMode_btn.addEventListener(MouseEvent.MOUSE_OUT, facebookOut);
    function facebookOut(e:MouseEvent):void{
        facebook_mc.gotoAndPlay("s2");
        facebook_mc.icon02_mc.gotoAndStop(1);
    }
    
    facebook_mc.bMode_btn.addEventListener(MouseEvent.CLICK, facebookClick);
    function facebookClick(e:MouseEvent):void{
        navigateToURL(new URLRequest("http://www.facebook.com"));
    }
    
  • 9 : Now you can put your own URL , Just change the “Facebook” web address.
  • 10 : Run your file.(This action will generate a SWF file called “face.swf”) (Before running the file I recommend to resize the file to the button dimensions.)
  • STEP 02 :

    - Here we are going to load the “face.swf” file who contains our button.

    _ Open your project, and where you want it to appear: in the beginning, in the middle, in the end, when you click button or when you run an action you have just to copy and paste these lines of code (Make sure that you put the “face.swf” file in the same location (directory) as your main file.):

    var myURL:URLRequest = new URLRequest("face.swf");
    var myLoader:Loader = new Loader();
    
    myLoader.load(myURL);
    myLoader.x = 200;      //You can change the x and y positions.
    myLoader.y = 40;
    addChild(myLoader);
    

    - If you have any questions, just contact me, I’ll be glad to answer you.

    - Don’t forget to rate my item and share it if you like it, it’s highly appreciated. Thank You.

    • Bought between 10 and 49 items
    • Exclusive Author
    • Has been a member for 3-4 years
    • Italy
    • Sold between 1 and 100 dollars

    Hello CodePower, you’re very helpful to me, thank you.

    But the problem is that the main fla project is controlled by an external as3 class definition, so it doesn’t work this way.

    If you have a solution i’ll be grateful to you, if not thank you anyway!

    CodePower

    Hi gigiolamassa, You have just to follow my steps : (And this time it will work)

    • 1 : Open the « Smart Social Buttons AS3 .fla » file.
    • 2 : Go to the Library panel and locate the Movie Clip called “Main Button” (It should be easy).
    • 3 : Right click on it and hit “Copy”.
    • 4 : Open your own project (for the purpose of this example I will call it “MyProject.fla”) , and go to the Library panel of your project right click and hit “Paste” in the list.
    • Very Important To Do : when you paste the “Main Button” movie clip in your Library, Flash Pro will put an instance of it in the stage, it’s important that you delete that instance, because we will create it dynamically.
    • 5 : Now right click on the “Main Button” movie clip in the library, hit properties .
    • 6 : A dialog box appears : if it’s a smaller one, click on the ”Advanced settings” button to have access to the advance options if not that’s what we want.
    • 7 : In the Linkage section, activate the Export for ActionScript checkbox. This will activate the “Class” and “Base Class” fields.
    • 8 : The “Class” field should have this text “MainButton”, It’s okay we’ll leave it. Press the “OK” button, when you do that a warning message will appears, don’t worry about that just click “OK”.
    • 9 : You told me that your project have external AS3 file, in this case for the example I will call my external AS3 file “mainFLA.as”.
    • 10 : Open the “mainFLA.as” (I suppose that you already build your own code structure, so it will be easy):
    • - On the import section copy and paste this lines of code :
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    import flash.net.URLRequest;
    import flash.net.navigateToURL;
    
  • - After the class declaration copy and paste this line of code :
  • public var f: MainButton;
    
  • - Now When you want to add you Facebook button (After an Action, button click or new event) add this lines of code in the function you want (If you want it from the beginning add them in the constructor) :
  • f = new MainButton();
    f.x = 10;
    f.y = 10;
    f.scaleX = .5;   // This two code of lines will scale down the facebook button to 50%
    f.scaleY = .5;   //
    addChild(f);
    
    f.coloredBG_mc.gotoAndStop(2);
    f.blackBG_mc.gotoAndStop(2);
    f.bMode_btn.addEventListener(MouseEvent.MOUSE_OVER, facebookOver);
    f.bMode_btn.addEventListener(MouseEvent.MOUSE_OUT, facebookOut);
    f.bMode_btn.addEventListener(MouseEvent.CLICK, facebookClick);
    
  • - The Ultimate and the final step (We need to add three functions, they are just regular ones so you have to add them in the bottom of your class) :
  • public function facebookOver(e:MouseEvent):void{
        f.gotoAndPlay("s1");
        f.coloredBG_mc.gotoAndStop(2);
        f.shadowBG_mc.gotoAndStop(2);
    }
    
    public function facebookOut(e:MouseEvent):void{
        f.gotoAndPlay("s2");
        f.icon02_mc.gotoAndStop(1);
    }
    
    public function facebookClick(e:MouseEvent):void{
        navigateToURL(new URLRequest("http://www.facebook.com"));
    }
    
  • 11 – Save your file and run it.
  • - If you have any questions, just contact me, I’ll be glad to answer you.

    - Don’t forget to rate my item and share it if you like it, it’s highly appreciated. Thank You.

    • Bought between 10 and 49 items
    • Exclusive Author
    • Has been a member for 3-4 years
    • Italy
    • Sold between 1 and 100 dollars

    Thank you very much CodePower!!!! NOW IT WORKS GREAT !!!

    What a perfect support! Activeden should have more sellers so professional like you!

    5stars never so deserved!

    CodePower

    Thanks gigiolamassa, I’m so glad to hear from you that it works. Good luck for your project. See you.

    • Bought between 10 and 49 items
    • Exclusive Author
    • Has been a member for 3-4 years
    • Italy
    • Sold between 1 and 100 dollars

    Hello CodePower, i have another little need…

    I now have to add also other buttons inside my project, i did some tests but unsuccesfully.

    Can you help me to do this?

    Thank you!!!

    CodePower

    Hi gigiolamassa, good to see you again :) – For your request, i will do my best just tell me what do you need exactly.

    • Bought between 10 and 49 items
    • Exclusive Author
    • Has been a member for 3-4 years
    • Italy
    • Sold between 1 and 100 dollars

    Thanks to your support i inserted the facebook button into my project, as you can see here: http://www.ristorantedapepe.com/.

    Now i want to add under the Facebook button, also others: Youtube and Reddit first an so on with the others, with a smaller size. I think i’ll also buy the other buttons pack.

    I’ll be very grateful to you if you can help me to do this.

    Thank you! Gigio

    CodePower

    Hi Gigio,Sorry for the wait, this past few days i was sick :(. now i feel better and i’m working for the support that you requested, just be patient :)

    CodePower

    Hi Gigio,In this point you have the Facebook button included in your project, so adding the other buttons should be easy :).

    - Let say we want to add the “YouTube” Button.
    • 1 : Open your external AS3 file and in the declaration area paste this code (after the facebook button declaration):
    public var you: MainButton;
    
  • 2 : Locate the constructor and paste these lines of code (just like the Facebook buttons, don’t remove the Facebook code lines) :.
  • you = new MainButton();
    you.x = 10;
    you.y = 10;
    you.scaleX = .3;  //for chaning the size, in the Facebook button
    you.scaleY = .3; //it was .5 so using .3 the result should be a smaller button
    addChild(you);
    
  • 3 : Now Open your “Smart Social Buttons AS3 ” file, right click on the first frame of the “Actions” layer and hit actions on the list to open the ‘Action Panel’ now you have to locate the code for the YouTube Button ( it should be easy all the youtube code is under the comment line “//////////////////// YouTube”) – Copy the 3 first lines (they should be look like this) :.
  • youtube_mc.coloredBG_mc.gotoAndStop(7);
    youtube_mc.icon01_mc.icon02_mc.gotoAndStop(7);
    youtube_mc.blackBG_mc.gotoAndStop(11);
    
  • 4 : come back to your external AS3 file and paste them in the constructor just under the YouTube instantiation the code will look like this:
  • you = new MainButton();
    you.x = 10;
    you.y = 10;
    you.scaleX = .3;  //for chaning the size in the Facebook button
    you.scaleY = .3; //it was .5 so using .3 the result should be a smaller button
    addChild(you);
    youtube_mc.coloredBG_mc.gotoAndStop(7);
    youtube_mc.icon01_mc.icon02_mc.gotoAndStop(7);
    youtube_mc.blackBG_mc.gotoAndStop(11);
    
  • 5 : Now you have to make some changes (replace this instance ‘youtube_mc ’ by this one ‘you’ in the last 3 lines ) so the code will look like this :
  • you = new MainButton();
    you.x = 10;
    you.y = 10;
    you.scaleX = .3;  //for chaning the size in the Facebook button
    you.scaleY = .3; //it was .5 so using .3 the result should be a smaller button
    addChild(you);
    you.coloredBG_mc.gotoAndStop(7);
    you.icon01_mc.icon02_mc.gotoAndStop(7);
    you.blackBG_mc.gotoAndStop(11);
    
  • 6 : Now you have to return to your “Smart Social Buttons AS3 ” file, open the actions panel and on the youtube code section copy and paste in your AS3 file the 3 functions (paste the functions in the bottom of your class just as you did with the Facebook functions). You should have this result :
  • function youtubeOver(e:MouseEvent):void{
        youtube_mc.gotoAndPlay("s1");
        youtube_mc.coloredBG_mc.gotoAndStop(7);
        youtube_mc.shadowBG_mc.gotoAndStop(7);
        youtube_mc.icon01_mc.icon02_mc.gotoAndStop(7);
        youtube_mc.text_mc.gotoAndStop(6);
    }
    function youtubeOut(e:MouseEvent):void{
        youtube_mc.gotoAndPlay("s2");
        youtube_mc.icon02_mc.gotoAndStop(7);
    }
    function youtubeClick(e:MouseEvent):void{
        text_txt.text = "YouTube";
    }
    
  • 7 : The Ultimate and Last step is to do 3 thinks:
  • A : Replace the variable “youtube_mc” by this one “you”.
  • B : Add the keyword “public” to the functions.
  • C : Add the website link.
  • - The function will look like this :

    public function youtubeOver(e:MouseEvent):void{
        you.gotoAndPlay("s1");
        you.coloredBG_mc.gotoAndStop(7);
        you.shadowBG_mc.gotoAndStop(7);
        you.icon01_mc.icon02_mc.gotoAndStop(7);
        you.text_mc.gotoAndStop(6);
    }
    public function youtubeOut(e:MouseEvent):void{
        you.gotoAndPlay("s2");
        you.icon02_mc.gotoAndStop(7);
    }
    public function youtubeClick(e:MouseEvent):void{
        navigateToURL(new URLRequest("http://www.youtube.com/username"));
    }
    
  • 8 : Done. Enjoy.
  • - OKAY , Now you want to add the other buttons the steps are the same you have just to keep the same variable instance name so let say you want to add the “Reddit” button if you use this declaration :

    public var reddit: MainButton;
    

    - You have to repeat all the last steps and change only the instance name.

    - If you have any questions, just contact me, I’ll be glad to answer you.

    - Don’t forget to rate my item and share it if you like it, it’s highly appreciated. Thank You.

    • Bought between 10 and 49 items
    • Has been a member for 2-3 years
    • Japan

    Hey mate; this work on Android and iOS ?

    CodePower

    This Button are not optimized for Android and iOS, but I’ll definitely add this feature in future updates, THANKS.


    by
    by
    by
    by
    by