PDA

View Full Version : how to make a command deal with all pages



mimo
08-17-2009, 11:39 AM
how to make a command deal with all the pages . all i want is to create a button in the main menu (first page) which change images or text in all the pages of the project . like a changing language button which change text and images in all the pages of my project . so please help and if there are any example for it that would be very helpful .

Centauri Soldier
08-17-2009, 03:32 PM
Oh, the Class Action Plugin (http://www.indigorose.com/forums/showthread.php?p=142415#post142415) just might do it...

holtgrewe
08-18-2009, 07:54 AM
Another way would be to set up tables with the object names and properties you need to change for the appropriate objects and the related functions in the global functions section.

On Page preload of each page, enumerate the objects and execute the appropriate global functions.

An attached example shows the ability of changing images and labels on 2 different pages. (this is a bit cryptic but shows violin and piano images and text interchangeable; and should give you ideas for your project.)

hth

Centauri Soldier
08-18-2009, 01:29 PM
That's what the Class plugin does. Combine it with the Group plugin and he would have exactly what you have described, holtgrewe, but a much easier time of it.

mimo
08-18-2009, 03:59 PM
thanks, i will give both of them a try.

mimo
08-18-2009, 04:06 PM
i tried combination between class and group plugins . but i don't know what to do after that .

Centauri Soldier
08-18-2009, 04:36 PM
First, a new version of Class and GlobalPaths are out...get the latest versions.

Create a table with your desired page properties and use the Class.PageDefine() action.
Then use the Class.PageInherit() action to apply the changes to all of your pages using a loop with the Application.GetPages() action to create a list of pages with which to work.

e.g.

--list all desired page properties in this table
tPageProps = {};
--blah blah blah (YOU NEED TO PUT SOME PROPERTIES HERE)


--define the class
Class.PageDefine("Page Class", tPageProps);

--list all project pages
tAllPages = Application.GetPages();

for nIndex, sPage in tAllPages do
--assign the class to the current page
result = Class.PageInherit("Page Class", sPage, true);
end

The Group plugin would come in handy for assigning classes to multiple objects.

NOTE: In order to ensure that new plugin versions are updated, you must remove the old versions form your project's plugin folder as well as your AMS Plugins folder.

mimo
08-19-2009, 07:36 AM
so what will the example be , if i have page called (1feel) and i want to set an image called (1) invisible in it and an image called (2) visible in the same page .

mimo
08-19-2009, 08:24 AM
i attached example of what i want to do exactly please help me with the script for doing this .
i uploaded it to rapidshare (no viruses be sure 100%)

http://rapidshare.com/files/269119009/My_example.rar.html

holtgrewe
08-19-2009, 01:18 PM
That's what the Class plugin does. Combine it with the Group plugin and he would have exactly what you have described, holtgrewe, but a much easier time of it.

I'm all about "easier"; however if you need to install 2 or more plugins, then through "trial and error" try to figure out how the plugins work...IMHO that's not exactly "easier".
If you could put together a mini-example of the usage of the plugins, it would probably be quite helpful to many users.

Respectfully,
holtgrewe

mimo
08-20-2009, 06:06 PM
so , what about the example i uploaded to rapidshare ??. no downloads to it at all till now . why it is just 2 mega . please help me with it .