A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 30

Thread: Button/Scene/Action Script issues in Rich Media Ads

  1. #1
    Junior Member
    Join Date
    Jan 2014
    Location
    Seattle, WA
    Posts
    12

    Button/Scene/Action Script issues in Rich Media Ads

    Hi,

    This is my first time posting but I'm a long time reader of advice here. I am working on 2 rich media ads and one works perfectly with some buttons switching the rich load SWF to different scenes. But in a second version, the buttons jump the SWF file back to the first scene for some reason.

    If you click on the link below you'll see the 300x600 ad works smoothly. It does a quick play of the content then allows the user to click through the decades timeline forward and backward.

    http://www.flashtalking.net/view/?109647

    But the pushdown (728x90-500) does the quick play and then, on the "In-Line Solenoid Fuel Pumps" scene, when you press the forward arrow it jumps back and does the quick play all over again. I double checked the button and it goes to the correct scene. It's quite frustrating.

    I'm posting here to see if anyone has any thoughts. I'm on deadline of course (the ad was due Friday)/ Any thoughts? Contact me and I can send the FLA files.

    Thanks,

    Brad

  2. #2
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    May I help? You can inbox me with the .fla's links.
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  3. #3
    Junior Member
    Join Date
    Jan 2014
    Location
    Seattle, WA
    Posts
    12
    Thanks Angelhdz! What's your email?

  4. #4
    Junior Member
    Join Date
    Jan 2014
    Location
    Seattle, WA
    Posts
    12
    All, here's the FLA files (CS6).

    https://www.hightail.com/download/el...TXZKV09VbDhUQw

    Thanks!

    Brad

  5. #5
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Ok, i'm a little bit confused. What FLA has the issue?
    RichMedia_728x90-500_FuelHistory_base, RichMedia_728x90-500_FuelHistory_rich, or both?
    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
    In the scene "Solenoid_from_Unitec", in the button "next button", change the code to:

    PHP Code:
    on(release) {
    gotoAndPlay("Electric_from_Solenoid"2)

    I think that playing from frame "1" is the issue. And i don't know why. But playing from frame 2, seems to be working now. No "repeat all" again issue
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  7. #7
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Ok there are a lot of issues. I removed the "play()" from the script of the first frame of all the scenes, and it solved partially the issue. Then i
    still had an issue with the previous button of the scene "Solenoid_from_Electric". I changed the script to "gotoAndPlay("Unitec_from_Solenoid", 2)"
    and it got solved. So that take me to realize, the MAIN ISSUE lies in the script of the first frame of each scene. I saw a "delete this.onEnterFrame;" maybe that's the conflictive code. But if you gotoAndPlay to the frame "2" of each scene, it works perfectly.
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  8. #8
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Yeah. That's the conflictive script, the "delete this.onEnterFrame;". I commented it out, and everythigs work perfectly now.

    Instead of using "this" you should use the name of the loading function, or the name of any moviclip you like. If you delete "this" onEnterFrame, you are deleting the onEnterFrame of the whole movie, the whole timeline, so it will be all wrong. "This" refereces the current timeline/stage.
    So replace all the "delete this.onEnterFrame;" and the "this.onEnterFrame = function() {" of the first frame of all the scenes, with "delete SomeMovieClip.EnterFrame;" and "SomeMovieClip.onEnterFrame = function() {".

    PD: I don't think you need to make the loading script to load all the scenes, because the WHOLE movie is preloaded when the swf starts.
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  9. #9
    Junior Member
    Join Date
    Jan 2014
    Location
    Seattle, WA
    Posts
    12
    Quote Originally Posted by angelhdz View Post
    In the scene "Solenoid_from_Unitec", in the button "next button", change the code to:

    PHP Code:
    on(release) {
    gotoAndPlay("Electric_from_Solenoid"2)

    I think that playing from frame "1" is the issue. And i don't know why. But playing from frame 2, seems to be working now. No "repeat all" again issue
    Thank you, thank you, thank you! That seems to have done the trick angelhdz!
    http://www.flashtalking.net/view/?109647

    Now I just need the close button to work... any ideas? It works on this pushdown I did a while ago (click on the second link).
    http://www.flashtalking.net/view/?103097

  10. #10
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    I can't open the links. It says "Flash player 8 or higher required." and i have Flash player 12...

    But let me check your .fla about the close button.
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  11. #11
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    What is supposed to DO the close button?
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  12. #12
    Junior Member
    Join Date
    Jan 2014
    Location
    Seattle, WA
    Posts
    12
    Quote Originally Posted by angelhdz View Post
    I can't open the links. It says "Flash player 8 or higher required." and i have Flash player 12...

    But let me check your .fla about the close button.
    Thanks, that's weird. Yeah, the close button is supposed to return the ad to the collapsed state where the user can click "expand" to expand the ad.

  13. #13
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    It's complicated, because the ftContract(); and the ftExpand(); functions are inside external Components. I don't know how to reference it because the main .fla (RichMedia_728x90-500_FuelHistory_base) Components don't even have instances names. I can not open these Components to see how they work. But i guess, that in the close button you have to put something like this:

    On the RichMedia_728x90-500_FuelHistory_rich .fla's close buttons:
    PHP Code:
    on (release) {
        
    trace("asd");
    _parent._parent.nameOfTheComponent.ftContract();

    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  14. #14
    Junior Member
    Join Date
    Jan 2014
    Location
    Seattle, WA
    Posts
    12
    Quote Originally Posted by angelhdz View Post
    It's complicated, because the ftContract(); and the ftExpand(); functions are inside external Components. I don't know how to reference it because the main .fla (RichMedia_728x90-500_FuelHistory_base) Components don't even have instances names. I can not open these Components to see how they work. But i guess, that in the close button you have to put something like this:

    On the RichMedia_728x90-500_FuelHistory_rich .fla's close buttons:
    PHP Code:
    on (release) {
        
    trace("asd");
    _parent._parent.nameOfTheComponent.ftContract();

    Angelhdz, I know what you are saying about the external components. Flashtalking's system is kind of complicated, well at least for me. I figured it out though! It works now. I just used:

    on (release) {
    ftContract();
    }

    Works great now!

    http://www.flashtalking.net/view/?109647

    Thanks for all of your help!

  15. #15
    Junior Member
    Join Date
    Jan 2014
    Location
    Seattle, WA
    Posts
    12

    300x250 version issues

    Hi Angelhdz, any thoughts on why I have similar problems with this 300x250 version? Same code, but it's jumping all over the place. So weird! Thoughts?

    http://www.flashtalking.net/view/?109647

    Here's the FLA files:

    https://www.hightail.com/download/el...U1B5UkVFSzhUQw

  16. #16
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    remove the play(); in the last line of code in the first frame of every Scene.
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  17. #17
    Junior Member
    Join Date
    Jan 2014
    Location
    Seattle, WA
    Posts
    12
    Quote Originally Posted by angelhdz View Post
    remove the play(); in the last line of code in the first frame of every Scene.
    That did it! removing play(); is a much better solution than jumping to frame 2. Thanks SO MUCH!

  18. #18
    Senior Member
    Join Date
    Nov 2001
    Posts
    1,145
    The ad server (company that hosts the ad files) either has you add their code to yours (download extension) or the wrap your swfs in theirs. They have an api (code to use their code). These are public I think.

    So when your ad does anything that needs to be tracked, you use their code - cilckthroughs, expand, close, play video, etc.

    When your flash is run by actionscript (code controls everything), you shouldn't use scenes and your main timeline should only have one frame and all your code in one frame (you can link out to .as files). Try it on your next flash, you'll see how things clear up when you get things centralized.

  19. #19
    Junior Member
    Join Date
    Jan 2014
    Location
    Seattle, WA
    Posts
    12
    Quote Originally Posted by moot View Post
    The ad server (company that hosts the ad files) either has you add their code to yours (download extension) or the wrap your swfs in theirs. They have an api (code to use their code). These are public I think.

    So when your ad does anything that needs to be tracked, you use their code - cilckthroughs, expand, close, play video, etc.

    When your flash is run by actionscript (code controls everything), you shouldn't use scenes and your main timeline should only have one frame and all your code in one frame (you can link out to .as files). Try it on your next flash, you'll see how things clear up when you get things centralized.
    Why do you suggest not using scenes?

  20. #20
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Ballen, i think most of the people on this forum, will suggest NOT using scenes. Scenes are for complex animations. But for applications, websites, ads, its a lot better using frames, and functions. Also, the flash .swf weight, will be extremely increased by using a lot of scenes, movieclips, animations. You can use dynamic Tweens to animate the elements (no need of timeline tweens).
    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