AnimeGalleries [dot] NetAnimeWallpapers [dot] ComAnimeLyrics [dot] ComAnimePedia [dot] ComAnimeGlobe [dot] Com


User Tag List

+ Reply to Thread
Results 1 to 7 of 7

Thread: [Help - ActionScript] Help with compiler errors

  1. #1
    Member G-FLASH is on a distinguished road G-FLASH's Avatar
    Gil
    1,522.36
    Gender
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Latest Post
    12-12-2011 09:55 AM
    User Info Thanks / Tagging Info Gifts / Achievements / Awards vBActivity Stats
    Join Date
    Mar 2011
    Location
    R.O.G.U.E
    Age
    27
    Threads
    9
    Posts
    41
    Blog Entries
    2
    Rep Power
    0

    Post [Help - ActionScript] Help with compiler errors

    I'm basically trying to port an old app from 2004 and update it to CS5 but there seems
    to be a syntax error that i cannot understand... If anyone dose then i will
    Post the problem otherwise i wont confuse anyone..It's kinda technical.

  2. #2
    4: [Classified brah] Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris has a reputation beyond repute Eris's Avatar
    Gil
    101,951.98
    Gender
    Gifts Tuxedo Mask Rose Mario Question Block Pen
    Mentioned
    301 Post(s)
    Tagged
    0 Thread(s)
    Latest Post
    03-06-2015 01:53 AM
    User Info Thanks / Tagging Info Gifts / Achievements / Awards vBActivity Stats
    Join Date
    Aug 2001
    Location
    Tau Ceti V
    Age
    33
    Threads
    617
    Posts
    19,697
    Blog Entries
    620
    Rep Power
    14765

    Default Re: Dose anyone Uderstand Flash Action Scripting i have a few problems.

    My programming-fu is godlike. But, I've not bothered to learn AS, as programming languages should be open.

    None the less, I may be able to help you if you post an error description, as most errors generalize to other similar languages (unless it's API-specific).



    Hey look, Japan made a movie about me!

  3. #3
    Member G-FLASH is on a distinguished road G-FLASH's Avatar
    Gil
    1,522.36
    Gender
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Latest Post
    12-12-2011 09:55 AM
    User Info Thanks / Tagging Info Gifts / Achievements / Awards vBActivity Stats
    Join Date
    Mar 2011
    Location
    R.O.G.U.E
    Age
    27
    Threads
    9
    Posts
    41
    Blog Entries
    2
    Rep Power
    0

    Post Re: Dose anyone Uderstand Flash Action Scripting i have a few problems.

    Quote Originally Posted by Eris View Post
    My programming-fu is godlike. But, I've not bothered to learn AS, as programming languages should be open.

    None the less, I may be able to help you if you post an error description, as most errors generalize to other similar languages (unless it's API-specific).
    I get this **Error** Scene=Scene1, layer=d1, frame=1:Line 1: Statement block must be terminated by '}'

    Have a look at this


    onClipEvent(enterFrame) { _root.preloader.bar._xscale = siteLoaded; siteLoaded = int(((loaded_bytes / total_bytes) * 100)); total_bytes = _root.getBytesTotal(); loaded_bytes = _root.getBytesLoaded(); remaining_bytes = total_bytes - loaded_bytes; frame_loaded = _root._framesloaded; frame_total = _root._totalframes; totalkb = "int((total_bytes / 1024)) + KB"; loadedkb = "int((loaded_bytes / 1024)) + KB"; remaining_kb = int((remaining_bytes / 1024)); remainingkb = "int(remaining_kb) + KB"; percent_done = "int(((loaded_bytes / total_bytes) * 100)) + %"; time = getTimer() / 1000; speed = loaded_bytes / time; bits = speed / 1024; Kbps = "(Math.round(bits * 10) / 10) + KB/S"; kbyteCounter = (total_bytes - loaded_bytes) / 1024; loadRate = (loaded_bytes / 1024) / time; timeCounter = kbyteCounter / loadRate; minutes = Math.floor(timeCounter / 60); seconds = Math.round((timeCounter / 60 - minutes) * 60); time_remaining = minutes + " min " + seconds + " sec"; minute = Math.floor(time / 60); second = Math.round((time / 60 - minute) * 60); time_elapsed = minute + " min " + second + " sec"; if(total_bytes == loaded_bytes) { _root.gotoAndPlay(2); } // end if }

    so Basically i was trying to Fix an old pre-loader which i had back in the days when Flash was Macromedia and not Adobe... (yeah the good old days) d=
    The dilemma is the last Save was on the MX 2004 Flash series which would make my Fla File obsolete but not impossible...

    I spent a good 1 hour and 20 mins trying to see where the enclosed } <----- was meant to be put...


    The preLoader is meant to look like this...





    But when it was Up-fitted to CS5 this was the result...





    I can't really say why this is happening...Flash Action scripting is one of my poorest understandings but i know the CS5 Port has different Coding Sequences that have surpassed the Flash 8 and MX through Time...
    I personally think i should send you the Two files and you can then figure it out practically if you want to get your hands dirty d=)
    Last edited by G-FLASH; 03-22-2011 at 10:15 PM.

  4. #4
    Copyright 2013 FS FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD's Avatar
    Gil
    6,123.46
    Gender
    My Mood
    Lonely
    Gifts Ice Cream Bamboo Cup Notebook
    Mentioned
    212 Post(s)
    Tagged
    0 Thread(s)
    Latest Post
    12-22-2019 10:47 AM
    User Info Thanks / Tagging Info Gifts / Achievements / Awards vBActivity Stats
    Join Date
    Jun 2005
    Location
    I would like to know that too. O_o;;
    Age
    35
    Threads
    160
    Posts
    2,880
    Blog Entries
    5
    AW Wallpapers
    3
    Rep Power
    2196

    Default Re: Dose anyone Uderstand Flash Action Scripting i have a few problems.

    It's hard to read that code, but copy pasting it into an editor shows that your whole code is inside only one line. Assuming this is the case in your code and not the forum's way to format code posted with no code tags, the error means the } at the end is not seen due to the single line comment.

    In other words your code should look like this:
    Code:
    onClipEvent(enterFrame)
    {
    	_root.preloader.bar._xscale = siteLoaded;
    	siteLoaded = int(((loaded_bytes / total_bytes) * 100));
    	total_bytes = _root.getBytesTotal(); loaded_bytes = _root.getBytesLoaded();
    	remaining_bytes = total_bytes - loaded_bytes;
    	frame_loaded = _root._framesloaded;
    	frame_total = _root._totalframes;
    	totalkb = "int((total_bytes / 1024)) + KB";
    	loadedkb = "int((loaded_bytes / 1024)) + KB";
    	remaining_kb = int((remaining_bytes / 1024));
    	remainingkb = "int(remaining_kb) + KB";
    	percent_done = "int(((loaded_bytes / total_bytes) * 100)) + %";
    	time = getTimer() / 1000;
    	speed = loaded_bytes / time;
    	bits = speed / 1024;
    	Kbps = "(Math.round(bits * 10) / 10) + KB/S";
    	kbyteCounter = (total_bytes - loaded_bytes) / 1024;
    	loadRate = (loaded_bytes / 1024) / time;
    	timeCounter = kbyteCounter / loadRate;
    	minutes = Math.floor(timeCounter / 60);
    	seconds = Math.round((timeCounter / 60 - minutes) * 60);
    	time_remaining = minutes + " min " + seconds + " sec";
    	minute = Math.floor(time / 60);
    	second = Math.round((time / 60 - minute) * 60);
    	time_elapsed = minute + " min " + second + " sec";
    	
    	if(total_bytes == loaded_bytes) { _root.gotoAndPlay(2); } // end if
    }
    Other than that I'm not sure why there are so many brackets .... then again I don't speak AS. ~_~;;

  5. #5
    Member G-FLASH is on a distinguished road G-FLASH's Avatar
    Gil
    1,522.36
    Gender
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Latest Post
    12-12-2011 09:55 AM
    User Info Thanks / Tagging Info Gifts / Achievements / Awards vBActivity Stats
    Join Date
    Mar 2011
    Location
    R.O.G.U.E
    Age
    27
    Threads
    9
    Posts
    41
    Blog Entries
    2
    Rep Power
    0

    Default Re: Dose anyone Uderstand Flash Action Scripting i have a few problems.

    Yeah d=) i think it's down to untidyness... the CS5 may have
    disfigured the settings to how it originally was set....
    to be honest looking at te way you formed it I'm 95% sure this that the right way..
    Believe im no pro at AS either but thank you for spending time to help me on this.. *Bows in gratitude*

    Here have some Rep+

    (Update) it was a success but the only issue i'm getting is that the dynamic information digits are still not showing...
    Last edited by G-FLASH; 03-23-2011 at 08:12 AM.

  6. #6
    Copyright 2013 FS FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD's Avatar
    Gil
    6,123.46
    Gender
    My Mood
    Lonely
    Gifts Ice Cream Bamboo Cup Notebook
    Mentioned
    212 Post(s)
    Tagged
    0 Thread(s)
    Latest Post
    12-22-2019 10:47 AM
    User Info Thanks / Tagging Info Gifts / Achievements / Awards vBActivity Stats
    Join Date
    Jun 2005
    Location
    I would like to know that too. O_o;;
    Age
    35
    Threads
    160
    Posts
    2,880
    Blog Entries
    5
    AW Wallpapers
    3
    Rep Power
    2196

    Default Re: Dose anyone Uderstand Flash Action Scripting i have a few problems.

    Quote Originally Posted by G-FLASH View Post
    (Update) it was a success but the only issue i'm getting is that the dynamic information digits are still not showing...
    Sadly I don't speak AS, but some good old debugging methods should help here. Start by checking that all your variables are geting the values they should and then move on to graphics issues (even though I kinda doubt that there are any).

    For one, I kinda feel weird when I see this:
    Code:
    remainingkb = "int(remaining_kb) + KB";
    Why would you use quotation marks for the whole variable. Logic would say it should be int(remaining_kb) + "KB";

    or this:
    Code:
    remaining_kb = int((remaining_bytes / 1024));
    Here it should be enough to just use int(remaining_bytes / 1024);

    As I already stated before I don't speak AS and these might as well be legit syntaxes for the language, but if this is not the case it can be a good reason why your code doesn't work as it should.

  7. #7
    Guest ╠-The Neo-╣ is infamous around these parts ╠-The Neo-╣ is infamous around these parts ╠-The Neo-╣ is infamous around these parts ╠-The Neo-╣ is infamous around these parts ╠-The Neo-╣ is infamous around these parts ╠-The Neo-╣ is infamous around these parts ╠-The Neo-╣ is infamous around these parts ╠-The Neo-╣ is infamous around these parts ╠-The Neo-╣ is infamous around these parts ╠-The Neo-╣ is infamous around these parts ╠-The Neo-╣ is infamous around these parts ╠-The Neo-╣'s Avatar
    Gil
    8,941.79
    Gender
    My Mood
    Devilish
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Latest Post
    05-16-2011 12:00 PM
    User Info Thanks / Tagging Info Gifts / Achievements / Awards vBActivity Stats
    Join Date
    Apr 2011
    Location
    Tucson, Arizona, United States
    Age
    27
    Threads
    19
    Posts
    99
    Blog Entries
    10
    Rep Power
    0
    Gamer IDs

    Gamertag: Silverneo288

    Default Re: [Help - ActionScript] Help with compiler errors

    I'm probably the only flash guru here xD AS is my language, by the looks of it yes it has been stated that you are putting quotes around the whole variables here is a quick touch up on your code
    Code:
    onClipEvent(enterFrame)
    {
    	_root.preloader.bar._xscale = siteLoaded;
    	siteLoaded = int(((loaded_bytes / total_bytes) * 100));
    	total_bytes = _root.getBytesTotal(); loaded_bytes = _root.getBytesLoaded();
    	remaining_bytes = total_bytes - loaded_bytes;
    	frame_loaded = _root._framesloaded;
    	frame_total = _root._totalframes;
    	totalkb = int((total_bytes / 1024)) + "KB";
    	loadedkb = int((loaded_bytes / 1024)) + "KB";
    	remaining_kb = int((remaining_bytes / 1024));
    	remainingkb = int(remaining_kb) + "KB";
    	percent_done = int(((loaded_bytes / total_bytes) * 100)) + "%";
    	time = getTimer() / 1000;
    	speed = loaded_bytes / time;
    	bits = speed / 1024;
    	Kbps = (Math.round(bits * 10) / 10) + "KB/S";
    	kbyteCounter = (total_bytes - loaded_bytes) / 1024;
    	loadRate = (loaded_bytes / 1024) / time;
    	timeCounter = kbyteCounter / loadRate;
    	minutes = Math.floor(timeCounter / 60);
    	seconds = Math.round((timeCounter / 60 - minutes) * 60);
    	time_remaining = minutes + " min " + seconds + " sec";
    	minute = Math.floor(time / 60);
    	second = Math.round((time / 60 - minute) * 60);
    	time_elapsed = minute + " min " + second + " sec";
    	
    	if(total_bytes == loaded_bytes) { _root.gotoAndPlay(2); } // end if
    }
    there ya go, if you continue to have any problems, just reply
    "I'd rather you hate me for everything I am
    Than have you love me for something that I can't"



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Chat errors?
    By Bulf in forum Site Issues / Questions
    Replies: 1
    Last Post: 07-16-2008, 08:43 PM
  2. Errors on Hakuna Matata
    By margielf in forum Lyric Corrections
    Replies: 1
    Last Post: 05-08-2007, 08:51 PM
  3. cookie errors?
    By Ranshiin in forum Site Issues / Questions
    Replies: 3
    Last Post: 12-06-2006, 02:38 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts