Author Topic: Tweaks for HTC Hero and HTC Hero Based themes - A tutorial by siris_cac  (Read 5761 times)

Offline demyan

  • DFG Member
  • *
  • Posts: 70
  • Reputation: 6
Save the settings on HTC Hero.
Frame 1.
1. Change the function function load_xml()
Code: [Select]
function load_xml()
{
    xml = new XML();
    xml.ignoreWhite = true;
    xml.onLoad = function (success)
    {
        if (success)
        {
            model = xml.firstChild.firstChild.childNodes[0].attributes.model;
            fontHeightAdjustment = Number(xml.firstChild.firstChild.childNodes[1].attributes.fontHeightAdjustment);
            if (Number(xml.firstChild.firstChild.childNodes[2].attributes.invertedScrolling) == 1)
            {
                invertScroll = true;
            }
            var _loc6 = xml.firstChild.firstChild.childNodes[3].attributes.temperatureUnit;
            if (_loc6.toUpperCase() == "F")
            {
                temperatureUnit = "F";
            }
            if (Number(xml.firstChild.firstChild.childNodes[4].attributes.ampm) == 1)
            {
                ampm = true;
            }
            var _loc5 = Number(xml.firstChild.firstChild.childNodes[5].attributes.numberOfWallpapers);
            if (_loc5 > 1)
            {
                numOfWallpapers = _loc5;
            }
            var _loc4 = Number(xml.firstChild.firstChild.childNodes[6].attributes.numberOfWidgets);
            if (_loc4 > 1)
            {
                numOfWidgets = _loc4;
            }
            if (model == 4 && Number(xml.firstChild.firstChild.childNodes[7].attributes.startStudio) == 1)
            {
                platform.launch_module("fid:0x10000f38");
            }
            hideInterface();
            numOfLauncherItems = Number(xml.firstChild.childNodes[1].childNodes.length);
            var _loc2 = 0;
            while (_loc2 < numOfLauncherItems)
            {
                l_str[_loc2] = xml.firstChild.childNodes[1].childNodes[_loc2].attributes.str;
                l_id[_loc2] = xml.firstChild.childNodes[1].childNodes[_loc2].attributes.id;
                l_loc[_loc2] = xml.firstChild.childNodes[1].childNodes[_loc2].attributes.loc;
                l_icon[_loc2] = xml.firstChild.childNodes[1].childNodes[_loc2].attributes.icon;
                ++_loc2;
            }
            var _loc1 = 0;
            while (_loc1 < 8)
            {
                var _loc2 = 0;
                while (_loc2 < 20)
                {
d_str[_loc1][_loc2] = my_so_str.data.d_str[_loc1][_loc2];
    d_id[_loc1][_loc2] = my_so_id.data.d_id[_loc1][_loc2];
    d_loc[_loc1][_loc2] = my_so_loc.data.d_loc[_loc1][_loc2];
    d_icon[_loc1][_loc2] = my_so_icon.data.d_icon[_loc1][_loc2];
if(d_str[_loc1][_loc2] == undefined)
{
                    d_str[_loc1][_loc2] = "";
                    d_id[_loc1][_loc2] = "";
                    d_loc[_loc1][_loc2] = "";
                    d_icon[_loc1][_loc2] = "";
}
                    ++_loc2;
                }
                ++_loc1;
            }
            settingsName = xml.firstChild.childNodes[2].nodeName;
            var _loc3 = settingsName.indexOf("_");
            while (_loc3 >= 0)
            {
                settingsName = settingsName.substring(0, _loc3) + " " + settingsName.substring(_loc3 + 1);
                _loc3 = settingsName.indexOf("_");
            }
            var _loc2 = 0;
            while (_loc2 < xml.firstChild.childNodes[2].childNodes.length)
            {
                s_str[_loc2] = xml.firstChild.childNodes[2].childNodes[_loc2].attributes.str;
                s_id[_loc2] = xml.firstChild.childNodes[2].childNodes[_loc2].attributes.id;
                s_loc[_loc2] = xml.firstChild.childNodes[2].childNodes[_loc2].attributes.loc;
                s_des[_loc2] = xml.firstChild.childNodes[2].childNodes[_loc2].attributes.des;
                ++_loc2;
            }
            moreName = xml.firstChild.childNodes[3].nodeName;
            var _loc3 = moreName.indexOf("_");
            while (_loc3 >= 0)
            {
                moreName = moreName.substring(0, _loc3) + " " + moreName.substring(_loc3 + 1);
                _loc3 = moreName.indexOf("_");
            }
            var _loc2 = 0;
            while (_loc2 < xml.firstChild.childNodes[3].childNodes.length)
            {
                m_str[_loc2] = xml.firstChild.childNodes[3].childNodes[_loc2].attributes.str;
                m_id[_loc2] = xml.firstChild.childNodes[3].childNodes[_loc2].attributes.id;
                m_loc[_loc2] = xml.firstChild.childNodes[3].childNodes[_loc2].attributes.loc;
                m_des[_loc2] = xml.firstChild.childNodes[3].childNodes[_loc2].attributes.des;
                ++_loc2;
            }
            load_itemData();
            return;
        }
        loadingScreen.errorMsg.text = "Error: Configuration File Not Found (HTCHeroConfig.xml).";
    }
    ;
    xml.load(this._url.slice(0, this._url.lastIndexOf("/")) + "/HTCHeroConfig.xml");
}
2. Change the function function loadWallpaper()
Code: [Select]
function loadWallpaper()
{
if(wallpaperNum == undefined)
{
wallpaperNum = 1;
}
    wallpaper = new LoadVars();
    wallpaper._parent = this;
    wallpaper.onLoad = function (success)
    {
        if (success)
        {
            wall.loadMovie(wallpaperURL + wallpaperNum + ".jpg");
            return;
        }
        wall.loadMovie(wallpaperURL + wallpaperNum + ".swf");
    }
    ;
    wallpaper.load(wallpaperURL + wallpaperNum + ".jpg");
}
3. Change the variable var wallpaperNum = 1;
Code: [Select]
var wallpaperNum;4. Add variables
Code: [Select]
var my_so_loc;
var my_so_id;
var my_so_str;
var my_so_icon;
var my_so_wallp;
5. Change the code
load_xml();
stop();

Code: [Select]
my_so_loc = SharedObject.getLocal("loc", "/");
my_so_id = SharedObject.getLocal("id", "/");
my_so_str = SharedObject.getLocal("str", "/");
my_so_icon = SharedObject.getLocal("icon", "/");
my_so_wallp = SharedObject.getLocal("wallp", "/");
tmrloading = setInterval(loading, 2000);
function loading()
{
clearInterval(tmrloading);
wallpaperNum = my_so_wallp.data.wallpaperNum;
load_xml();
}
stop();
Frame 2.
1. Add a function function saveData()
Code: [Select]
function saveData()
{
my_so_str.data.d_str = d_str;
my_so_id.data.d_id = d_id;
my_so_loc.data.d_loc = d_loc;
my_so_icon.data.d_icon = d_icon;
my_so_wallp.data.wallpaperNum = wallpaperNum;
my_so_str.flush();
my_so_id.flush();
my_so_loc.flush();
my_so_icon.flush();
my_so_wallp.flush();
}
2. Change the function function launcherAnimation(str, from)
Code: [Select]
function launcherAnimation(str, from)
{
    var speed = 13;
    if (str == "delete")
    {
        animation = true;
        dock.onEnterFrame = function ()
        {
            dock._y = dock._y + speed;
            if (dock._y >= 379)
            {
                speed = speed * -1;
                dock.gotoAndStop(3);
            }
            else if (dock._y == 359)
            {
                dock.onEnterFrame = null;
                delete dock.onEnterFrame;
                animation = false;
                if (from == "desktop")
                {
                    desktop["p" + itemPressed]._xscale = 120;
                    desktop["p" + itemPressed]._yscale = 120;
                }
                else
                {
                    launcher.items["p" + itemPressed]._xscale = 120;
                    launcher.items["p" + itemPressed]._yscale = 120;
                } // end else if
            } // end else if
        };
    }
    else if (!animation)
    {
        dock.onEnterFrame = function ()
        {
            dock._y = dock._y + speed;
            if (dock._y >= 379)
            {
                speed = speed * -1;
                dock.gotoAndStop(1);
                dock.scroller._x = -desktop._x / 7 + 120;
                dock.scroller._y = scrollerY[desktopPos - 1];
                dock.scroller._rotation = scrollerDeg[desktopPos - 1];
            }
            else if (dock._y == 359)
            {
                dock.onEnterFrame = null;
                delete dock.onEnterFrame;
            } // end else if
        };
    }
    else
    {
        dock.onEnterFrame = null;
        delete dock.onEnterFrame;
        dock._y = 359;
        dock.gotoAndStop(1);
        dock.scroller._x = -desktop._x / 7 + 120;
        dock.scroller._y = scrollerY[desktopPos - 1];
        dock.scroller._rotation = scrollerDeg[desktopPos - 1];
    } // end else if
fscommand2("Set", "Widget", "1", "5", "5");
saveData();
} // End of the function
Frame 4.
1. Change the function function closeChanger()
Code: [Select]
function closeChanger()
{
    if (widgetChangerOpen)
    {
        widgetPreview.deleteWidget();
        widgetPreview.unloadMovie();
        widgetPreview._y = -160;
        widgetChangerOpen = false;
        loading.swapDepths(wall);
    }
    else if (wallChangerOpen)
    {
        wallChangerOpen = false;
        if (wallpaperNumSave != wallpaperNum)
        {
            wallpaperNum = wallpaperNumSave;
            loadWallpaper();
        }
    }
    loading._x = 400;
    dock.gotoAndStop(1);
    reversePrevent();
    wallChanger._x = 400;
    launcher._y = 400;
    desktop._y = 0;
    gotoAndPlay(2);
fscommand2("Set", "Widget", "1", "5", "5");
saveData();
}

Darkforest Group Handset Forums


Offline John brac

  • Experienced Member
  • *
  • Posts: 95
  • Reputation: 0
  • DFG User
  • Firmware: MFJF1, JTJL2, JPKC1, XEJE1
  • Model: GT-S5620
  • Mods: monte-sense
  • Service: Vodafone
Does it work on monte????
edit:i tried it......
IT WORKS!!!!!!!!!!!!!!!!OMG!!!!!!!!!IT WORKS!!!!!!!!!!!!!!!!!
thank you soooooooo much demyan........
it is also a chance for me to learn SO handlers
any help regarding to moding and i am here........

Offline demyan

  • DFG Member
  • *
  • Posts: 70
  • Reputation: 6
Naturally!
For example, put the code in the Monte-Hero v1.7 beta for s5620:
Code: [Select]
http://depositfiles.com/files/j8r57ipxbSource:
Code: [Select]
http://depositfiles.com/files/9x55iivy5

Offline siris_cac

  • Master Modifier
  • Global Moderator
  • *
  • Posts: 1204
  • Reputation: 2
  • Monte Elite Modder
    • SiriS's CaC's Mod For s5620
  • Firmware: XEJE1,MFJF1,DDJE1,DDKC1,JPKC1
  • Model: Samsung Monte GT-s5620 , Google Nexus Verizon
  • Mods: MonteEvo HD,HTC Sensation HD,Android 3.0 Honeycomb,HTC HD2 with SENse UI,v-Black,OSX Landscape,Android Gingerbread 3.0,Panonhideung,Windows SPB Shell 5,Windows Aero,Monte Hero,I-phone...
  • Service: AirTel-IND , Verizon - 4G
it works ..
Regards,
siris
Connect on Facebook: http://www.facebook.com/siriscacmods
Subscribe me on Youtube: www.youtube.com/siriscac

Offline demyan

  • DFG Member
  • *
  • Posts: 70
  • Reputation: 6
Now, we will replace the text color and background text icons (for example, in the Monte-Hero v1.7 beta for s5620).
Frame 1.
function setDesktop(desk)
In the block of code
Code: [Select]
else if (d_id[desk][_loc3] != "")
            {
                desktop.attachMovie("AllIcons", "p" + (_loc3 + 20 * desk + 1), _loc3 + 20 * desk + 2, {_x: -691 + 240 * desk + 60 * _loc4, _y: 55 + 63 * _loc5});
                desktop["p" + (_loc3 + 20 * desk + 1)].gotoAndStop(Number(d_icon[desk][_loc3]));
                desktop["p" + (_loc3 + 20 * desk + 1)].label.iconText.text = d_str[desk][_loc3];
                desktop["p" + (_loc3 + 20 * desk + 1)].label.iconText._y = desktop["p" + (_loc3 + 20 * desk + 1)].label.iconText._y + fontHeightAdjustment;
                desktop["p" + (_loc3 + 20 * desk + 1)].label.iconText.autoSize = "center";
                checkTextWidth(desktop["p" + (_loc3 + 20 * desk + 1)].label.iconText);
                var _loc9 = Math.round(desktop["p" + (_loc3 + 20 * desk + 1)].label.iconText._width / 10);
desktop["p" + (_loc3 + 20 * desk + 1)].label.textbg.gotoAndStop(_loc9);
                desktop["p" + (_loc3 + 20 * desk + 1)].num = _loc3 + 20 * desk + 1;
                desktop["p" + (_loc3 + 20 * desk + 1)].id = d_id[desk][_loc3];
                desktop["p" + (_loc3 + 20 * desk + 1)].loc = d_loc[desk][_loc3];
                desktop["p" + (_loc3 + 20 * desk + 1)].desk = desk;
                desktop["p" + (_loc3 + 20 * desk + 1)].pos = _loc3;
add the line desktop["p" + (_loc3 + 20 * desk + 1)].label.iconText.textColor = txtclr;
Where txtclr - is the variable color of the text:
txtclr = 0x000000 (black)
txtclr = 0xFFFFFF (wite)
txtclr = 0xFF0000 (red)
Line desktop["p" + (_loc3 + 20 * desk + 1)].label.textbg.gotoAndStop(_loc9); is responsible for the text background. If you delete it, then the background will not be.
If you add this code desktop["p" + (_loc3 + 20 * desk + 1)].label.textbg._alpha = 50; before the line, the background will be transparent (50%).
Frame 2.
function addIcon(avaliableNum, position, id, loc, str, iconi, desk)
In the block of code
Code: [Select]
function addIcon(avaliableNum, position, id, loc, str, iconi, desk)
{
    trace ("add icon");
    desktop.attachMovie("AllIcons", "p" + avaliableNum, avaliableNum + 1, {_x: xmsave, _y: ymsave});
    desktop["p" + avaliableNum].gotoAndStop(Number(iconi));
    desktop["p" + avaliableNum].label.iconText.text = str;
    desktop["p" + avaliableNum].label.iconText._y = desktop["p" + avaliableNum].label.iconText._y + fontHeightAdjustment;
    desktop["p" + avaliableNum].label.iconText.autoSize = "center";
    checkTextWidth(desktop["p" + avaliableNum].label.iconText);
    var _loc5 = Math.round(desktop["p" + avaliableNum].label.iconText._width / 10);
    desktop["p" + avaliableNum].label.textbg.gotoAndStop(_loc5);
    desktop["p" + avaliableNum].num = avaliableNum;
    desktop["p" + avaliableNum].pos = position;
    desktop["p" + avaliableNum].id = id;
    desktop["p" + avaliableNum].loc = loc;
    desktop["p" + avaliableNum].desk = desk;
    d_str[desk][position] = str;
    d_id[desk][position] = id;
    d_loc[desk][position] = loc;
    d_icon[desk][position] = iconi;
necessary to make the same changes.
Then, you need to make the change to the phone memory, as indicated previously.
I did it to demonstrate:
Code: [Select]
http://depositfiles.com/files/uh1cqicuwSource:
Code: [Select]
http://depositfiles.com/files/5b7e7n2z0

Darkforest Group Handset Forums


Offline demyan

  • DFG Member
  • *
  • Posts: 70
  • Reputation: 6
As promised fix for the virtual keyboard (for example, in the Monte-Hero v1.7 beta for s5620).
Frame 1.
Add variable
Code: [Select]
var trgaddtohome = 0;Frame 3.
Set the condition to start the frame. Change this code
addtohome.list.setMask(addtohome.masker);
setAddToHome();
stop();

Code: [Select]
if(trgaddtohome == 1)
{
addtohome.list.setMask(addtohome.masker);
setAddToHome();
trgaddtohome = 0;
}
else
{
gotoAndPlay(2);
}
stop ();
Starting frame allow only selected buttons:
1. Sprite Dock. Frame 1. Add code _root.trgaddtohome = 1; to the buttons btn1btn and btn3btn
Code: [Select]
btn1btn.onPress = function ()
{
_root.trgaddtohome = 1;
    if (!_parent.screenLock)
    {
        fscommand2("Set", "Widget", "1", "2", "0");
        platform.touch_sound();
        currentState = btn1._currentframe;
        btn1.gotoAndStop(currentState + 1);
    } // end if
};
Code: [Select]
btn3btn.onPress = function ()
{
_root.trgaddtohome = 1;
    if (!_parent.screenLock)
    {
        fscommand2("Set", "Widget", "1", "2", "0");
        platform.touch_sound();
        btn3.gotoAndStop(2);
    } // end if
};
Also, add this code to the button Add to (button 224) on the Quick Launch (sprite 232)
Code: [Select]
on (press)
{
_root.trgaddtohome = 1;
    fscommand2("Set", "Widget", "1", "2", "0");
}
on (release)
{
    _root.gotoAndPlay(2);
    _root.advanceScr.gotoAndStop(1);
}
I did it to demonstrate:
Code: [Select]
http://depositfiles.com/files/e5yfazd0eSource:
Code: [Select]
http://depositfiles.com/files/5tkv0io8b

Offline John brac

  • Experienced Member
  • *
  • Posts: 95
  • Reputation: 0
  • DFG User
  • Firmware: MFJF1, JTJL2, JPKC1, XEJE1
  • Model: GT-S5620
  • Mods: monte-sense
  • Service: Vodafone
As promised fix for the virtual keyboard (for example, in the Monte-Hero v1.7 beta for s5620).
Frame 1.
Add variable
Code: [Select]
var trgaddtohome = 0;Frame 3.
Set the condition to start the frame. Change this code
addtohome.list.setMask(addtohome.masker);
setAddToHome();
stop();

Code: [Select]
if(trgaddtohome == 1)
{
addtohome.list.setMask(addtohome.masker);
setAddToHome();
trgaddtohome = 0;
}
else
{
gotoAndPlay(2);
}
stop ();
Starting frame allow only selected buttons:
1. Sprite Dock. Frame 1. Add code _root.trgaddtohome = 1; to the buttons btn1btn and btn3btn
Code: [Select]
btn1btn.onPress = function ()
{
_root.trgaddtohome = 1;
    if (!_parent.screenLock)
    {
        fscommand2("Set", "Widget", "1", "2", "0");
        platform.touch_sound();
        currentState = btn1._currentframe;
        btn1.gotoAndStop(currentState + 1);
    } // end if
};
Code: [Select]
btn3btn.onPress = function ()
{
_root.trgaddtohome = 1;
    if (!_parent.screenLock)
    {
        fscommand2("Set", "Widget", "1", "2", "0");
        platform.touch_sound();
        btn3.gotoAndStop(2);
    } // end if
};
Also, add this code to the button Add to (button 224) on the Quick Launch (sprite 232)
Code: [Select]
on (press)
{
_root.trgaddtohome = 1;
    fscommand2("Set", "Widget", "1", "2", "0");
}
on (release)
{
    _root.gotoAndPlay(2);
    _root.advanceScr.gotoAndStop(1);
}
I did it to demonstrate:
Code: [Select]
http://depositfiles.com/files/e5yfazd0eSource:
Code: [Select]
http://depositfiles.com/files/5tkv0io8b
i dont get it what does this do????
any help regarding to moding and i am here........

Offline demyan

  • DFG Member
  • *
  • Posts: 70
  • Reputation: 6
1.Improve Speed:

      Goto the 2nd frame of the theme.Scroll down,
       You ll have a part like this,
     
Code: [Select]
else if (_root._ymouse > 25 && _root._ymouse < 353)
        {
            startTimer();
            var _loc6 = xm;
            var _loc5 = ym;
            var instDeskPos;
            desktop.onEnterFrame = null;
            desktop.onMouseMove = function ()
            {
                if (!itemDrag && (xm - _root._xmouse > 1 || xm - _root._xmouse < -1 || drag))
                {
                    drag = true;
                    timeA = 0;
                    dx = xm - _root._xmouse;
                    if (desktop._x - dx > 720)
                    {
                        desktop._x = 720;
                        wall._x = 0;
                        dock.scroller._x = 1.710000E+001;
                        dock.scroller._y = 12;
                        dock.scroller._rotation = -11;
                    }
                    else if (desktop._x - dx < -720)
                    {
                        desktop._x = -720;
                        wall._x = -240;
                        dock.scroller._x = 2.228500E+002;
                        dock.scroller._y = 12;
                        dock.scroller._rotation = 11;
                    }
                    else
                    {
                        desktop._x = desktop._x -dx;
                        desktopX = desktop._x;
                        wall._x = desktop._x / 6 - 120;
                        dock.scroller._x = -desktop._x / 7 + 120;
                        instDeskPos = 1 + (-desktop._x + 720) / 240;
                        dock.scroller._rotation = (instDeskPos - 4) * 4;
                        instDeskPos = instDeskPos < 4 ? (8 - instDeskPos) : (instDeskPos);
                        dock.scroller._y = (instDeskPos - 4) * (instDeskPos - 4) + 2;
                    } // end else if
                    xm = _root._xmouse;
                }
            desktop.onMouseMove = function ()
         
         
        Now,
        Add this,
        desktop._x = desktop._x - dx * 1.5;
        To the last else part.
        Voila sliding speed is much more faster!.
        You can vary the value from 1.0 to 2.0..
        1.0 - has maximum speed(But no slide effect.)
        So, 1.5 is optimal.

It increases only manual scrolling.
I adjust the scroll speed in such a way:
Frame 1.
Add variable speed
Code: [Select]
var scrll;The most suitable value of the variable speed: 1; 1.5; 2; 3.
Frame 2.
Replace the code
Code: [Select]
       var count = 0;
                desktop.onEnterFrame = function ()
                {
                    desktopDist = (endx - desktop._x) / 2;
                    scrollerYChange = (scrollerY[desktopPos - 1] - dock.scroller._y) / 2;
                    scrollerDegChange = (scrollerDeg[desktopPos - 1] - dock.scroller._rotation) / 2;
                    if (count > 3)
                    {
                        desktop.onEnterFrame = null;
                        desktop._x = endx;
                        wall._x = endwx;
                        dock.scroller._x = -desktop._x / 7 + 120;
                        dock.scroller._y = scrollerY[desktopPos - 1];
                        dock.scroller._rotation = scrollerDeg[desktopPos - 1];
                        delete desktop.onEnterFrame;
                    }
                    else if (!screenLock)
                    {
                        ++count;
                        desktop._x = desktop._x + desktopDist;
                        wall._x = desktop._x / 6 - 120;
                        dock.scroller._x = -desktop._x / 7 + 120;
                        dock.scroller._y = dock.scroller._y + scrollerYChange;
                        dock.scroller._rotation = dock.scroller._rotation + scrollerDegChange;
                    } // end else if
                };
on this code
Code: [Select]
desktop.onEnterFrame = function(): Void  {
desktopDist = (endx - desktop._x) / scrll;
scrollerYChange = (scrollerY[desktopPos - 1] - dock.scroller._y) / 2;
scrollerDegChange = (scrollerDeg[desktopPos - 1] - dock.scroller._rotation) / 2;
                    if (Math.round(desktop._x) == endx)
                    {
desktop.onEnterFrame = null;
                        desktop._x = endx;
                        wall._x = endwx;
                        dock.scroller._x = -desktop._x / 7 + 120;
                        dock.scroller._y = scrollerY[desktopPos - 1];
                        dock.scroller._rotation = scrollerDeg[desktopPos - 1];
                        delete desktop.onEnterFrame;
                    }
                    else if (!screenLock)
                    {
                        desktop._x += desktopDist;
                        wall._x = desktop._x / 6 - 120;
                        dock.scroller._x = -desktop._x / 7 + 120;
                        dock.scroller._y = dock.scroller._y + scrollerYChange;
                        dock.scroller._rotation = dock.scroller._rotation + scrollerDegChange;
    }
};
This provides a smoother animation.

Here is an example of use (settings menu - press and hold the button "+"):
Code: [Select]
http://depositfiles.com/files/fhac50y91

Offline Jonny

  • Android Developer
  • Super Moderator
  • *****
  • Posts: 520
  • Reputation: 6
  • DarkSense Developer
    • DarkSense ROM's
  • Buy me a drink
  • Firmware: Android 4.0.4 With HTC Sense 4.1
  • Model: HTC Sensation XE with Beats Audio Z715e
  • Mods: DarkSense 1.3.2/DarkSense Beta versions , DarkForest Sensation XE ICS 7.3.0
  • Service: O2 - U.K
is there a way to clear data from sharedobject, eg if we mess something up on a starevo (montehero equiv on star) and want to start again what code would we put on the button to clear so data?
Follow me on Twitter

Offline siris_cac

  • Master Modifier
  • Global Moderator
  • *
  • Posts: 1204
  • Reputation: 2
  • Monte Elite Modder
    • SiriS's CaC's Mod For s5620
  • Firmware: XEJE1,MFJF1,DDJE1,DDKC1,JPKC1
  • Model: Samsung Monte GT-s5620 , Google Nexus Verizon
  • Mods: MonteEvo HD,HTC Sensation HD,Android 3.0 Honeycomb,HTC HD2 with SENse UI,v-Black,OSX Landscape,Android Gingerbread 3.0,Panonhideung,Windows SPB Shell 5,Windows Aero,Monte Hero,I-phone...
  • Service: AirTel-IND , Verizon - 4G
the code is quite complex.
i ll give you a widget soon..
Regards,
siris
Connect on Facebook: http://www.facebook.com/siriscacmods
Subscribe me on Youtube: www.youtube.com/siriscac

Offline demyan

  • DFG Member
  • *
  • Posts: 70
  • Reputation: 6
is there a way to clear data from sharedobject, eg if we mess something up on a starevo (montehero equiv on star) and want to start again what code would we put on the button to clear so data?
the code is quite complex.
i ll give you a widget soon..
On the contrary. It's very simple. Cleanup files SharedObject:
1. My modification (button 1)
Code: [Select]
btn1.onRelease = function ()
{
_root.my_so_loc.clear();
_root.my_so_id.clear();
_root.my_so_str.clear();
_root.my_so_icon.clear();
_root.my_so_wallp.clear();
_root.my_so_set.clear();
}
2. MonteEvo (button 2)
Code: [Select]
btn2.onRelease = function ()
{
_root.STO.clear();
_root.IO.clear();
_root.LO.clear();
_root.ICO.clear();
_root.SO.clear();
}
3. DroidSense (button 3)
Code: [Select]
btn3.onRelease = function ()
{
_root.my_so.clear();
}
Empty files SharedObject are deleted from the phone automatically.

Widget for removal SharedObject:
Code: [Select]
http://depositfiles.com/files/6k1z2ytfj

Offline Jonny

  • Android Developer
  • Super Moderator
  • *****
  • Posts: 520
  • Reputation: 6
  • DarkSense Developer
    • DarkSense ROM's
  • Buy me a drink
  • Firmware: Android 4.0.4 With HTC Sense 4.1
  • Model: HTC Sensation XE with Beats Audio Z715e
  • Mods: DarkSense 1.3.2/DarkSense Beta versions , DarkForest Sensation XE ICS 7.3.0
  • Service: O2 - U.K
Thanks demyan, I've been looking for this for a while :)
Follow me on Twitter

Offline siris_cac

  • Master Modifier
  • Global Moderator
  • *
  • Posts: 1204
  • Reputation: 2
  • Monte Elite Modder
    • SiriS's CaC's Mod For s5620
  • Firmware: XEJE1,MFJF1,DDJE1,DDKC1,JPKC1
  • Model: Samsung Monte GT-s5620 , Google Nexus Verizon
  • Mods: MonteEvo HD,HTC Sensation HD,Android 3.0 Honeycomb,HTC HD2 with SENse UI,v-Black,OSX Landscape,Android Gingerbread 3.0,Panonhideung,Windows SPB Shell 5,Windows Aero,Monte Hero,I-phone...
  • Service: AirTel-IND , Verizon - 4G
Demyan,
You need to have a restart theme code.. or something else..
Bec. the position saving in MonteEvo is set by using setInterval ..
so.. after that you must add _root.gotoAndStop(1);
Regards,
siris
Connect on Facebook: http://www.facebook.com/siriscacmods
Subscribe me on Youtube: www.youtube.com/siriscac

Offline demyan

  • DFG Member
  • *
  • Posts: 70
  • Reputation: 6
OK. Also, to clean you can use other mods. Something like LiveGadget.  :)

Offline demyan

  • DFG Member
  • *
  • Posts: 70
  • Reputation: 6
Now, we change the number of tables.
Frame 1.
1. Add variable:
Code: [Select]
var dp;where dp is 1, 3, 5, 7.
2. Add conditions to the function setDesktop(desk):
Code: [Select]
function setDesktop(desk)
{
if(dp == 7)
{
    if (desk < 0 || desk > 6)
    {
        return undefined;
    }
}
if(dp == 5)
{
    if (desk < 0 || desk > 6 || desk == 1 || desk == 5)
    {
        return undefined;
    }
}
if(dp == 3)
{
    if (desk < 0 || desk > 6 || desk == 1 || desk == 2 || desk == 4 || desk == 5)
    {
        return undefined;
    }
}
if(dp == 1)
{
    if (desk < 3 || desk > 3)
    {
        return undefined;
    }
}
and the function removeDesktop(desk):
Code: [Select]
function removeDesktop(desk)
{
if(dp == 7)
{
    if (desk < 0 || desk > 6)
    {
        return undefined;
    }
}
if(dp == 5)
{
    if (desk < 0 || desk > 6 || desk == 2 || desk == 4)
    {
        return undefined;
    }
}
if(dp == 3)
{
    if (desk < 0 || desk > 6 || desk == 1 || desk == 2 || desk == 4 || desk == 5)
    {
        return undefined;
    }
}
if(dp == 1)
{
    if (desk < 3 || desk > 3)
    {
        return undefined;
    }
}
Frame 2.
1. Create the conditions for entry into the this.onMouseDown = function ():
Code: [Select]
if(dp == 7)
{
this.onMouseDown = function ()
{
Code: [Select]
if(dp == 5)
{
this.onMouseDown = function ()
{
Code: [Select]
if(dp == 3)
{
this.onMouseDown = function ()
{
Code: [Select]
if(dp == 1)
{
this.onMouseDown = function ()
{
We'll have to significantly increase the code, but to improve the smoothness necessary to satisfy the condition if() before entering the function, not in it.
2. For each value of dp specifies the algorithm scroll:
- for dp = 7;
Code: [Select]
if (desktop._x <= endx - 40)
{
++desktopPos;
}
else if (desktop._x >= endx + 40)
{
--desktopPos;
} // end else if
- for dp = 5;
Code: [Select]
if (desktop._x <= endx - 40)
{
if(desktopPos == 1 || desktopPos == 5)
{
++desktopPos;
++desktopPos;
}
else
{
++desktopPos;
}
}
else if (desktop._x >= endx + 40)
{
if(desktopPos == 3 || desktopPos == 7)
{
--desktopPos;
--desktopPos;
}
else
{
--desktopPos;
}
} // end else if
- for dp = 3;
Code: [Select]
if (desktop._x <= endx - 40)
{
++desktopPos;
++desktopPos;
++desktopPos;
}
else if (desktop._x >= endx + 40)
{
--desktopPos;
--desktopPos;
--desktopPos;
} // end else if
- for dp = 1; delete a block of code
Code: [Select]
if (desktop._x <= endx - 40)
{
++desktopPos;
}
else if (desktop._x >= endx + 40)
{
--desktopPos;
} // end else if

Here is an example of use (settings menu - press and hold the button "+"):
Code: [Select]
http://depositfiles.com/files/6wpgreluy

Darkforest Group Handset Forums


Tags: