Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-11-2004, 03:23 AM   #1
HotWings
Registered User
 
Join Date: Aug 2004
Posts: 5
Default Newsreader AS Function() errors - making me ill

Hi, I copied this from another site...

but when I TRY and publish i continually get "2 errors" and I have TRIED everything to make it work... are the functions entered incorrectly? I tried adding {}, but nothing helps it run....


I marked *** Line 91 ***** and 107 **** in the AS below (very bottom of code)

thanks, this is driving me CRAZYYYYYYYYYYYY
~HotWings


----------------------------------
DEBUG ERRORS:

**Error** Symbol=Symbol 337, layer=ActionScript, frame=1:Line 91: '{' expected
scrollSlider = function (dir);

**Error** Symbol=Symbol 337, layer=ActionScript, frame=1:Line 107: Syntax error.


Total ActionScript Errors: 2 Reported Errors: 2
----------------------------------



ACTUAL ACTIONSCRIPT:

PHP Code:
setLinesVisible = function ()
{
    var 
visibleIndex 7;
    var 
pos this.holder._y;
    var 
topClips int(pos / -15);
    var 
_root.lineArr.length;
    if (
this.holder != NULL)
    {
        
variables this.holder;
        var 
feed this.holder[variables];
        
feed._visible true;
        (
true);
        
feed._visible false;
        !(
topClips >= || int(topClips visibleIndex) < i) ? false true;
        
i--;
    } 
// End of the function
// end if


setSliderHeight = function ()
{
    if (
this.holder._height initHeight)
    {
        
this.slider._height initHeight;
        
this.slider._visible false;
    }
    else
    {
        
this.slider._height initHeight * (initHeight this.holder._height);
        
this.slider._visible true;
    } 
// End of the function
// end if

initHeight 80;
speed 5;

function ()
{
    var 
scrollPos = -slider._y 1;
    var 
ratio this.initHeight this.slider._height;
    var 
newPos scrollPos ratio;
    var 
difY newPos this.holder._y;
    
this.holder._y int(this.holder._y difY speed);
// End of the function


easeDrag = function ()
{
    
setSliderHeight();
    var 
dragSpace this.initHeight this.slider._height;
    var 
ratio this.initHeight this.slider._height;
    
this.slider._y dragSpace;
    
this.holder._y int(this.slider._y ratio);
// End of the function


reposSlider = function (dir)
{
    var 
scrollSpace initHeight this.slider._height;
    var 
stepNum Math.floor(scrollSpace 8);
    var 
scrollStep int(scrollSpace stepNum);
    var 
ratio initHeight this.slider._height;
    if (
dir == -1)
    {
        
swDebug.trace("going down = " scrollStep);
        if (
this.slider._y scrollStep >= scrollSpace)
        {
            
this.slider._y this.slider._y scrollStep;
        }
        else
        {
            
this.slider._y scrollSpace;
        } 
// end if
    
}
    else
    {
        
swDebug.trace("going up = " scrollStep);
        if (
this.slider._y scrollStep >= 1)
        {
            
this.slider._y this.slider._y scrollStep;
        }
        else
        {
            
this.slider._y 1;
        } 
// end if
    
// end if
    
this.holder._y int(this.slider._y ratio);
// End of the function 
****************LINE 91*************
PHP Code:
scrollSlider = function (dir);

slider.onPress = function ()
{
    
this._parent.dragmode 1;
    var 
dragSpace this._parent.initHeight this._parent.slider._height;
    
this.startDrag(false2031203dragSpace);
// End of the function

slider.onRelease = function ()
{
    
this._parent.dragmode 0;
    
this.stopDrag();
// End of the function 
****************LINE 107****************
PHP Code:
setSliderHeight(); 

Last edited by CyanBlue; 08-11-2004 at 07:13 PM. Reason: PHP tag is applied
HotWings is offline   Reply With Quote
Old 08-11-2004, 03:33 AM   #2
tg
done
 
Join Date: Jun 2001
Location: portland, or
Posts: 8,106
Default

well, in this case, why are you defining a function with no content?
scrollSlider = function (dir);

either you would have a funciton like:

scrollSlider = function (dir){}

which would be silly considering there is no reason for the function cause it does nothing, or you mean to call the function like:
scrollSlider(dir);

don't know about the second problem, but many times if you clear up one error it clears up the others too.
__________________
tg
---
what the hell was i thinking?
tg is offline   Reply With Quote
Old 08-11-2004, 03:36 AM   #3
tg
done
 
Join Date: Jun 2001
Location: portland, or
Posts: 8,106
Default

just thought of another option.
is scrollSlider an object (like a component)?
if so maybe that liine should be
slider=new scrollSlider(dir);??
__________________
tg
---
what the hell was i thinking?
tg is offline   Reply With Quote
Old 08-11-2004, 03:51 AM   #4
HotWings
Registered User
 
Join Date: Aug 2004
Posts: 5
Default

No component

its just a movie clip - i guess (im not the best at this...)

the other weird thing is this object is this in the actionscript

----
includefiles.addfile("assetpropflasg.as")
then a ton of stuff...

then sharedObject.getLocal("news","/")
-----

i dont know if thats important or not

but
i did what you said and now the entire app just dissapears, altho no error comes up... but now the newsreader is just not there when you run it...
HotWings is offline   Reply With Quote
Old 08-11-2004, 04:02 AM   #5
HotWings
Registered User
 
Join Date: Aug 2004
Posts: 5
Default

windowdraggerclass? does that ring a bell>?
HotWings is offline   Reply With Quote
Old 08-11-2004, 03:36 PM   #6
tg
done
 
Join Date: Jun 2001
Location: portland, or
Posts: 8,106
Default

Quote:
Originally Posted by HotWings
but
i did what you said and now the entire app just dissapears, altho no error comes up... but now the newsreader is just not there when you run it...

hopefully you didn't do everything i said.... it was meant as different options to try.... so which one option made the error go away?



obviously there is not enough info here to give any meaningfull help. all we can do is guess.
__________________
tg
---
what the hell was i thinking?
tg is offline   Reply With Quote
Old 08-11-2004, 10:31 PM   #7
HotWings
Registered User
 
Join Date: Aug 2004
Posts: 5
Default

would you be open to me sending you more AS to help?
thru email or whatever?
HotWings is offline   Reply With Quote
Old 08-11-2004, 10:53 PM   #8
tg
done
 
Join Date: Jun 2001
Location: portland, or
Posts: 8,106
Default

zip and post a sample of what your doing.... either i will try to help you, or someone else will.
__________________
tg
---
what the hell was i thinking?
tg is offline   Reply With Quote
Old 08-13-2004, 09:01 PM   #9
HotWings
Registered User
 
Join Date: Aug 2004
Posts: 5
Default

Ok, ill do that when im home
HotWings is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:05 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.