• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Move object to specific position

Explorer ,
Jun 27, 2023 Jun 27, 2023

Copy link to clipboard

Copied

I was thinking this would be an in built function but I cant find it.
Maybee it needs to be scripted. I would like to move an object to a certain x/y position when pressing a button. I can not use the motion function. 

I have to objects that when pressing a button I need them to go to a position and at the same time set two variables to 0. The variables are the easy part 🙂

Views

239

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 27, 2023 Jun 27, 2023

Copy link to clipboard

Copied

Why cannot you use a motion effect? You need to create a custom motion effect (and use guides for precise positioning) and use an advanced action where you combine the value assigments of the variables with the application of the custom effect. More information in:

https://blog.lilybiri.com/how-to-use-custom-effect-in-actions

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 27, 2023 Jun 27, 2023

Copy link to clipboard

Copied

I am using that But I need to position the object at its original position and cant use the custom motion for that

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 27, 2023 Jun 27, 2023

Copy link to clipboard

Copied

What do you mean, please can you explain more in detail. Maybe show screenshots. I suspect you are on non-responsive project because coordinates don't make sense for a responsive project.

Using guides allows you to position them in an exact x and y location. Or edit the XML file.

You can create custom effects in two directions using the same guides. Have a look at this example:

https://blog.lilybiri.com/sliding-menu

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 27, 2023 Jun 27, 2023

Copy link to clipboard

Copied

All I want is to be able to click a button and the object will be positioned at a certain x/y. Not with animation or anything like that.

The project is packed with javascript/actionscript that control video and other object and to prevent to mess up anything I just need the object to change coordinates. cant explaine why. Just need it 🙂

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 27, 2023 Jun 27, 2023

Copy link to clipboard

Copied

You asked about a 'move' but now you tell that you don't want motion. This is confusing.

Why not use a simple multistate object, with an empty state and a state with the object in the correct position. The button just needs to change the state. If there is an original position, do the reverse there: Normal has its positon, custom state is empty.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jun 27, 2023 Jun 27, 2023

Copy link to clipboard

Copied

I would agree that multistate object is easiest way to simply have the object appear in another position with a click and no animations.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jun 27, 2023 Jun 27, 2023

Copy link to clipboard

Copied

The tricky part about this is that positioning is relative in Captivate for most things like this. So basically the start position of every object will be 0,0 and you end up calculating the number of pixels to move the item from there

Suppose I have a box inititally located at position 50,50 - this is 0,0 for that item

If I wanted to move it to 0,0 for the stage - I need to move it using the top and left parameters

$("#boxc").animate({left:-50});

$("#boxc").animate({top:-50});

With this setup - you would see two discrete movements. This would slide left first and then up. If you wanted a more direct and diagonal movement you could combine the above.

$("#boxc").animate({left:-50,top:-50});

From the 0,0 position of the stage - if I now wish to move the box to 100,100 on the stage

$("#boxc").animate({left:50});

$("#boxc").animate({top:50});

Notice that I have to consider the 0,0 position of the item and go right and down from there - rather than the current position.

I would suggest making a blank slide and experimenting with this a little before adding it to your current project.

Let me know if you have any questions about this 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 29, 2023 Jun 29, 2023

Copy link to clipboard

Copied

Thank you for reaching out. And to lilybiri. Seems like there is no easy way to get one object to move to another place without using a from of transition.


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 29, 2023 Jun 29, 2023

Copy link to clipboard

Copied

Did you use the alternative by using two multistate objects. Even @Stagprime agreed that this was the easiest way to avoid any movement. Sorry that I was confused by the verb 'move' which to me is pointing to a movement. I am not a native English speaker, and am used to UK English.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 10, 2023 Jul 10, 2023

Copy link to clipboard

Copied

CpExtra does have command variables which allow you to do so. Such as:

They work best in standard Captivate projects. It's very difficult to position something reliably in a responsive project.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 11, 2023 Jul 11, 2023

Copy link to clipboard

Copied

Thanks Tristan, forgot to mention this. It has been a confusing thread.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 30, 2023 Jul 30, 2023

Copy link to clipboard

Copied

LATEST

Thanx Tristan. I have your plugin so will be using that!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources